KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > applications > packaging > sharehandlers > ShareClientSession


1 /*
2  * This software is OSI Certified Open Source Software.
3  * OSI Certified is a certification mark of the Open Source Initiative.
4  * The license (Mozilla version 1.0) can be read at the MMBase site.
5  * See http://www.MMBase.org/license
6  */

7 package org.mmbase.applications.packaging.sharehandlers;
8
9 import java.net.HttpURLConnection JavaDoc;
10 import java.net.URL JavaDoc;
11
12 import org.mmbase.util.Encode;
13 import org.mmbase.util.logging.Logger;
14 import org.mmbase.util.logging.Logging;
15
16 /**
17  * @author Daniel Ockeloen
18  */

19 public class ShareClientSession {
20
21     // logger
22
private static Logger log = Logging.getLoggerInstance(ShareClientSession.class);
23
24     private String JavaDoc callbackurl;
25
26
27     /**
28      *Constructor for the ShareClientSession object
29      *
30      * @param callbackurl Description of the Parameter
31      */

32     public ShareClientSession(String JavaDoc callbackurl) {
33         this.callbackurl = callbackurl;
34     }
35
36
37     /**
38      * Description of the Method
39      *
40      * @param myid Description of the Parameter
41      * @return Description of the Return Value
42      */

43     public boolean sendRemoteSignal(String JavaDoc myid) {
44         String JavaDoc url = callbackurl + "?id=" + Encode.encode("ESCAPE_URL_PARAM",myid);
45         log.info("sending signal =" + url);
46         try {
47             URL JavaDoc includeURL = new URL JavaDoc(url);
48             HttpURLConnection JavaDoc connection = (HttpURLConnection JavaDoc) includeURL.openConnection();
49             Object JavaDoc o = connection.getContent();
50         } catch (Exception JavaDoc e) {
51             // e.printStackTrace();
52
// should we remove them if we get a error ?
53
}
54         return true;
55     }
56
57 }
58
59
Popular Tags