com.novell.ecb.secretstore
Class GetServiceInfo

java.lang.Object
  |
  +--com.novell.ecb.secretstore.SecretStoreBean
        |
        +--com.novell.ecb.secretstore.GetServiceInfo
All Implemented Interfaces:
Command, java.io.Serializable

public class GetServiceInfo
extends SecretStoreBean

Retrieves SecretStore and service related information like version, crypto strength, number of Secrets, number of locked secrets etc.

Required Input Properties:
ssInstance - A SecretStoreInstance object that represents the SecretStore whose information is to be retrieved.
 
Optional Input Properties:
flags - The flags for the operation. Currently, no flag is defined for this operation. Property is provided here for future use.
 
Output Properties:
clientCryptostrength - The client’s crypto strength.
clientVersion – The version of the SecretStore client being used.
serverCryptoStrength - The server’s crypto strength.
serverVersion – The version of the SecretStore server being used.
numLockedSecrets - The number of locked Secrets.
numSecrets - The total number of Secrets.
lastAdminUnlockDN - The distinguished name (DN) of the last SecretStore administrator who unlocked the SecretStore.
lastAdminUnlockTime - The time when SecretStore was unlocked by admin last time.

Version:
1.0
See Also:
Serialized Form

Field Summary
static byte DOMESTIC_ENGINE
          Constant that specifies the crypto strength as domestic.
static byte EXPORT_ENGINE
          Constant that specifies the crypto strength as export.
static byte UNDETERMINED_ENGINE
          Constant that specifies the crypto strength as undetermined.
 
Fields inherited from class com.novell.ecb.secretstore.SecretStoreBean
MAX_BUFFER_SIZE
 
Constructor Summary
GetServiceInfo()
          Constructs a GetServiceInfo command bean.
GetServiceInfo(SecretStoreInstance ssInstance)
          Constructs a GetServiceInfo command bean and sets the SecretStoreInstance to be used by the bean.
 
Method Summary
 void execute()
          Executes this command bean for getting the general information about the server and the client.
 byte getClientCryptoStrength()
          Returns the crypto strength of the SecretStore client being used.
 int getClientVersion()
          Returns the version of the SecretStore client being used.
 SSFlags getFlags()
          Returns the flags set.
 java.lang.String getLastAdminUnlockDN()
          Returns the DN of the SecretStore administrator who unlocked the SecretStore, last time.
 java.util.Date getLastAdminUnlockTime()
          Returns the timestamp when SecretStore was unlocked last by SecretStore administrator.
 int getNumLockedSecrets()
          Returns the number of Secrets which are in locked state in the SecretStore.
 int getNumSecrets()
          Returns the total number of Secrets present in the SecretStore.
 byte getServerCryptoStrength()
          Returns the crypto strength of the SecretStore server being used.
 int getServerVersion()
          Returns the version of the SecretStore server being used.
 SSFlags getStatus()
          Returns the current status of the SecretStore.
 boolean isReady()
          Tests whether the required input properties are set and the bean is in "initialized" state.
 void reset()
          Resets the output properties to the values they had before the execute method was called.
 void setFlags(SSFlags flags)
          Sets the flags to be used while getting the service information.
 
Methods inherited from class com.novell.ecb.secretstore.SecretStoreBean
getSecretStoreInstance, setSecretStoreInstance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOMESTIC_ENGINE

public static final byte DOMESTIC_ENGINE
Constant that specifies the crypto strength as domestic.

See Also:
Constant Field Values

EXPORT_ENGINE

public static final byte EXPORT_ENGINE
Constant that specifies the crypto strength as export.

See Also:
Constant Field Values

UNDETERMINED_ENGINE

public static final byte UNDETERMINED_ENGINE
Constant that specifies the crypto strength as undetermined.

See Also:
Constant Field Values
Constructor Detail

GetServiceInfo

public GetServiceInfo()
Constructs a GetServiceInfo command bean.


GetServiceInfo

public GetServiceInfo(SecretStoreInstance ssInstance)
Constructs a GetServiceInfo command bean and sets the SecretStoreInstance to be used by the bean.

