com.novell.ecb.secretstore
Class ModifyMasterPassword

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

public class ModifyMasterPassword
extends SecretStoreBean

Provides functionality for setting and changing the master password for the SecretStore.

Master password is used for unlocking the SecretStore and also for reading a Secret that is enhanced protected.

Required Input Properties:
ssInstance - A SecretStoreInstance object that represents the SecretStore of the user.
password - The new master password for the SecretStore.
 
Optional Input Properties:
flags - The flags for the operation. Currently, no flag is defined for this operation. Property is provided here for future use.
passwordHint - The hint associated with the master password.
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
ModifyMasterPassword()
          Constructs a ModifyMasterPassword command bean.
ModifyMasterPassword(SecretStoreInstance ssInstance, char[] password)
          Constructs a ModifyMasterPassword command bean and sets the SecretStoreInstance to be used and the master password value.
ModifyMasterPassword(SecretStoreInstance ssInstance, java.lang.String password)
          Deprecated. Replaced by ModifyMasterPassword(SecretStoreInstance, char[]).
 
Method Summary
 void execute()
          Executes this command bean for setting or modifying a master password for the SecretStore.
 SSFlags getFlags()
          Returns the flags set.
 java.lang.String getPasswordHint()
          Returns the hint set for the master password.
 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 modifying the master password.
 void setNewPassword(char[] password)
          Sets the new master password value for the SecretStore.
 void setNewPassword(java.lang.String password)
          Deprecated. Replaced by setNewPassword(char[]).
 void setPasswordHint(java.lang.String hint)
          Sets hint for the master password.
 
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

ModifyMasterPassword

public ModifyMasterPassword()
Constructs a ModifyMasterPassword command bean.


ModifyMasterPassword

public ModifyMasterPassword(SecretStoreInstance ssInstance,
                            java.lang.String password)
Deprecated. Replaced by ModifyMasterPassword(SecretStoreInstance, char[]).

Constructs a ModifyMasterPassword command bean and sets the SecretStoreInstance to be used and the master password value.

Parameters:
ssInstance - A SecretStoreInstance object that represents the SecretStore of the user.
password - The new master password for the SecretStore.

ModifyMasterPassword

public ModifyMasterPassword(SecretStoreInstance ssInstance,
                            char[] password)
Constructs a ModifyMasterPassword command bean and sets the SecretStoreInstance to be used and the master password value.

Parameters:
ssInstance - A SecretStoreInstance object that represents the SecretStore of the user.
password - The new master password for the SecretStore.
Method Detail

setNewPassword

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

Sets the new master password value for the SecretStore.

Bean will not be ready if password is set to null or empty String.

Parameters:
password - The new master password for the SecretStore.

setNewPassword

public void setNewPassword(char[] password)
Sets the new master password value for the SecretStore.

Bean will not be ready if password is set to null or empty String.

Parameters:
password - The new master password for the SecretStore.

setPasswordHint

public void setPasswordHint(java.lang.String hint)
Sets hint for the master password.

Parameters:
hint - The hint for the master password.

getPasswordHint

public java.lang.String getPasswordHint()
Returns the hint set for the master password.

If no value is set for hint, value is returned from the SecretStore provided SecretStoreInstance has been set for this bean.

Returns:
String The hint set for the master password.

setFlags

public void setFlags(SSFlags flags)
Sets the flags to be used while modifying the master password.

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.

There is no output property to reset.


execute

public void execute()
             throws CommandException
Executes this command bean for setting or modifying a master password for the SecretStore.

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

Example: Shows how to use ModifyMasterPassword bean.


     // Get the SecretStoreInstance created by the CreateSecretStoreInstance bean.
   SecretStoreInstance ssi = createSSI.getSecretStoreInstance();
   try
     {
         // Instantiate the command bean
       ModifyMasterPassword modifyMP = new ModifyMasterPassword(ssi);
         // Sets the new password, overwriting the old one, if exists
         // Set the input properties of the command bean
       modifyMP.setNewPassword("masterPassword".toCharArray());
       modifyMP.setPasswordHint("hint for the password");
         // Call the execute method of the command bean
       modifyMP.execute();
         // This bean has no output property         
     }
     catch(CommandException e)
      {
         // TODO: Handle exception
      }
 
See Also:
CreateSecretStoreInstance


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