DigiStamp.com

dgs.tlkt
Class DgsComm

java.lang.Object
  extended bydgs.tlkt.DgsComm

public final class DgsComm
extends java.lang.Object

This class handles all communications with the DigiStamp time stamp servers. This class acts as a local proxy for the remote DigiStamp time stamp servers.

The methods of primary interest is:

Use the setGlobalConfig(DgsConfig) method to configure the communication options.

A setReporter(Reporter)method is provided to display step wise execution status.


Constructor Summary
DgsComm()
          DgsCommTSR constructor.
DgsComm(Reporter aReporter)
           
 
Method Summary
 void diconnectReporter()
          Disconnect further reporting of status messages to the reporter.
static DgsConfig getGlobalConfig()
          The current configuration that will be used for all communications requests.
static java.util.Locale getLocale()
          This only applies if you are using the setReporter(Reporter) feature.
static java.lang.String getVersion()
          The version of the DigiStamp toolkit.
static void setGlobalConfig(DgsConfig config)
          Set the configuration for all communication to the DigiStamp servers.
static void setLocale(java.util.Locale localeP)
          Setting the Locale cause the reporter messages to be translated to this language.
 void setReporter(Reporter aReporter)
          Supplying a Reporter object allows the processing to report communications events.
static DgsComm theInstance()
          This method is used when treating this class as a "singleton" - one instance is used by all clients.
 byte[] timeStamp(byte[] encodeTsr)
          Send a time stamp request to DigiStamp time stamp servers and return an encoded time stamp response.
 CMSTsToken timeStamp(TsRequest tsr)
          Send a time stamp request to DigiStamp time stamp servers and return a Time Stamp.
 CMSTsToken timeStamp(TsRequest tsr, DgsConfig config)
          Send a time stamp request to DigiStamp time stamp servers and return a Time Stamp.
 CMSTsToken timeStamp(TsRequest tsr, java.lang.String acct, byte[] password)
          Send a time stamp request to DigiStamp time stamp servers and return a Time Stamp.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DgsComm

public DgsComm()
DgsCommTSR constructor.


DgsComm

public DgsComm(Reporter aReporter)
Parameters:
aReporter -
Method Detail

diconnectReporter

public void diconnectReporter()
Disconnect further reporting of status messages to the reporter.


getGlobalConfig

public static DgsConfig getGlobalConfig()
The current configuration that will be used for all communications requests. Responds with a copy of the configuration.


getLocale

public static java.util.Locale getLocale()
This only applies if you are using the setReporter(Reporter) feature. This will return the Locale that will be used by the reporter for translation of text strings.

Returns:
java.util.Locale

getVersion

public static java.lang.String getVersion()
The version of the DigiStamp toolkit.

Returns:
java.lang.String

setGlobalConfig

public static void setGlobalConfig(DgsConfig config)
Set the configuration for all communication to the DigiStamp servers.

Parameters:
config - dgs.tlkt.DgsConfig

setLocale

public static void setLocale(java.util.Locale localeP)
Setting the Locale cause the reporter messages to be translated to this language. This only applies if you are using the setReporter(Reporter)feature. The only languages supplied with the toolkit are English and French. We can help you add other languages if you require. The default language is English.


setReporter

public void setReporter(Reporter aReporter)
Supplying a Reporter object allows the processing to report communications events. A textual description of the steps taken in communication. For example: If you use the reporter feature and you are using multithreading then each time stamp request should use different instance of this class.

Parameters:
aReporter - dgs.tlkt.Reporter

theInstance

public static DgsComm theInstance()
This method is used when treating this class as a "singleton" - one instance is used by all clients. Alternatively, clients can use the constructor to create unique instances.

Returns:
dgs.tlkt.DgsCommTSR

timeStamp

public byte[] timeStamp(byte[] encodeTsr)
                 throws ExceptionDgsCommFail,
                        ExceptionDgsInternal,
                        ExceptionDgsAccounting,
                        java.lang.InterruptedException,
                        ExceptionDgsInvalidState,
                        ExceptionDgsEncode,
                        java.io.IOException
Send a time stamp request to DigiStamp time stamp servers and return an encoded time stamp response. This method might be used if you are creating your time stamp requests using methods outside this toolkit.

Parameters:
encodeTsr - encoded time stamp request
Returns:
byte[] encoded time stamp (CMS record)
Throws:
ExceptionDgsCommFail
ExceptionDgsInternal
ExceptionDgsAccounting
java.lang.InterruptedException
ExceptionDgsInvalidState
ExceptionDgsEncode
java.io.IOException
See Also:
timeStamp(TsRequest)

timeStamp

public CMSTsToken timeStamp(TsRequest tsr)
                     throws ExceptionDgsCommFail,
                            ExceptionDgsInternal,
                            ExceptionDgsAccounting,
                            ExceptionDgsEncode,
                            ExceptionDgsInvalidState,
                            java.lang.InterruptedException
Send a time stamp request to DigiStamp time stamp servers and return a Time Stamp.

The Time Stamp is returned as a CMS object. The returned time stamp includes the hash and optional nonce contained in the time stamp request. The time stamp service signs the hash with the current time and returns a signed CMS structure.

Parameters:
tsr - TsRequest, a time stamp request
Returns:
CMSTsToken
Throws:
ExceptionDgsCommFail
ExceptionDgsInternal
ExceptionDgsAccounting
ExceptionDgsEncode
ExceptionDgsInvalidState
java.lang.InterruptedException

timeStamp

public CMSTsToken timeStamp(TsRequest tsr,
                            DgsConfig config)
                     throws ExceptionDgsCommFail,
                            ExceptionDgsInternal,
                            ExceptionDgsAccounting,
                            ExceptionDgsEncode,
                            ExceptionDgsInvalidState,
                            java.lang.InterruptedException
Send a time stamp request to DigiStamp time stamp servers and return a Time Stamp.

This form of the time stamp request method ignores any configuration information that was set with setGlobalConfig(DgsConfig). The configuration you supply in this method call must include an account and password. This method cannot be used with the "round-robin" feature and that configuration flag will be set to false in the supplied configuration.

See timeStamp(TsRequest)method for an extended description of the retrieve time stamp function.

Parameters:
tsr - TsRequest, a time stamp request
config - DgsConfig, communications configuration
Returns:
CMSTsToken
Throws:
ExceptionDgsCommFail
ExceptionDgsInternal
ExceptionDgsAccounting
ExceptionDgsEncode
ExceptionDgsInvalidState
java.lang.InterruptedException

timeStamp

public CMSTsToken timeStamp(TsRequest tsr,
                            java.lang.String acct,
                            byte[] password)
                     throws ExceptionDgsCommFail,
                            ExceptionDgsInternal,
                            ExceptionDgsAccounting,
                            ExceptionDgsEncode,
                            ExceptionDgsInvalidState,
                            java.lang.InterruptedException
Send a time stamp request to DigiStamp time stamp servers and return a Time Stamp.

If the global configuration has been set with setGlobalConfig(DgsConfig)then that global configuration will be used with the account number and password you specify on this call.

See timeStamp(TsRequest)method for an extended description of the retrieve time stamp function.

Parameters:
tsr - TsRequest, a time stamp request
acct - String , your account number
password - byte[], the SHA-1 hash of your DigiStamp password
Returns:
CMSTsToken
Throws:
ExceptionDgsCommFail
ExceptionDgsInternal
ExceptionDgsAccounting
ExceptionDgsEncode
ExceptionDgsInvalidState
java.lang.InterruptedException

Copyright 2000-2005 DigiStamp, Inc.