Re: [JXTA discuss] CMS ListContentRequest
Mouhannad Al-Sayegh <[email protected]> Mon, 17 Apr 2006 11:24:40 +0000 (GMT)
| Newsgroups | gmane.comp.java.jxta.general |
|---|---|
| Message-ID | <[email protected]> |
--0-2045223422-1145273080=:59427 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Paul =20 sorry for the delay.. the advertisements are still in the local cache even = when you unshare them. =20 so the best thing to do is to flush the advertisement when you unshare it. =20 so use flushAdvertisement(adv) .. you can find this method in the peer grou= p's discovery service ... =20 good luck =20 Mouhannad (djkofi) =20 ----- Original Message ---- From: [email protected] To: [email protected] Sent: Tuesday, 11 April, 2006 8:14:41 PM Subject: [JXTA discuss] CMS ListContentRequest Hi all, I have recently built a simple peer-to-peer file sharing program using CMS.= I shared some files and searched and downloaded them from another peer. Al= l seemed well until I unshared these files. I noticed that the files were s= till being detected during searches. I checked the =E2=80=9Cshares.ser=E2=80=9D file which did not contain the c= ontent. =20 If the shared content file (shares.ser) did not contain the unshared file, = where was the response coming from? After looking through the source code I noticed that net.jxta.share.client.= ListContentRequest uses the DiscoveryService to find remote content adverti= sements.=20 My understanding was that a LIST_REQ message was sent to all other peers in= the group. The message was processed by the ListMessageProcessor and a LIS= T_RES message was sent back to the requestor. This response searches the = =E2=80=9Cshares.ser=E2=80=9D file and not local cache. The ListContentReque= st would perform this function when the user called ListContentRequest.acti= vateRequest() . The actual code is as follows: public void activateRequest() { disco.getRemoteAdvertisements (null, DiscoveryService.ADV, NAME_ATTRIBUTE, subString, DEFAULT_THRESHOLD, this); } If the CMS uses the DiscoveryService to find remote content advertisements,= does this not circumvent the entire LIST_REQ and LIST_RES protocol?=20 The main problem with this is that other peers within my group will find an= d try to download files which are no longer shared. This would be very anno= ying even if the default life time for content advertisements is only 2 min= utes. =20 The CMS API for ListContentRequest says =E2=80=9CThis class is used to sear= ch a peergroup for content that is being shared using the JXTA CMS. Search = queries are propagated across the peergroup using the Resolver and list res= ponses are received using an EndpointListener.=E2=80=9D I have looked through the source for versions 2.3.5, 2.3.6, 2.3.7 and canno= t find source for this class that uses the EndpointListener. Has anybody wr= itten a version of this class that uses the proper mechanisms? Will a versi= on be available in the future? Regards Paul. ----------------------------------------------------------------- Find the home of your dreams with eircom net property Sign up for email alerts now http://www.eircom.net/propertyalerts --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --0-2045223422-1145273080=:59427 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <html><head><style type=3D"text/css"><!-- DIV {margin:0px} --></style></hea= d><body><div style=3D"font-family:times new roman, new york, times, serif;f= ont-size:12pt"><DIV style=3D"FONT-SIZE: 12pt; FONT-FAMILY: times new roman,= new york, times, serif"> <DIV>Hello Paul</DIV> <DIV> </DIV> <DIV>sorry for the delay.. the advertisements are still in the local cache = even when you unshare them.</DIV> <DIV> </DIV> <DIV>so the best thing to do is to flush the advertisement when you unshare= it.</DIV> <DIV> </DIV> <DIV>so use flushAdvertisement(adv) .. you can find this method in the peer= group's discovery service ...</DIV> <DIV> </DIV> <DIV>good luck</DIV> <DIV> </DIV> <DIV>Mouhannad</DIV> <DIV>(djkofi)</DIV> <DIV><BR> </DIV> <DIV><BR>----- Original Message ----<BR>From: [email protected]<BR>To: = [email protected]<BR>Sent: Tuesday, 11 April, 2006 8:14:41 PM<BR>Subject: [J= XTA discuss] CMS ListContentRequest<BR><BR></DIV> <DIV>Hi all,<BR>I have recently built a simple peer-to-peer file sharing pr= ogram using CMS. I shared some files and searched and downloaded them from = another peer. All seemed well until I unshared these files. I noticed that = the files were still being detected during searches.<BR>I checked the =E2= =80=9Cshares.ser=E2=80=9D file which did not contain the content. &nbs= p; <BR>If the shared content file (shares.ser) did not contain the unshared= file, where was the response coming from?<BR>After looking through the sou= rce code I noticed that net.jxta.share.client.ListContentRequest uses the D= iscoveryService to find remote content advertisements. <BR>My understanding= was that a LIST_REQ message was sent to all other peers in the group. The = message was processed by the ListMessageProcessor and a LIST_RES message wa= s sent back to the requestor. This response searches the =E2=80=9Cshares.se= r=E2=80=9D file and not local cache. The ListContentRequest would perform t= his function when the user called ListContentRequest.activateRequest() . The actual code is as follows:<BR><= BR> public void activateRequest() {<BR> &= nbsp; disco.getRemoteAdvertisements (null,<BR>= &nb= sp; = &nb= sp; DiscoveryService.ADV,<BR> &nbs= p; &= nbsp; &nbs= p; NAME_ATTRIBUTE,<BR>  = ; &n= bsp;  = ; subString,<BR> = &nb= sp; = DEFAULT_THRESHOLD,<BR> &nbs= p; &= nbsp; &nbs= p; this);<BR> &n= bsp;}<BR><BR>If the CMS uses the DiscoveryService to find remote content ad= vertisements, does this not circumvent the entire LIST_REQ and LIST_RES pro= tocol? <BR><BR>The main problem with this is that other peers within my gro= up will find and try to download files which are no longer shared. This wou= ld be very annoying even if the default life time for content advertisement= s is only 2 minutes. <BR><BR>The CMS API for ListContentRequest = says =E2=80=9CThis class is used to search a peergroup for content that is being shared using= the JXTA CMS. Search queries are propagated across the peergroup using the= Resolver and list responses are received using an EndpointListener.=E2=80= =9D<BR><BR>I have looked through the source for versions 2.3.5, 2.3.6, 2.3.= 7 and cannot find source for this class that uses the EndpointListener. Has= anybody written a version of this class that uses the proper mechanisms? W= ill a version be available in the future?<BR><BR>Regards Paul.<BR><BR><BR><= BR>-----------------------------------------------------------------<BR>Fin= d the home of your dreams with eircom net property<BR>Sign up for email ale= rts now <A href=3D"http://www.eircom.net/propertyalerts" target=3D_blank>ht= tp://www.eircom.net/propertyalerts</A><BR><BR><BR>-------------------------= --------------------------------------------<BR>To unsubscribe, e-mail: dis= [email protected]<BR>For additional commands, e-mail: [email protected]</DIV></DIV></div></body></html> --0-2045223422-1145273080=:59427--