com.novell.ecb.secretstore
Class UpdateSecretStore

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

public class UpdateSecretStore
extends SecretStoreBean

Updates the target SecretStore with the source SecretStore.

Note:Only those secrets that are not locked and that do not have an enhanced protection password associated with them are updated. User will have to use UpdateSecret bean for updating the Secrets that are protected with an enhanced protection password or that are locked.

Required Input Properties:
sourceSecIns - A SecretStoreInstance object that represents the SecretStore of the source object.
targetSecIns - A target SecretStoreInstance object.
 
Optional Input Properties:
filter - Filters expression for selecting the Secrets for updation.
flags - The flags for the operation. Currently, no flag is defined for this operation. Property is provided here for future use.
maxLen - The maximum buffer length in bytes that can be used to retrieve the secret identifiers.
Output Property:
None

Version:
1.0
See Also:
SyncSecretStore, Serialized Form

Field Summary
 
Fields inherited from class com.novell.ecb.secretstore.SecretStoreBean
MAX_BUFFER_SIZE
 
Constructor Summary
UpdateSecretStore()
          Constructs an UpdateSecretStore Command bean.
UpdateSecretStore(SecretStoreInstance sourceSecIns)
          Constructs an UpdateSecretStore Command bean and sets the source SecretStoreInstance.
UpdateSecretStore(SecretStoreInstance sourceSecIns, SecretStoreInstance targetSecIns)
          Constructs an UpdateSecretStore Command bean and sets the source and target SecretStoreInstance.
 
Method Summary
 void execute()
          Executes this command bean for updating the target SecretStore.
 java.lang.String getFilter()
          Returns the filter expression.
 SSFlags getFlags()
          Returns the flags set.
 int getMaxLen()
          Returns the maximum buffer size set.
 SecretStoreInstance getTargetSecretStore()
          Returns the target 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 setFilter(java.lang.String filter)
          Sets the filter to be used for selecting the Secrets for updation.
 void setFlags(SSFlags flags)
          Sets the flags to be used while updating the SecretStore.
 void setMaxLen(int length)
          Sets the maximum buffer size in bytes to be used while performing the update operation.
 void setTargetSecretStore(SecretStoreInstance targetSecIns)
          Sets the target SecretStore to be updated.
 
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

UpdateSecretStore

public UpdateSecretStore()
Constructs an UpdateSecretStore Command bean.


UpdateSecretStore

public UpdateSecretStore(SecretStoreInstance sourceSecIns)
Constructs an UpdateSecretStore Command bean and sets the source SecretStoreInstance.

Parameters:
sourceSecIns - A SecretStoreInstance object that represents the SecretStore of the source object.

UpdateSecretStore

public UpdateSecretStore(SecretStoreInstance sourceSecIns,
                         SecretStoreInstance targetSecIns)
Constructs an UpdateSecretStore Command bean and sets the source and target SecretStoreInstance.

Parameters:
sourceSecIns - A SecretStoreInstance object that represents the SecretStore of the source object.
targetSecIns - A target SecretStoreInstance object.
Method Detail

setTargetSecretStore

public void setTargetSecretStore(SecretStoreInstance targetSecIns)
Sets the target SecretStore to be updated.

Parameters:
targetSecIns - A target SecretStoreInstance object.

getTargetSecretStore

public SecretStoreInstance getTargetSecretStore()
Returns the target SecretStore.

Returns:
SecretStoreInstance The target SecretStoreInstance object.

setFlags

public void setFlags(SSFlags flags)
Sets the flags to be used while updating the SecretStore.

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

getFlags

public SSFlags getFlags()
Returns the flags set.

Returns:
SSFlags The flags set.

setFilter

public void setFilter(java.lang.String filter)
Sets the filter to be used for selecting the Secrets for updation. All the Secrets containing the filter string in their identifiers are updated. Empty or null string can be used for selecting all the Secrets.

Parameters:
filter - Filter expression for selecting the Secrets.

getFilter

public java.lang.String getFilter()
Returns the filter expression.

Returns:
String The filter expression.

setMaxLen

public void setMaxLen(int length)
Sets the maximum buffer size in bytes to be used while performing the update operation.

Parameters:
length - The maximum buffer size. The default buffer size is SecretStoreBean.MAX_BUFFER_SIZE. If a negative length is passed to this method, default value is set.

getMaxLen

public int getMaxLen()
Returns the maximum buffer size set.

Returns:
int The maximum buffer size in bytes.

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 updating the target SecretStore.

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

Example: Shows how to use UpdateSecretStore bean.


     // Get the SecretStoreInstance created by the CreateSecretStoreInstance bean.
   SecretStoreInstance ssi = createSSI.getSecretStoreInstance();
   try
     {
         // Instantiate the command bean
       UpdateSecretStore updateSS = new UpdateSecretStore(ssi);
         // Set the input properties of the command bean
         // Create the target SecretStoreInstance and set the target
       updateSS.setTargetSecretStore(targetSSI);
         // Set filter to update selected Secrets
       updateSS.setFilter("a*");
         // To limit the number of Secrets being updated buffer size can be set
       updateSS.setMaxLen(1024);
         // Call the execute method of the command bean
       updateSS.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.