|
||||||||||
| 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.SyncSecret
Synchronizes the two Secrets in the SecretStore.
It synchronizes two existing
Secrets and does not create a Secret if any of the Secrets does not exist.
The target Secret will be modified if the timestamp for the
source Secret is more recent; otherwise no change occurs.
If source Secret is enhancedProtected,
enhancedProtection password must be provided.
sourceSecret - A SecretInstance object that represents the source SecretInstance to be used for synchronization.
targetSecret - A target SecretInstance object.
enhancedProtectionPassword - Password for enhanced protected secret. It is needed if the source Secret is enhanced protected
with a password.
isSynced - True if the targetSecret was modified, False if not.
UpdateSecret,
Serialized Form| Constructor Summary | |
SyncSecret()
Constructs a SyncSecret command bean. |
|
SyncSecret(SecretInstance sourceSecret)
Constructs a SyncSecret command bean and sets the source SecretInstance to be synchronized with. |
|
SyncSecret(SecretInstance sourceSecret,
SecretInstance targetSecret)
Constructs a SyncSecret command bean and sets the source SecretInstance and target SecretInstance to be synchronized. |
|
| Method Summary | |
void |
execute()
Executes this command bean for synchronizing the two Secrets. |
SecretInstance |
getTargetSecret()
Returns the target SecretInstance. |
boolean |
isReady()
Tests whether the required input properties are set and the bean is in "initialized" state. |
boolean |
isSynced()
Returns True, if target secret gets modified. |
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 |
setTargetSecret(SecretInstance targetSecret)
Sets the target SecretInstance to be synchronized. |
| 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 SyncSecret()
public SyncSecret(SecretInstance sourceSecret)
sourceSecret - A SecretInstance object that represents the source SecretInstance to be used for synchronization.
public SyncSecret(SecretInstance sourceSecret,
SecretInstance targetSecret)
sourceSecret - A SecretInstance object that represents the source SecretInstance to be used for synchronization.targetSecret - A target SecretInstance object.| Method Detail |
public void setTargetSecret(SecretInstance targetSecret)
targetSecret - A target SecretInstance object.public SecretInstance getTargetSecret()
public void setEnhancedProtectionPassword(java.lang.String epPassword)
setEnhancedProtectionPassword(char[]).
If this password is already set by GetSecretInstance bean, it is not required to set it again as it gets populated inside the SecretInstance object.
epPassword - EnhancedProtectionPassword for the Secret.public void setEnhancedProtectionPassword(char[] epPassword)
If this password is already set by GetSecretInstance bean, it is not required to set it again as it gets populated inside the SecretInstance object.
epPassword - EnhancedProtectionPassword for the Secret.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, isSynced, to its default value i.e. False.
public void execute()
throws CommandException
CommandException - Thrown if the bean fails to execute.
Example: Shows how to use SyncSecret bean.
// Get the SecretInstance from GetSecretInstance or EnumerateSecrets bean.
SecretInstance si = getSI.getSecretInstance();
try
{
// Instantiate the command bean
SyncSecret sync = new SyncSecret(si);
// Set the input properties of the command bean
getSI.setSecretID("myApp2");
getSI.execute();
targetSI = getSI.getSecretInstance();
sync.setTargetSecret(targetSI);
// If source Secret is enhanced protected, enhancedProtection
// password must be set. This can be set in GetSecretInstance also.
sync.setEnhancedProtectionPassword("epPassword".toCharArray());
// Call the execute method of the command bean
sync.execute();
// Query the output properties of the command bean
if (sync.isSynced())
{
// Do something
}
else
{
// Try again or do something else
}
}
catch(CommandException e)
{
// TODO: Handle exception
}
GetSecretInstance,
EnumerateSecretspublic boolean isSynced()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||