• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

persistent suncertify.properties

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to understand this requirement. Given the arrangement of the jar submission, it can behave in 3 modes and each should have a different setting associated with. however, if this jar executed in same location 3 times for different mode. Should I preserve the previous 2 settings so that any other run of a mode will conform to the setting it contains? The property.store will clear previous settings in the file.

No other thread in the forum has brought this question. So I assume that I may misunderstand something. Any comments?

Thanks
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My understanding is that as long as the client/server program(s) are run from the same directory, we preserve the previous settings. (SunCertify.properties to be saved/retrieved from the current directory)
 
Andy Zhu
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply. But I may not state clear about my concern. Say, the jar file is in ./

first, we run java -jar ./runme.jar server
This time, the properties will store, say, db location=./db.db and port=1099.

Next we run java -jar ./runme.jar alone
This time, the properties will store file location=../db.db. However, at this moment should I preserve the db location and port properties so that the next time the program running as server it will have the properties as the last time it ran as a server?

I may misunderstand you. Would you say I should preserve the server properties in this case?
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Andy,
Yes. That is the whole point of suncertify.properties file. Isn't it?
We store the information that was last used/entered by the user to run the application. Instead of maintaining 3 different suncertify.properties file, We share only 1 file for the 3 modes.We can have different properties for server, client and the application in local mode but we persist them all to the same file.

For example:
SERVERMODE_DB_LOCATION=
SERVERMODE_PORT=

CLIENTMODE_SERVER_IP=
CLIENTMODE_SERVER_PORT=

LOCALMODE_DB_LOCATION=
etc.....

Everytime you load all the properties from the file and store them back with the modified new ones.
 
Andy Zhu
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Vishwa:

Thanks for your comments. Now I am crystal clear about this requirement. I think the solution is quite easy. Well this is part of our reality about this assignment: guessing the real meaning of the specification, which really turns out many interpretations and which in turn confuse a developer in many of these interpretations. I feel really lucky I came to this forum at the begining when I started my assignment.

Thanks for all your helps.
 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a question related to this issue. Should we create the proporty file in binary format, or test format.
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hanna,

there are no restrictions on property file in instructions. I think its better to use Properties API.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic