diff options
author | lado <herrlado@gmail.com> | 2011-10-20 03:58:37 +0200 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2011-10-20 03:58:37 +0200 |
commit | 4dcadc5fc5ad5172d90c90290830607c32f88243 (patch) | |
tree | c9eb31f4fbb1e8781b432e264303483486eca492 | |
parent | 344d581f0ab5ece5f8605312dfadb3f7f809ce94 (diff) | |
download | vdr-manager-4dcadc5fc5ad5172d90c90290830607c32f88243.tar.gz vdr-manager-4dcadc5fc5ad5172d90c90290830607c32f88243.tar.bz2 |
protocol changes
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SetTimerClient.java | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SetTimerClient.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SetTimerClient.java index 0863c6d..c1e0f73 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SetTimerClient.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SetTimerClient.java @@ -10,10 +10,24 @@ import de.bjusystems.vdrmanager.data.Timer; */ public class SetTimerClient extends SvdrpClient<Timer> { + public enum TimerOperation { + CREATE("C"),// + DELETE("D"),// + MODIFY("M");// + private String command; + private TimerOperation(String command){ + this.command = command; + } + public String getCommand(){ + return this.command; + } + + } + /** channel names for timer */ Timer timer; /** timer should be deleted */ - boolean deleteTimer; + private TimerOperation timerOperation; /** * Constructor @@ -21,10 +35,10 @@ public class SetTimerClient extends SvdrpClient<Timer> { * @param port port * @param ssl use ssl */ - public SetTimerClient(final Timer timer, final boolean deleteTimer) { + public SetTimerClient(final Timer timer, TimerOperation op) { super(); this.timer = timer; - this.deleteTimer = deleteTimer; + this.timerOperation = op; } /** @@ -36,12 +50,11 @@ public class SetTimerClient extends SvdrpClient<Timer> { final StringBuilder command = new StringBuilder(); command.append("timer "); - if (deleteTimer) { - command.append("-"); - } + command.append(timerOperation.getCommand()); + command.append(timer.getNumber()); command.append(" "); - command.append(timer.toCommandLine()); + command.append(timer.toCommandLine(timerOperation)); runCommand(command.toString()); } |