about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-09-28 15:59:06 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-09-28 15:59:06 +0000
commit6388bc8c2306bb70b2e211beb7f7f9ce1a2496d6 (patch)
tree30e93ce363e92c353b4e13f05e98eec689ba864b
parentff65e9ee2f7145265dc9c3daacfc2d5fd0756d3f (diff)
downloadinstadisc-6388bc8c2306bb70b2e211beb7f7f9ce1a2496d6.tar.gz
instadisc-6388bc8c2306bb70b2e211beb7f7f9ce1a2496d6.tar.bz2
instadisc-6388bc8c2306bb70b2e211beb7f7f9ce1a2496d6.zip
Client: Worked more on step 2
Refs #69
-rw-r--r--client/trunk/src/com/fourisland/instadisc/DownloadItem/DownloadItemMode.java3
-rw-r--r--client/trunk/src/com/fourisland/instadisc/DownloadItem/ModeControl.java7
-rw-r--r--client/trunk/src/com/fourisland/instadisc/DownloadItem/PullMode.java4
-rw-r--r--client/trunk/src/com/fourisland/instadisc/DownloadItem/PushMode.java6
-rw-r--r--client/trunk/src/com/fourisland/instadisc/Item/WellFormedItem.java7
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 @@
1package com.fourisland.instadisc.DownloadItem; 1package com.fourisland.instadisc.DownloadItem;
2 2
3import java.util.Timer;
4
5public interface DownloadItemMode 3public 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;
7import com.fourisland.instadisc.Database.Filter; 7import com.fourisland.instadisc.Database.Filter;
8import com.fourisland.instadisc.Database.Subscription; 8import com.fourisland.instadisc.Database.Subscription;
9import com.fourisland.instadisc.Database.Wrapper; 9import com.fourisland.instadisc.Database.Wrapper;
10import com.fourisland.instadisc.DownloadItem.ModeControl;
10import com.fourisland.instadisc.Functions; 11import com.fourisland.instadisc.Functions;
11import com.fourisland.instadisc.Item.Categories.Category; 12import com.fourisland.instadisc.Item.Categories.Category;
12import com.fourisland.instadisc.XmlRpc; 13import 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 }