|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.novell.ecb.secretstore.SecretInstance
Represents a Secret in the SecretStore.
This is a common object used by all the command beans which operate on a Secret.
Bean user is not expected to instantiate this object directly. GetSecretInstance bean is provided for that purpose.
GetSecretInstance,
Serialized Form| Constructor Summary | |
SecretInstance()
Constructs a SecretInstance object. |
|
| Method Summary | |
boolean |
equals(java.lang.Object obj)
Returns true if this Secret and the Object passed as argument both have the same secretID and belong to the same user. |
boolean |
exists()
Returns true if this Secret exists in the SecretStore. |
java.util.Date |
getAccessTime()
Returns the time when Secret was last accessed from the SecretStore. |
java.util.Date |
getCreateTime()
Returns the creation time of the Secret in the SecretStore. |
java.util.Date |
getModifyTime()
Returns the time when Secret was last modified in the SecretStore. |
SSFlags |
getStatus()
Returns the current status of the SecretStore. |
int |
hashCode()
Returns a hash code value for this object. |
java.lang.String |
toString()
Returns a String representation for this object. |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SecretInstance()
Example: Shows how to use SecretInstance object.
// Get the SecretInstance from GetSecretInstance or EnumerateSecrets bean.
// Mostly, this object is passed from one bean to another for performing
// operations on a Secret. This object implements some methods which are
// useful in getting the information related with a Secret.
SecretInstance si = getSI.getSecretInstance();
try
{
Date createTime = null;
Date accessTime = null;
Date modifyTime = null;
SSFlags status = null;
// Test whether this Secret exists in SecretStore
if (si.exists()) {
createTime = si.getCreateTime();
accessTime = si.getAccessTime();
modifyTime = si.getModifyTime();
status = si.getStatus();
System.out.println("Secret creation time: " + createTime.toString());
System.out.println("Secret last modification time: " + modifyTime.toString());
System.out.println("Secret last acess time: " + accessTime.toString());
if (status.isSet(SSFlags.OUT_ENHANCED_PROTECTED))
System.out.println("Secret is enhanced protected.");
if (status.isSet(SSFlags.OUT_EP_PWORD_PRESENT))
System.out.println("Secret has an enhanced protection password set.");
// Do any further operations
...
...
} else {
// Secret does not exist in SecretStore
// Do any further operations
...
...
}
}
catch(CommandException e)
{
// TODO: Handle exception
}
GetSecretInstance,
EnumerateSecrets| Method Detail |
public java.util.Date getAccessTime()
throws SecretStoreException
SecretStoreException - Thrown if a problems occur in the SecretStore.
public java.util.Date getCreateTime()
throws SecretStoreException
SecretStoreException - Thrown if a problems occur in the SecretStore.
public java.util.Date getModifyTime()
throws SecretStoreException
SecretStoreException - Thrown if a problems occur in the SecretStore.
public SSFlags getStatus()
throws SecretStoreException
SecretStoreException - Thrown if a problems occur in the SecretStore.
public boolean exists()
throws SecretStoreException
SecretStoreException - Thrown if a problems occur in the SecretStore.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
Constructed using the hash code of the combination of the context's name and the secret identifier.
hashCode in class java.lang.Objectpublic java.lang.String toString()
Constructed using the secret identifier.
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||