• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client configuration, please help

 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to provide for the client features like change the configuration runtime ? By example : if I have two servers and one client to be able to switch between the servers without closing the GUI. Or I go to far ?

How, you pepople slve this problem ?

Regards,
Mihai
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may not be strictly required, but it's easy to do.
I did it by simply popping up the connection dialog when the client disconnects.
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Jeroen

ThanX, I have the same solution a dialog with two fields (host/port).
The result is persistent also.

Do you have an extra log out feature on your client UI ?

Regards,Mihai
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use the standard logging API to log some things to the console (or logfile if the console is redirected), but no logging data inside the Swing screens.
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,Jeroen


Sorry for the delay but I am pretty catch in the last time.
What I use "log out" I don't mean the logging system (java.util.looging) I maean some log out/disconnect button(feature).


Regards,
Mihai.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah. The disconnect option does that. I've a login/logout built into the database system which in the current implementation do nothing (as there's no user security), those get called by the connect/disconnect methods.
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Jeroen
You mention :


those get called by the connect/disconnect methods.


Do you mean that your client has connect and disconnect features ?
If the answer is yes what you do in the disconnect method ?

If your discurssion goes in this direction (connect/disconnect) I think that we must start a new thread.

Regards,
Mihai
 
B Chen
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mihai,
Does you requirement specify that the client needs to be able to switch to different servers while running, without restarting the client? I had no such requirement, so I simply provided a "Quit" function to terminate the client. Besides, if the user wants to switch servers (which I'd imagine would be rare if ever), they can easily restart the client.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
disconnect calls the disconnect function on the connection which in the current implementation does little.
It clears the dataset, pops up the connection dialog, and that's about it.

I've designed the system so that it can be readily expanded were a future version to require for example user security.
A few changes to the connect and disconnect methods (and the associated backend functions of course) would be able to provide that.
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo people

B Chen, I don't have any change switch to different servers while running, I decide to do this. I use the connect feature(with the settings from my configuration file) once in when I build first the client but if hte connect fails I need a "reconnect" feature. So I can use this "reconnect" even if the connection was successful.

In your scenario you must enter the host & port every time when you start the client ?
What happent if the server configuration changes ?

Or if the connection the configuration UI

Jeroen, thanx for tips.
 
B Chen
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hostname, port, and db filename are stored in the properties file after successful connection or opening of the db file. Next time the GUI starts (client and server), it populates the fields with values from the properties file.
[ June 08, 2006: Message edited by: B Chen ]
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Chen


hostname, port, and db filename are stored in the properties file after successful connection or opening of the db file.


I agree with you but what happen if on the next session the server change its settings ? You must signal the error(so you try to connect) and you must provide a way to change tha actaul(wrong) configuration.

Regards, M
 
B Chen
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the server changes it settings, the client GUI would then show the 'wrong' settings. When the user tries to connect, there will be some error, like "Connection Refused" on socket. Display the error in a dialog. The user then dismisses the dialog and enters the new settings in the client GUI, and tries to connect again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic