|
||||||||||
| 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.SyncSecretStore
Synchronizes Secrets of two SecretStores.
If the sourceStore has a secret that the targetStore does not have, then the targetStore is updated with that secret. If the sourceStore has a secret that the targetStore has, then the last modified timestamp for both secrets is examined. If the Secret in the source SecretStore has a timestamp that is more recent than the timestamp for the Secret in the target SecretStore, then the Secret in the target SecretStore is updated with the Secret in the source SecretStore. In the case that the timestamp for a Secret in the source SecretStore is either less recent or equal to the timestamp for a corresponding Secret in the target SecretStore, no update will occur to that Secret.
Note:Only those secrets that are not locked and that do not have an enhanced protection password associated with them are synchronized. You will have to manually synchronize secrets that are protected with an enhanced protection password or that are locked.
sourceSecIns - A SecretStoreInstance object that represents the SecretStore of the source object.
targetSecIns - A target SecretStoreInstance object.
filter - Filter expression for filtering the secret identifiers that are returned; default value is empty string.
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.
NumSecretsSynced - Number of secrets synchronized.
UpdateSecretStore,
Serialized Form| Field Summary |
| Fields inherited from class com.novell.ecb.secretstore.SecretStoreBean |
MAX_BUFFER_SIZE |
| Constructor Summary | |
SyncSecretStore()
Constructs a SyncSecretStore Command bean. |
|
SyncSecretStore(SecretStoreInstance sourceSecIns)
Constructs a SyncSecretStore Command bean and sets the source SecretStoreInstance that is to be synchronized. |
|
SyncSecretStore(SecretStoreInstance sourceSecIns,
SecretStoreInstance targetSecIns)
Constructs a SyncSecretStore Command bean and sets the source and target SecretStoreInstance objects to be synchronized. |
|
| Method Summary | |
void |
execute()
Executes this command bean for synchronizing the two SecretStores. |
java.lang.String |
getFilter()
Returns the filter expression. |
SSFlags |
getFlags()
Returns the flags set. |
int |
getMaxLen()
Returns the maximum buffer size set. |
int |
getNumSecretsSynced()
Returns the number of Secrets synchronized. |
SecretStoreInstance |
getTargetSecretStore()
Returns the target SecretStore for the sync operation. |
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 synchronization. |
void |
setFlags(SSFlags flags)
Sets the flags to be used while synchronizing the Secrets. |
void |
setMaxLen(int length)
Sets the maximum buffer size in bytes to be used while performing the sync operation. |
void |
setTargetSecretStore(SecretStoreInstance targetSecIns)
Sets the target SecretStore for the sync operation. |
| 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 SyncSecretStore()
public SyncSecretStore(SecretStoreInstance sourceSecIns)
sourceSecIns - A SecretStoreInstance object that represents the SecretStore of the source object.
public SyncSecretStore(SecretStoreInstance sourceSecIns,
SecretStoreInstance targetSecIns)
sourceSecIns - A SecretStoreInstance object that represents the SecretStore of the source object.targetSecIns - A target SecretStoreInstance object.| Method Detail |
public void setTargetSecretStore(SecretStoreInstance targetSecIns)
targetSecIns - A target SecretStoreInstance object.public SecretStoreInstance getTargetSecretStore()
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 for selecting the Secrets for synchronization.public java.lang.String getFilter()
public void setMaxLen(int length)
length - The maximum buffer size in bytes. 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 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, NumSecretsSynced, to its default value i.e. -1.
public void execute()
throws CommandException
CommandException - Thrown if the bean fails to execute.
Example: Shows how to use SyncSecretStore bean.
// Get the SecretStoreInstance created by the CreateSecretStoreInstance bean.
SecretStoreInstance ssi = createSSI.getSecretStoreInstance();
try
{
// Instantiate the command bean
SyncSecretStore syncSS = new SyncSecretStore(ssi);
// Set the input properties of the command bean
// Create the target SecretStoreInstance and set the target
syncSS.setTargetSecretStore(targetSSI);
// Set filter to sync selected Secrets
syncSS.setFilter("a*");
// To limit the number of Secrets being synced buffer size can be set
syncSS.setMaxLen(1024);
// Call the execute method of the command bean
syncSS.execute();
// Query the output properties of the command bean
int numSynced = syncSS.getNumSecretsSynced();
// Do any further operations
...
...
}
catch(CommandException e)
{
// TODO: Handle exception
}
CreateSecretStoreInstancepublic int getNumSecretsSynced()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||