DigiStamp.com

dgs.tlkt
Class DgsConfig

java.lang.Object
  extended bydgs.tlkt.DgsConfig

public class DgsConfig
extends java.lang.Object

Configues the user's preferences for using the Internet to communicate with DigiStamp time stamp servers. The configuration includes, for example, which servers to use and rules for fail-over to alternative servers.
This configuration data-object can be specified uniquely for each call to the DigiStamp server. Or, you can set a "global" configuration for all calls to the server (see: DgsComm.setGlobalConfig(dgs.tlkt.DgsConfig)).

The configuration data can be read from a file (see: readFile(String)). An example of the file's contents:

acctId = 1612
passwordClear = yourPassword
sslFlag = false
listOfServers.0 = tsatest1
listOfServers.1 = tsatest2
roundRobin = true
retryNum = 3
traceFlag = false

Any particular field value that is not specified will have the default value as described in the field description below.


Field Summary
 java.lang.String acctId
          Account number of the user and is created at DigiStamp support web site.
static java.lang.String defaultConfigFileName
          The default name of the file that holds the configuration data.
 int holdOutMinutes
          If a server did fail how long should we wait before allowing it to be tried again.
 java.lang.String[] listOfServers
          String containing the DigiStamp servers used for TS's for example, "TSATEST1" goes to our test server.
static int listSize
          Maximim size of listOfServersarray.
 byte[] password
          Password of the user.
 long retryNum
          How many times should the time-stamp request be attempted.
 boolean roundRobin
          Use the time-stamp servers in the list in a round-robin fashion.
 boolean sslFlag
          Flag to indicate if SSL communication is to be used.
 int timeOut
          How long to wait before you "timeout" waiting for a response for the DigiStamp server.
 boolean traceFlag
          Should diagnostic trace information be written to sysout.
 
Constructor Summary
DgsConfig()
          Constructor
DgsConfig(DgsConfig orig)
          Copy constructor
 
Method Summary
static DgsConfig readFile(java.lang.String fileName)
          Load the value of the configuration from a file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

acctId

public java.lang.String acctId
Account number of the user and is created at DigiStamp support web site.


defaultConfigFileName

public static final java.lang.String defaultConfigFileName
The default name of the file that holds the configuration data. Used in method readFile(String)when the user provides no other file name.

See Also:
Constant Field Values

holdOutMinutes

public int holdOutMinutes
If a server did fail how long should we wait before allowing it to be tried again. If all servers in the list had failed and are still in the held-out status then the oldest item in the list will be used. The value is specified in minutes. The default is 30 minutes.


listOfServers

public java.lang.String[] listOfServers
String containing the DigiStamp servers used for TS's for example, "TSATEST1" goes to our test server. Maximum size is a list of 16 servers.


listSize

public static final int listSize
Maximim size of listOfServersarray. The value is 16 and cannot be changed.

See Also:
Constant Field Values

password

public byte[] password
Password of the user. The password is communicated in an HMAC style. The toolkit expects the SHA-1 hash of the password.

Your password must be also be know/shared with the DigiStamp server. Your password at DigiStamp is established during account setup or by using the User Support section of our web site.


retryNum

public long retryNum
How many times should the time-stamp request be attempted. This enables the toolkit to try the time stamp request multiple times until a time stamp is retrieved. If a list of multiple servers has been specified in listOfServers then the next server in the list will be accessed for the time-stamp request. A value of 0 is assumed to be the value 1. The default is 3. Maximum is 6.


roundRobin

public boolean roundRobin
Use the time-stamp servers in the list in a round-robin fashion. Default is true. Setting this to true has no affect if there are not multiple server names provided in the listOfServers. This feature would only be valuable to use if you are using the toolkit in a multi-thread environment. In this situation, "round robin" would allow you to execute many requests concurrently using a variety of DigiStamp servers. Each time stamp request would still take the same amount of time to transmit, but you would be engaging many servers. This "high concurrency" option can be used if DigiStamp is aware of your special processing requirements and has approved this high throughput. To enable this feature the configuration must be set using the method DgsComm.setGlobalConfig(dgs.tlkt.DgsConfig).


sslFlag

public boolean sslFlag
Flag to indicate if SSL communication is to be used. The default is false. If you verify the returned time stamp using a trusted root certificate that you retrieve and installed manually on the client machine then the use of SSL does not seem necessary. A successful verfication with a trusted certificate is proof-of-origin from the time stamp server.


timeOut

public int timeOut
How long to wait before you "timeout" waiting for a response for the DigiStamp server. If a "timeout" occurs the the retryNum behaviour is used. Specifying 0 seconds causes Internet communications to time-out based on your operating system configuration. Using this configuration field allows your timeout to occur in a shorter duration that your operating system, but not longer. The minimum setting is 5 seconds. The default is set to 20 seconds.


traceFlag

public boolean traceFlag
Should diagnostic trace information be written to sysout. Default is false. To enable trace then the configuration must be set using the method DgsComm.setGlobalConfig(dgs.tlkt.DgsConfig).

Constructor Detail

DgsConfig

public DgsConfig()
Constructor


DgsConfig

public DgsConfig(DgsConfig orig)
Copy constructor

Method Detail

readFile

public static DgsConfig readFile(java.lang.String fileName)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException
Load the value of the configuration from a file.

If you call this method with the value of null then the processing will attempt to use the file specified by DgsConfig.defaultConfigFileName in the current working directory.

Parameters:
fileName - String - file name. fully qualified or processing assumes current working directory
Returns:
DgsConfig
Throws:
java.io.FileNotFoundException
java.io.IOException

Copyright 2000-2005 DigiStamp, Inc.