|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.novell.ecb.secretstore.SecretBean
|
+--com.novell.ecb.secretstore.CreateSecret
Provides the functionality for creating a Secret.
This bean can also be used for modifying the value and the enhancedProtectionPassword for an existing Secret in the Secret Store. This bean overwrites the existing secret value. To avoid overwriting existing secret value, set the flag SSFlag.IN_CHECK_ID_COLLISION.
SecretInstance - A SecretInstance object that represents the Secret to be created or modified.
value - The value for the secret. No value is set by default.
sharedValue - A SharedValue object representing a SharedSecret's value.
Default value is null. enhancedProtectionPassword - Password for creating an enhanced protected secret.
flags - The flags for the operation. By default, no flag is set. The flag,
SSFlags.IN_CHECK_ID_COLLISION is defined to enable name collision checking while creating a Secret and set its value.
None
SharedValue,
Serialized Form| Constructor Summary | |
CreateSecret()
Constructs a CreateSecret command bean. |
|
CreateSecret(SecretInstance secretInstance)
Constructs a CreateSecret command bean and sets the SecretInstance to be used. |
|
| Method Summary | |
void |
execute()
Executes this command bean for creating Secret. |
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 |
setEnhancedProtectionPassword(char[] epPassword)
Sets the enhanced protection password property. |
void |
setEnhancedProtectionPassword(java.lang.String epPassword)
Deprecated. Replaced by setEnhancedProtectionPassword(char[]). |
void |
setFlags(SSFlags flags)
Sets the flags to be used while setting the value of Secret. |
void |
setSecretValue(byte[] value)
Sets the value of the Secret. |
void |
setSharedValue(SharedValue value)
Sets the value of the SharedSecret. |
| Methods inherited from class com.novell.ecb.secretstore.SecretBean |
getSecretInstance, setSecretInstance |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CreateSecret()
public CreateSecret(SecretInstance secretInstance)
secretInstance - A SecretInstance object that represents the Secret to be created or modified.| Method Detail |
public void setFlags(SSFlags flags)
No flag is set by default. Currently, only IN_CHECK_ID_COLLISION flag is defined for this operation. If this flag is set, secret is created with name collision checking.
flags - Flags for the operation.SSFlags.IN_CHECK_ID_COLLISIONpublic SSFlags getFlags()
public void setEnhancedProtectionPassword(java.lang.String epPassword)
setEnhancedProtectionPassword(char[]).
Once this password is set, it is not required to set it again as it gets populated inside the SecretInstance object.
epPassword - Enhanced protection password for the Secret.public void setEnhancedProtectionPassword(char[] epPassword)
Once this password is set, it is not required to set it again as it gets populated inside the SecretInstance object.
epPassword - Enhanced protection password for the Secret.public void setSecretValue(byte[] value)
value - Byte array containing the value of the Secret.SharedValuepublic void setSharedValue(SharedValue value)
value - SharedValue object representing the value of the SharedSecret.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()
There is no output property to reset.
public void execute()
throws CommandException
CommandException - Thrown if the bean fails to execute.
Example 1: Shows how to use CreateSecret bean for creating an ordinary Secret.
// Get the SecretInstance from GetSecretInstance bean
SecretInstance si = getSI.getSecretInstance();
try
{
// Instantiate the command bean
CreateSecret createSecret = new CreateSecret(si);
// Set the input properties of the command bean
// Set the value of the Secret
createSecret.setSecretValue("someValue".getBytes());
// EnhancedProtection password can be set in this bean
// or in GetSecretInstance bean itself.
// Call the execute method of the command bean
createSecret.execute();
// There is no output property to query
}
catch(CommandException e)
{
// TODO: Handle exception
}
Example 2: Shows how to use CreateSecret bean for creating a SharedSecret.
// Get the SecretInstance from GetSecretInstance bean.
// Depending on the secretID, GetSecretInstance bean creates
// the instance of SecretInstance or SharedSecretInstance.
SecretInstance si = getSI.getSecretInstance();
try
{
// Instantiate the command bean
CreateSecret createSecret = new CreateSecret(si);
SharedValue val = new SharedSecret();
val.addValue("username","bob");
val.addValue("password","password");
// Set the input properties of the command bean
// Set the value of the SharedSecret
createSecret.setSharedValue(val);
// EnhancedProtection password can be set in this bean
// or in GetSecretInstance bean itself.
// Call the execute method of the command bean
createSecret.execute();
// There is no output property to query
}
catch(CommandException e)
{
// TODO: Handle exception
}
GetSecretInstance
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||