finding PeerGroup from PeerGroupAdvertisement

RKS <[email protected]> Sun, 20 Mar 2005 22:18:46 -0800 (PST)
Newsgroups gmane.comp.java.jxta.user,gmane.comp.java.jxta.devel
Message-ID <[email protected]>
Dear friends,

I get the Peergroup advertisement in a Discovery
Listener like this

<code>
PeerGroupAdvertisement pgadv =
(PeerGroupAdvertisement)en.nextElement();
</code>

Now i want my peer to join this group. In the sample
example in Programmers Guide
<code>
private void joinGroup(PeerGroup grp) {
System.out.println("Joining peer group...");
StructuredDocument creds = null;

AuthenticationCredential authCred =
new AuthenticationCredential( grp, null, creds );
</code>

now i need the PeerGroup instance from the
advertisement so that i can apply to join the group. I
searched the API for PeerGroupAdverstisement but could
not find a simple method.

I was wondering what if i save the Peergroup reference
in a HashTable and retrieve it as a service parameter.
will that be a good idea?

Thank You

Regards
RKS




		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/