|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.novell.ecb.secretstore.CreateSecretStoreInstance
Provides functionality for creating a new SecretStoreInstance object.
This is the first and necessary step to perform any SecretStore
operation. By default, the user logging in is the owner of the SecretStore. The Admin can access other user's
SecretStore. In such a case, the owner will be the user whose SecretStore is being accessed and LoginDN
will be that of admin.
Note: Admin cannot read other users' Secrets.
connection - Connection object obtained from the AuthenticateLdap bean.
loginDN - The login distinguished name for authentication.
password - Password of the user.
url - URL of the LDAP server running the SecretStore service. The URL must have secure port also.
For example, ldap://ldap.acme.com:636/
UserDN - The distinguished name of the user whose SecretStore is to be accessed.
MasterPassword - The master password for the SecretStore.
SecretStoreInstance - An object that represents the SecretStore of the target object.
| Constructor Summary | |
CreateSecretStoreInstance()
Constructs a CreateSecretStoreInstance bean. |
|
CreateSecretStoreInstance(com.novell.ecb.ldap.LdapConnection connection)
Constructs a CreateSecretStoreInstance bean and sets the connection to be used by the bean. |
|
CreateSecretStoreInstance(java.lang.String url,
java.lang.String loginDN,
char[] password)
Constructs a CreateSecretStoreInstance bean and sets the URL, loginDN, and password to be used by the bean. |
|
CreateSecretStoreInstance(java.lang.String url,
java.lang.String loginDN,
java.lang.String password)
Deprecated. Replaced by CreateSecretStoreInstance(String, String, char[]). |
|
| Method Summary | |
void |
execute()
Creates a SecretStoreInstance object, which is used for doing further operations on the SecretStore. |
Connection |
getConnection()
Returns the connection. |
java.lang.String |
getLoginDN()
Returns the distinguished name of the user for authentication. |
SecretStoreInstance |
getSecretStoreInstance()
Returns the SecretStoreInstance created by the bean. |
java.lang.String |
getURL()
Returns the URL. |
java.lang.String |
getUserDN()
Returns the user DN. |
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 |
setConnection(Connection connection)
Sets the connection to be used by the bean. |
void |
setLoginDN(java.lang.String DN)
Sets the distinguished name of the user for authentication. |
void |
setMasterPassword(char[] password)
Sets the master password. |
void |
setMasterPassword(java.lang.String password)
Deprecated. Replaced by setMasterPassword(char[]). |
void |
setPassword(char[] password)
Sets the password to be used for authentication. |
void |
setPassword(java.lang.String password)
Deprecated. Replaced by setPassword(char[]). |
void |
setURL(java.lang.String url)
Sets the URL of the LDAP server to be contacted. |
void |
setUserDN(java.lang.String DN)
Sets the user DN whose SecretStore is to be accessed. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CreateSecretStoreInstance()
public CreateSecretStoreInstance(com.novell.ecb.ldap.LdapConnection connection)
connection - The connection object.
public CreateSecretStoreInstance(java.lang.String url,
java.lang.String loginDN,
java.lang.String password)
CreateSecretStoreInstance(String, String, char[]).
url - URL of the LDAP server running the SecretStore service. The URL must have secure port also.
For example, ldap://ldap.acme.com:636/loginDN - The distinguished name of the user for authentication.password - Password of the user.
public CreateSecretStoreInstance(java.lang.String url,
java.lang.String loginDN,
char[] password)
url - URL of the LDAP server running the SecretStore service. The URL must have secure port also.
For example, ldap://ldap.acme.com:636/loginDN - The distinguished name of the user for authentication.password - Password of the user.| Method Detail |
public void setConnection(Connection connection)
connection - The Connection object.public Connection getConnection()
public void setUserDN(java.lang.String DN)
Setting this value as loginDN does not make any difference. By default, the person logging in is assumed to be the user.
DN - The distinguished name of the user whose SecretStore is to be accessed.public java.lang.String getUserDN()
public void setLoginDN(java.lang.String DN)
DN - The distinguished name of the user for authentication.public java.lang.String getLoginDN()
public void setPassword(java.lang.String password)
setPassword(char[]).
password - Password of the user.public void setPassword(char[] password)
password - Password of the user.public void setMasterPassword(java.lang.String password)
setMasterPassword(char[]).
password - Master password of the SecretStore.public void setMasterPassword(char[] password)
password - Master password of the SecretStore.public void setURL(java.lang.String url)
url - URL of the LDAP server running the SecretStore service. The URL must have secure port also.
For example, ldap://ldap.acme.com:636/public java.lang.String getURL()
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, SecretStoreInstance, to its default value i.e. Null.
public void execute()
throws CommandException
CommandException - Thrown if the bean fails to execute.
Example: Shows how to use CreateSecretStoreInstance bean.
SecretStoreInstance ssi = null;
CreateSecretStoreInstance createSSI = null;
try
{
// Instantiate the command bean
createSSI = new CreateSecretStoreInstance();
// Set the input properties of the command bean
// Secure port must be provided in URL, since all
// SecretStore operations are performed over SSL
createSSI.setURL("ldap://sso.acme.com:636/");
createSSI.setLoginDN("cn=alice,o=acme");
createSSI.setPassword("password".toCharArray());
// If connection has been already established with the
// server using Ldap Command beans, it can be re-used
// provided it was over SSL. Setting URL, loginDN and
// password is not required in that case.
// createSSI.setConnection(conn);
// UserDN can be set to access a particular user's SecretStore
// createSSI.setUserDN("cn=bob,o=acme");
// Master password for the SecretStore can be set here, to avoid
// setting it in other beans.
createSSI.setMasterPassword("masterpassword".toCharArray());
// Call the execute method of the command bean
createSSI.execute();
// Query the output properties of the command bean
ssi = createSSI.getSecretStoreInstance();
// ssi object can be passed to other beans for doing
// any further operations on the SecretStore
...
...
}
catch(CommandException e)
{
// TODO: Handle exception
}
public SecretStoreInstance getSecretStoreInstance()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||