Parameters:
ssInstance - A SecretStoreInstance object that represents the SecretStore whose information is to be retrieved.
Method Detail

setFlags

public void setFlags(SSFlags flags)
Sets the flags to be used while getting the service information.

Parameters:
flags - Flags for the operation. Currently, no flag is defined for this operation. Property is provided here for future use.

getFlags

public SSFlags getFlags()
Returns the flags set.

Returns:
SSFlags The flags set.

isReady

public boolean isReady()
Tests whether the required input properties are set and the bean is in "initialized" state.

If the user does not set a value for optional input property, default value is used. Therefore, these properties do not affect the readiness of the bean. However, bean will not be in ready state if any of the required input properties is not set.

Returns:
boolean True if the bean is in initialized state; else, returns False.

reset

public void reset()
Resets the output properties to the values they had before the execute method was called.

Sets all the output properties to their default values. All objects are set to null and all primitive data types are set to -1.
Default values are as follows:

serverCryptoStrength, clientCryptoStrength, serverVersion, clientVersion, numSecrets, and numLockedSecrets are set to -1.

status, lastUnlockTime, and lastUnlockingDN are set to null.


execute

public void execute()
             throws CommandException
Executes this command bean for getting the general information about the server and the client.

Throws:
CommandException - Thrown if the bean fails to execute.

Example: Shows how to use GetServiceInfo bean.


     // Get the SecretStoreInstance created by the CreateSecretStoreInstance bean.
   SecretStoreInstance ssi = createSSI.getSecretStoreInstance();
   try
     {
         // Instantiate the command bean
       GetServiceInfo infoBean = new GetServiceInfo(ssi);
         // Set the input properties of the command bean
         // For this bean, the only required input is
         // SecretStoreInstance object.
         // Call the execute method of the command bean
       infoBean.execute();
         // Query the output properties of the command bean
       int serverVersion = infoBean.getServerVersion();
       byte serverCrypto = infoBean.getServerCryptoStrength();
       int numSecrets = infoBean.getNumSecrets();
       ...
       ...
     }
     catch(CommandException e)
      {
         // TODO: Handle exception
      }
 
See Also:
CreateSecretStoreInstance

getClientCryptoStrength

public byte getClientCryptoStrength()
Returns the crypto strength of the SecretStore client being used.

Returns:
byte The client’s crypto strength.

getClientVersion

public int getClientVersion()
Returns the version of the SecretStore client being used.

Returns:
int Version is returned as hex integer. To convert it into a string value, Integer.toHexString(version) can be used.

getServerCryptoStrength

public byte getServerCryptoStrength()
Returns the crypto strength of the SecretStore server being used.

Returns:
byte The server’s crypto strength.

getServerVersion

public int getServerVersion()
Returns the version of the SecretStore server being used.

Returns:
int Version is returned as hex integer. To convert it into a string value, Integer.toHexString(version) can be used.

getStatus

public SSFlags getStatus()
Returns the current status of the SecretStore.

Returns:
SSFlags The current status of the SecretStore.

getLastAdminUnlockDN

public java.lang.String getLastAdminUnlockDN()
Returns the DN of the SecretStore administrator who unlocked the SecretStore, last time.

Returns:
String The DN of the SecretStore administrator. The return value may be empty if the SecretStore has never been unlocked by an administrator.

getLastAdminUnlockTime

public java.util.Date getLastAdminUnlockTime()
Returns the timestamp when SecretStore was unlocked last by SecretStore administrator.

Returns:
Date The return value may be a Date set to "the epoch" if the SecretStore has never been unlocked by an administrator.

getNumSecrets

public int getNumSecrets()
Returns the total number of Secrets present in the SecretStore.

Returns:
int The total number of Secrets.

getNumLockedSecrets

public int getNumLockedSecrets()
Returns the number of Secrets which are in locked state in the SecretStore.

Returns:
int The number of Secrets which are in locked state in the SecretStore.


Copyright © 2001-2003 Novell, Inc. All Rights Reserved.