01: package com.coldcore.coloradoftp.command.impl;
02:
03: import com.coldcore.coloradoftp.command.Command;
04: import com.coldcore.coloradoftp.command.Reply;
05: import com.coldcore.coloradoftp.connection.ControlConnection;
06:
07: /**
08: * Command wrapper.
09: * This class is for extensions wishing to operate on existing command
10: * and stay independent of future interface changes.
11: */
12: public class CommandWrapper implements Command {
13:
14: protected Command command;
15:
16: public CommandWrapper(Command command) {
17: super ();
18: this .command = command;
19: if (command == null)
20: throw new IllegalArgumentException("Invalid command");
21: }
22:
23: public boolean processInInterruptState() {
24: return command.processInInterruptState();
25: }
26:
27: public boolean canClearInterruptState() {
28: return command.canClearInterruptState();
29: }
30:
31: public String getName() {
32: return command.getName();
33: }
34:
35: public void setName(String name) {
36: command.setName(name);
37: }
38:
39: public String getParameter() {
40: return command.getParameter();
41: }
42:
43: public void setParameter(String parameter) {
44: command.setParameter(parameter);
45: }
46:
47: public Reply execute() {
48: return command.execute();
49: }
50:
51: public Reply executeOnParent(Command parent) {
52: return command.executeOnParent(parent);
53: }
54:
55: public void setConnection(ControlConnection connection) {
56: command.setConnection(connection);
57: }
58:
59: public ControlConnection getConnection() {
60: return command.getConnection();
61: }
62: }
|