diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-28 15:59:06 +0000 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-28 15:59:06 +0000 |
commit | 6388bc8c2306bb70b2e211beb7f7f9ce1a2496d6 (patch) | |
tree | 30e93ce363e92c353b4e13f05e98eec689ba864b /client/trunk/src/com | |
parent | ff65e9ee2f7145265dc9c3daacfc2d5fd0756d3f (diff) | |
download | instadisc-6388bc8c2306bb70b2e211beb7f7f9ce1a2496d6.tar.gz instadisc-6388bc8c2306bb70b2e211beb7f7f9ce1a2496d6.tar.bz2 instadisc-6388bc8c2306bb70b2e211beb7f7f9ce1a2496d6.zip |
Client: Worked more on step 2
Refs #69
Diffstat (limited to 'client/trunk/src/com')
5 files changed, 18 insertions, 9 deletions
diff --git a/client/trunk/src/com/fourisland/instadisc/DownloadItem/DownloadItemMode.java b/client/trunk/src/com/fourisland/instadisc/DownloadItem/DownloadItemMode.java index 157a62a..9d7efc0 100644 --- a/client/trunk/src/com/fourisland/instadisc/DownloadItem/DownloadItemMode.java +++ b/client/trunk/src/com/fourisland/instadisc/DownloadItem/DownloadItemMode.java | |||
@@ -1,13 +1,12 @@ | |||
1 | package com.fourisland.instadisc.DownloadItem; | 1 | package com.fourisland.instadisc.DownloadItem; |
2 | 2 | ||
3 | import java.util.Timer; | ||
4 | |||
5 | public interface DownloadItemMode | 3 | public interface DownloadItemMode |
6 | { | 4 | { |
7 | public void modeInitalize(); | 5 | public void modeInitalize(); |
8 | public void modeDeinitalize(); | 6 | public void modeDeinitalize(); |
9 | 7 | ||
10 | public void requestRetained(); | 8 | public void requestRetained(); |
9 | public void sendItem(int id); | ||
11 | 10 | ||
12 | public int setTimer(); | 11 | public int setTimer(); |
13 | public void timerTick(); | 12 | public void timerTick(); |
diff --git a/client/trunk/src/com/fourisland/instadisc/DownloadItem/ModeControl.java b/client/trunk/src/com/fourisland/instadisc/DownloadItem/ModeControl.java index 73b48c8..9801b74 100644 --- a/client/trunk/src/com/fourisland/instadisc/DownloadItem/ModeControl.java +++ b/client/trunk/src/com/fourisland/instadisc/DownloadItem/ModeControl.java | |||
@@ -31,10 +31,13 @@ public class ModeControl implements DownloadItemMode | |||
31 | dim.modeDeinitalize(); | 31 | dim.modeDeinitalize(); |
32 | } | 32 | } |
33 | 33 | ||
34 | public void requestRetained() | 34 | public void requestRetained() { |
35 | { | ||
36 | dim.requestRetained(); | 35 | dim.requestRetained(); |
37 | } | 36 | } |
37 | |||
38 | public void sendItem(int id) { | ||
39 | dim.sendItem(id); | ||
40 | } | ||
38 | 41 | ||
39 | public int setTimer() { | 42 | public int setTimer() { |
40 | return dim.setTimer(); | 43 | return dim.setTimer(); |
diff --git a/client/trunk/src/com/fourisland/instadisc/DownloadItem/PullMode.java b/client/trunk/src/com/fourisland/instadisc/DownloadItem/PullMode.java index 8e54542..46f71a5 100644 --- a/client/trunk/src/com/fourisland/instadisc/DownloadItem/PullMode.java +++ b/client/trunk/src/com/fourisland/instadisc/DownloadItem/PullMode.java | |||
@@ -13,6 +13,10 @@ public class PullMode implements DownloadItemMode | |||
13 | public void requestRetained() { | 13 | public void requestRetained() { |
14 | throw new UnsupportedOperationException("Not supported yet."); | 14 | throw new UnsupportedOperationException("Not supported yet."); |
15 | } | 15 | } |
16 | |||
17 | public void sendItem(int id) { | ||
18 | throw new UnsupportedOperationException("Not supported yet."); | ||
19 | } | ||
16 | 20 | ||
17 | public int setTimer() { | 21 | public int setTimer() { |
18 | throw new UnsupportedOperationException("Not supported yet."); | 22 | throw new UnsupportedOperationException("Not supported yet."); |
diff --git a/client/trunk/src/com/fourisland/instadisc/DownloadItem/PushMode.java b/client/trunk/src/com/fourisland/instadisc/DownloadItem/PushMode.java index 2e5a6ca..7fb7a4b 100644 --- a/client/trunk/src/com/fourisland/instadisc/DownloadItem/PushMode.java +++ b/client/trunk/src/com/fourisland/instadisc/DownloadItem/PushMode.java | |||
@@ -37,6 +37,12 @@ public class PushMode implements DownloadItemMode | |||
37 | XmlRpc xmlrpc = new XmlRpc("requestRetained"); | 37 | XmlRpc xmlrpc = new XmlRpc("requestRetained"); |
38 | xmlrpc.execute(); | 38 | xmlrpc.execute(); |
39 | } | 39 | } |
40 | |||
41 | public void sendItem(int id) { | ||
42 | XmlRpc xmlrpc = new XmlRpc("sendItem"); | ||
43 | xmlrpc.addParam(id); | ||
44 | xmlrpc.execute(); | ||
45 | } | ||
40 | 46 | ||
41 | public int setTimer() { | 47 | public int setTimer() { |
42 | int delay = (1000 * 60 * 60); | 48 | int delay = (1000 * 60 * 60); |
diff --git a/client/trunk/src/com/fourisland/instadisc/Item/WellFormedItem.java b/client/trunk/src/com/fourisland/instadisc/Item/WellFormedItem.java index 05b5378..9cc644d 100644 --- a/client/trunk/src/com/fourisland/instadisc/Item/WellFormedItem.java +++ b/client/trunk/src/com/fourisland/instadisc/Item/WellFormedItem.java | |||
@@ -7,6 +7,7 @@ package com.fourisland.instadisc.Item; | |||
7 | import com.fourisland.instadisc.Database.Filter; | 7 | import com.fourisland.instadisc.Database.Filter; |
8 | import com.fourisland.instadisc.Database.Subscription; | 8 | import com.fourisland.instadisc.Database.Subscription; |
9 | import com.fourisland.instadisc.Database.Wrapper; | 9 | import com.fourisland.instadisc.Database.Wrapper; |
10 | import com.fourisland.instadisc.DownloadItem.ModeControl; | ||
10 | import com.fourisland.instadisc.Functions; | 11 | import com.fourisland.instadisc.Functions; |
11 | import com.fourisland.instadisc.Item.Categories.Category; | 12 | import com.fourisland.instadisc.Item.Categories.Category; |
12 | import com.fourisland.instadisc.XmlRpc; | 13 | import com.fourisland.instadisc.XmlRpc; |
@@ -182,11 +183,7 @@ public class WellFormedItem { | |||
182 | Verification ver = new Verification(ivid); | 183 | Verification ver = new Verification(ivid); |
183 | good = aThis.headerMap.get("Verification").equals(ver.getHash()); | 184 | good = aThis.headerMap.get("Verification").equals(ver.getHash()); |
184 | } catch (VerificationIDReusedException ex) { | 185 | } catch (VerificationIDReusedException ex) { |
185 | XmlRpc xmlrpc = new XmlRpc("resendItem"); | 186 | ModeControl.INSTANCE.sendItem(Integer.decode(aThis.headerMap.get("ID"))); |
186 | String id = aThis.headerMap.get("ID"); | ||
187 | int iid = Integer.decode(id); | ||
188 | xmlrpc.addParam(iid); | ||
189 | xmlrpc.execute(); | ||
190 | } catch (Exception ex) { | 187 | } catch (Exception ex) { |
191 | Logger.getLogger(WellFormedItem.class.getName()).log(Level.SEVERE, null, ex); | 188 | Logger.getLogger(WellFormedItem.class.getName()).log(Level.SEVERE, null, ex); |
192 | } | 189 | } |