com.novell.ecb.secretstore
Class UnlockSecretStore

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

public class UnlockSecretStore
extends SecretStoreBean

Unlocks a locked SecretStore.

If SecretStore contains enhanced protected Secrets, it gets locked whenever eDirectory user's password is changed. in order to unlock a SecretStore, user needs to provide his/her old password for eDirectory or master password for SecretStore. If both are provided, old eDirectory password is used.

Required Input Properties:
ssInstance - A SecretStoreInstance object that represents the SecretStore of the target object.
eDirPassword - User's old password for eDirectory.
masterPassword - Master password set for the SecretStore.
 
Optional Input Properties:
flags - The flags for the operation. By default, no flag is set. Currently, only REMOVE_LOCK_FROM_STORE flag is defined for this operation. If this flag is set, none of the passwords is required for execution of this bean. Setting this flag will result in deleting all the locked secrets from the SecretStore. The locked secrets that are deleted cannot be recovered.
Output Property:
None

Version:
1.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.novell.ecb.secretstore.SecretStoreBean
MAX_BUFFER_SIZE
 
Constructor Summary
UnlockSecretStore()
          Constructs an UnlockSecretStore command bean.
UnlockSecretStore(SecretStoreInstance ssInstance)
          Constructs an UnlockSecretStore command bean and sets the SecretStoreInstance to be used.
 
Method Summary
 void execute()
          Executes this command bean for unlocking a SecretStore.
 SSFlags getFlags()
          Returns the flags set.
 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 seteDirPassword(char[] password)
          Sets the old eDirectory password for unlocking the locked SecretStore.
 void seteDirPassword(java.lang.String password)
          Deprecated. Replaced by seteDirPassword(char[]).
 void setFlags(SSFlags flags)
          Sets the flags to be used while performing the unlock operation.
 void setMasterPassword(char[] password)
          Sets the master password of the SecretStore.
 void setMasterPassword(java.lang.String password)
          Deprecated. Replaced by setMasterPassword(char[]).
 
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
 

Constructor Detail

UnlockSecretStore

public UnlockSecretStore()
Constructs an UnlockSecretStore command bean.


UnlockSecretStore

public UnlockSecretStore(SecretStoreInstance ssInstance)
Constructs an UnlockSecretStore command bean and sets the SecretStoreInstance to be used.

Parameters:
ssInstance - A SecretStoreInstance object that represents the SecretStore of the target object.
Method Detail

setFlags

public void setFlags(SSFlags flags)
Sets the flags to be used while performing the unlock operation.

No flag is set by default. Currently, only IN_REMOVE_LOCK_FROM_STORE flag is defined for this operation. If this flag is set, none of the passwords is required for execution of this bean.

Parameters:
flags - Flags for the operation.
See Also:
SSFlags.IN_REMOVE_LOCK_FROM_STORE

getFlags

public SSFlags getFlags()
Returns the flags set.

Returns:
SSFlags The flags set.

setMasterPassword

public void setMasterPassword(java.lang.String password)
Deprecated. Replaced by setMasterPassword(char[]).

Sets the master password of the SecretStore. Setting this property is not required, if master password is already set by CreateSecretStoreInstance or EnumerateSecrets or GetSecretInstance or ModifyMasterPassword bean.

Parameters:
password - The master password.

setMasterPassword

public void setMasterPassword(char[] password)
Sets the master password of the SecretStore. Setting this property is not required, if master password is already set by CreateSecretStoreInstance or EnumerateSecrets or GetSecretInstance or ModifyMasterPassword bean.

Parameters:
password - The master password.

seteDirPassword

public void seteDirPassword(java.lang.String password)
Deprecated. Replaced by seteDirPassword(char[]).

Sets the old eDirectory password for unlocking the locked SecretStore.

Parameters:
password - The eDirectory password. If master password is not set, old eDirectory password must be set. Otherwise, bean will not be in ready state. If both are set, old eDirPassword is used.

seteDirPassword

public void seteDirPassword(char[] password)
Sets the old eDirectory password for unlocking the locked SecretStore.

Parameters:
password - The eDirectory password. If master password is not set, old eDirectory password must be set. Otherwise, bean will not be in ready state. If both are set, old eDirPassword is used.

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.

There is no output property to reset.


execute

public void execute()
             throws CommandException
Executes this command bean for unlocking a SecretStore.

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

Example: Shows how to use UnlockSecretStore bean.


     // Get the SecretStoreInstance created by the CreateSecretStoreInstance bean.
   SecretStoreInstance ssi = createSSI.getSecretStoreInstance();
   try
     {
         // Instantiate the command bean
       UnlockSecretStore unlock = new UnlockSecretStore(ssi);
         // Set the input properties of the command bean
       unlock.setMasterPassword("masterPassword".toCharArray());
         // unlock.seteDirPassword("oldPassword".toCharArray());
         // For unlocking a SecretStore either master passsword or user's old 
         // password for eDirectory must be provided.
         // None of these passwords is required if SSFlags.IN_REMOVE_LOCK_FROM_STORE
         // flag is set.
         // SSFlags ssf = new SSFlags(0);
         // ssf.setFlag(SSFlags.IN_REMOVE_LOCK_FROM_STORE);
         // unlock.setFlags(ssf);

         // Call the execute method of the command bean
       unlock.execute();
         // There is no output property of this bean
         // Do any further operations
       ...
       ...
      }
     catch(CommandException e)
      {
         // TODO: Handle exception
      }
 
See Also:
CreateSecretStoreInstance


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