Skip to main content

[JXSE 2.7RC1] Saving configuration doesn't work

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
4 replies [Last post]
hades82
Offline
Joined: 2008-11-20

Hi,
I'm trying to make my configuration persistent but it seems something goes wrong. I make NetworkManager configPersistent, and I get the configurator from it. I store something like name, password and principal.
When I run it for first time I get that information correctly (invoking NetworkConfigurator get() methods), so I supose it gets stored. Ok, when I run it again it loads the configurator, and shows the name as I stored it, but both password and principal are null.
Do you know why is this happening? I gess if i forgot something.
Thank you very much.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
buzzheavyyear
Offline
Joined: 2005-06-18

Ask yourself why people use usernames and passwords! If you persist principle and password then anybody/anything can fire up the peer configuration.

hades82
Offline
Joined: 2008-11-20

ok, I see. Thank you for your answer.
Then, these Password and Principal only allows authentication if there is some entity on the network who accept/reject that membership to the group, isn't true? So, I guess if in the default group created when invoking networkManager.startNetwork() authentication is useless, because everybody needs to join it to look for other groups (maybe I'm getting confused)
I was searching some kind of authentication because I'm triying to make a system where multiple users log into the same machine (not at the same time). I don't want anyone can see advertisements or data stored by another user, saving the info of each user in different folders(different than .jxta default folder), and preventing load confidential data only with make a new NetworkManager pointing the user folder I want to hack (hypothetically). I don't know if JXTA has a tool to do this, do you know if this exists?
I don't know if some of the above has sense, or if I'm getting lost. Thank you for your answer again. Bye!!

buzzheavyyear
Offline
Joined: 2005-06-18

Can I suggest you read the tutorials to get a feel about membership services. In your case, each user can log into their own computer account and start up jxta - each user will have their own .jxta folder, and consequently their own usernames/principle names and passwords. Once jxta has started then peer discovery can begin. Peers using the same membership service can either permit or deny remote peers access to local peer services. There is no universal 'login' in jxta peer2peer.

hades82
Offline
Joined: 2008-11-20

Sorry for not answering before but with the migration I had troubles to login and see the forum.
Thank you for your advice buzzheavyyear, it helped me with my application and to understand better the membership service.
Bye!!