com.businesslink.sgi.api.hsm
Class HsmClient

java.lang.Object
  |
  +--com.businesslink.sgi.api.hsm.HsmClient

public final class HsmClient
extends java.lang.Object
implements com.businesslink.abl.Closeable

Used to send HSM requests to HSM servers.


Constructor Summary
HsmClient()
          Constructs a new HSM client.
HsmClient(java.io.PrintWriter writer)
          Constructs a new HSM client.
 
Method Summary
 void close()
          Performs necessary HSM client cleanup.
static void enableCache(boolean ena)
          Enables or disables internal HsmClient implementation object caching.
protected  void finalize()
          Automatically calls the close method.
 void processHsmRequest(java.lang.String svr, HsmClientRequest cltrqs)
          Performs a HSM transaction with a HSM server.
 void processHsmRequest(java.lang.String svr, HsmClientRequest cltrqs, int timout)
          Performs a HSM transaction with a HSM server.
 boolean setOption(java.lang.String kwd, java.lang.String val)
          Sets a particular HSM client option.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HsmClient

public HsmClient()
Constructs a new HSM client.

HsmClient

public HsmClient(java.io.PrintWriter writer)
Constructs a new HSM client. If constructed within the context of a HsmServer, the HsmClient object will reflect the client details of that HSM server.
Parameters:
writer - a PrintWriter used for HSM diagnostics.
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Automatically calls the close method.
Overrides:
finalize in class java.lang.Object

setOption

public boolean setOption(java.lang.String kwd,
                         java.lang.String val)
Sets a particular HSM client option.
Parameters:
kwd - keyword identifying the option to set.
val - value to set.
Returns:
true if the option was set successfully, false otherwise.

processHsmRequest

public void processHsmRequest(java.lang.String svr,
                              HsmClientRequest cltrqs)
Performs a HSM transaction with a HSM server. All client request data is sent to the server for processing, and all server reply data is received back from the server. This method blocks until the transaction is complete.
Parameters:
svr - name of the HSM server to process this transaction.
cltrqs - object containing client request data (input) and server reply data (output).

processHsmRequest

public void processHsmRequest(java.lang.String svr,
                              HsmClientRequest cltrqs,
                              int timout)
Performs a HSM transaction with a HSM server. All client request data is sent to the server for processing, and all server reply data is received back from the server. This method blocks until the transaction is complete.
Parameters:
svr - name of the HSM server to process this transaction.
cltrqs - object containing client request data (input) and server reply data (output).
timout - the timeout (in seconds) to wait for the transaction to complete.

close

public void close()
Performs necessary HSM client cleanup. Always call this method after using a HsmClient object.
Specified by:
close in interface com.businesslink.abl.Closeable

enableCache

public static void enableCache(boolean ena)
Enables or disables internal HsmClient implementation object caching. When caching is enabled, internal client implementation objects are cached upon HsmClient.close(), so that when new HsmClients are instantiated, cached client implementation objects are reused (improving HsmClient instantiation speed).
Parameters:
ena - if true, enable object caching; if false, disable object caching.