|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.novell.ecb.secretstore.SecretStoreBean
|
+--com.novell.ecb.secretstore.EnumerateSecrets
Enumerates the Secrets present in the SecretStore.
Only the Secrets whose SecretIDs match the filter expression are enumerated depending on the buffer size used. By default, empty string is used as filter expression and all Secrets are enumerated.
Secret identifiers are enumerated as an array of Strings and Secrets are enumerated as an array of SecretInstance and SharedSecretInstance objects. SharedSecretInstance objects are created for the SharedSecrets.
ssInstance - A SecretStoreInstance object that represents the SecretStore whose Secrets are to be enumerated.
filter - Filter expressions for filtering the secret identifiers.
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.
createSecrets - Determines whether to create secret objects corresponding to secretIDs. It is a boolean property.
masterPassword - Master Password for the SecretStore.
useMasterPassword - Determines whether to use master password while creating secrets. It is a boolean property.
SecretIDs - The SecretIDs in the SecretStore of the user.
SecretInstances -The SecretInstance and SharedSecretInstance objects; to get this property, createSecrets property must be set to true.
SecretInstance,
SharedSecretInstance,
Serialized Form| Field Summary |
| Fields inherited from class com.novell.ecb.secretstore.SecretStoreBean |
MAX_BUFFER_SIZE |
| Constructor Summary | |
EnumerateSecrets()
Constructs an EnumerateSecrets command bean. |
|
EnumerateSecrets(SecretStoreInstance ssInstance)
Constructs an EnumerateSecrets command bean and sets the SecretStoreInstance to be used by this bean. |
|
EnumerateSecrets(SecretStoreInstance ssInstance,
SSFlags flags,
java.lang.String filter,
int maxLen)
Constructs an EnumerateSecrets command bean and sets the SecretStoreInstance, flags, filter, and maximum buffer size to be used by the bean. |
|
| Method Summary | |
void |
execute()
Executes this command bean for enumerating Secrets and SecretIDs in the SecretStore. |
boolean |
getCreateSecrets()
Returns the createSecrets property value. |
java.lang.String |
getFilter()
Returns the filter set. |
SSFlags |
getFlags()
Returns the flags set. |
int |
getMaxLen()
Returns the maximum buffer size set. |
java.lang.String[] |
getSecretIDs()
Returns a string array of secretIDs. |
SecretInstance[] |
getSecretInstances()
Returns an array of SecretInstance and/or SharedSecretInstance objects. |
boolean |
getUseMasterPassword()
Returns the useMasterPassword property value. |
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 |
setCreateSecrets(boolean createSecrets)
Sets the createSecrets property. |
void |
setFilter(java.lang.String filter)
Sets the filter to be used for selecting the Secrets for enumeration. |
void |
setFlags(SSFlags flags)
Sets the flags to be used while enumerating the Secrets. |
void |
setMasterPassword(char[] password)
Sets the master password of the SecretStore. |
void |
setMasterPassword(java.lang.String password)
Deprecated. Replaced by setMasterPassword(char[]). |
void |
setMaxLen(int length)
Sets the maximum buffer size in bytes to be used while enumerating the Secrets. |
void |
setUseMasterPassword(boolean useMP)
Sets the useMasterPassword property. |
| 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 |
public EnumerateSecrets()
public EnumerateSecrets(SecretStoreInstance ssInstance)
ssInstance - A SecretStoreInstance object that represents the SecretStore whose Secrets are to be enumerated.
public EnumerateSecrets(SecretStoreInstance ssInstance,
SSFlags flags,
java.lang.String filter,
int maxLen)
ssInstance - A SecretStoreInstance object that represents the SecretStore whose Secrets are to be enumerated.flags - Flags for the operation. Currently, no flag is defined for this operation. Property is provided here for future use.filter - Filter expression for filtering the secret identifiers.maxLen - The maximum buffer length in bytes that can be used to retrieve the secret identifiers.| Method Detail |
public void setFlags(SSFlags flags)
flags - Flags for the operation. Currently, no flag is defined for this operation. Property is provided here for future use.public SSFlags getFlags()
public void setFilter(java.lang.String filter)
filter - Filter expression for selecting the Secrets for enumeration.public java.lang.String getFilter()
public void setMaxLen(int length)
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.public int getMaxLen()
public void setCreateSecrets(boolean createSecrets)
By default, this bean enumerates only secretIDs. To enumerate SecretInstance objects, createSecrets must be set to true.
createSecrets - Set to true to enumerate SecretInstance objects; else, only the secretIDs are enumerated.public boolean getCreateSecrets()
public void setMasterPassword(java.lang.String password)
setMasterPassword(char[]).
password - The master password. If password is a non-null and non-empty string,
useMasterPassword property is set to true automatically, when this bean is executed.public void setMasterPassword(char[] password)
password - The master password. If password is a non-null and non-empty string,
useMasterPassword property is set to true automatically, when this bean is executed.public void setUseMasterPassword(boolean useMP)
useMP - The boolean flag to create SecretInstances with a reference to master password.
Setting this property is required only if master password is set by other beans and
SecretInstances are to be created with a reference to master password.public boolean getUseMasterPassword()
public boolean isReady()
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.
public void reset()
Sets the output property, secrets and secretIDs to their default values i.e. Null.
public void execute()
throws CommandException
CommandException - Thrown if the bean fails to execute.
Example: Shows how to use EnumerateSecrets bean.
// Get the SecretStoreInstance created by the CreateSecretStoreInstance bean.
SecretStoreInstance ssi = createSSI.getSecretStoreInstance();
try
{
// Instantiate the command bean
EnumerateSecrets enumerator = new EnumerateSecrets(ssi);
// Set the input properties of the command bean
// enumerate all the Secrets
enumerator.setFilter("*");
// Set the buffer size to list only a few Secrets
// by default max size is used, which is practically
// sufficient to list all the Secrets.
enumerator.setMaxLen(1024);
// Master password for the SecretStore can be set here also,
// if not set earlier.
enumerator.setMasterPassword("masterpassword".toCharArray());
// If master password is already set, setUseMasterPassword()
// would also have the same effect.
// createSecrets can be set to true if further opertions are
// to be performed on all the secrets.
enumerator.setCreateSecrets(true);
// Call the execute method of the command bean
enumerator.execute();
// Query the output properties of the command bean
SecretInstance secrets[] = enumerator.getSecretInstances();
String secretIDs[] = enumerator.getSecretIDs();
// Do any further operations on the Secrets
...
...
}
catch(CommandException e)
{
// TODO: Handle exception
}
CreateSecretStoreInstancepublic java.lang.String[] getSecretIDs()
public SecretInstance[] getSecretInstances()
To get this property, createSecrets property must be set to true before executing the bean.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||