Skip to main content

deprecate PeerGroupFactory how to solve it

7 replies [Last post]
jxtanewbie
Offline
Joined: 2007-06-14
Points: 0

Hi all,

I am newbie in jxta and I try to do a peer Group with jxta 2.4.1. I put

{

netPeerGroup = PeerGroupFactory.newNetPeerGroup();

}

But it is said that is:

[deprecate] net.jxta.peergroupfactory in net.jxta.peergroup has been deprecated
[deprecate] net.jxta.peergroup() in net.jxta.peergroupfactory has been deprecated

Can a person tell me where the error is and how to solve it?

Thank you very much for your very precious help.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jxtanewbie
Offline
Joined: 2007-06-14
Points: 0

Hi drrsatzteil

Thank you very much for your answer.

jxtanewbie
Offline
Joined: 2007-06-14
Points: 0

Hi leben_leben

thank you very much for your help. I will see the link.

Is it possible to ask you please some other questions for understanding better JXTA.

The questions are:

Now I decide to do my first example in jxta for learn how to do communication between computer (peer-to-peer)

I will try to communicate between two computers (it mean that I have two peers)

The peers are Named: Peer1, Peer2
Each computer (each peer) can send and receive information
Each computer (each peer) has I firewall.

1/ My first question is when I read The JXTA java JSE v2.5 Programmers Guide, it is said in page 24, that I need a relay peer because it said "Relay peers also forward messages on the behalf of peers that are not directly addressable from the perspective of a nother peer (due to Firewall or NAt environnement), bridging different physical and/or logical networks"

My question is: It can be possible to use each computer (Peer1, Peer2) as a relay also, or I need a third computer?

2/ My second question is: It can be each peer (Peer1, Peer2) at the same time be: a Full-featureed edge peer + Rendezvous peer + a relay peer (it depend on the answere of the first question)

3/ My last question concern the step I must to follow for build a good program for realize a peer-to-peer network with this two computers.
Must I begin to build a PeerGroup at first or I must build each peers.

Thank you very very much for your help.

drrsatzteil
Offline
Joined: 2007-03-23
Points: 0

Hello,

1. If both of the peers are behind in a NAT environment you would need to have a third peer that can be reached by the other two that acts as a relay. Peers that can be addressed directly can be relay peers for others in NAT environments. So you definetly need at least one peer that is not in a NAT environment if you want to connect peers from different networks.

2. Yes

Im sorry, but I don't really get your 3rd question.

So long,
Thomas

jxtanewbie
Offline
Joined: 2007-06-14
Points: 0

Hi leben_leben

I have a question, concerning your program. You write

public void createApplicationPeerGroup() {

// key parameters for the new "appPeerGroup"
String name = "";
String desc = "";
String gid = "";
String specID = "";

my question is (because I am newbie):

how you give the value of String gid and String specID. how to determine it?

Thank you very much for your help

leben_leben
Offline
Joined: 2007-06-11
Points: 0

hey again

well.. it's not my program... but a good sample i think..
anyway.. the id's need to meet some demands... so take a look at the jxta protocoll specs at https://jxta-spec.dev.java.net/source/browse/*checkout*/jxta-spec/trunk/...

another good way to learn more about it is to take a look at the jxta tutorials and the programmers guide...depending on the jxta version you use you'd find what you're looking for here: https://jxta-guide.dev.java.net/source/browse/jxta-guide/trunk/src/

the tutorials also include one regarding id-generation.. so that might be interesting ;)

cheers,
.gert

leben_leben
Offline
Joined: 2007-06-11
Points: 0

hey..
just take a look at this: http://www.petrovic.org/content/jxta/privatenet-src.zip

think this will help :)

cheers,
.gert

jxtanewbie
Offline
Joined: 2007-06-14
Points: 0

Thank you very much for your answer.
i will see the link