com.novell.ecb.secretstore
Class CreateSecretStoreInstance

java.lang.Object
  |
  +--com.novell.ecb.secretstore.CreateSecretStoreInstance
All Implemented Interfaces:
java.io.Serializable

public class CreateSecretStoreInstance
extends java.lang.Object
implements java.io.Serializable

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.

Required Input Properties:
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/
Note: The URL, Password and the LoginDN properties are optional, if the connection is set.
 
Optional Input Properties:
UserDN - The distinguished name of the user whose SecretStore is to be accessed.
MasterPassword - The master password for the SecretStore.
 
Output Properties:
SecretStoreInstance - An object that represents the SecretStore of the target object.

Version:
1.0
See Also:
Serialized Form

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

CreateSecretStoreInstance

public CreateSecretStoreInstance()
Constructs a CreateSecretStoreInstance bean.


CreateSecretStoreInstance

public CreateSecretStoreInstance(com.novell.ecb.ldap.LdapConnection connection)
Constructs a CreateSecretStoreInstance bean and sets the connection to be used by the bean.

Parameters:
connection - The connection object.

CreateSecretStoreInstance

public CreateSecretStoreInstance(java.lang.String url,
                                 java.lang.String loginDN,
                                 java.lang.String password)
Deprecated. Replaced by CreateSecretStoreInstance(String, String, char[]).

Constructs a CreateSecretStoreInstance bean and sets the URL, loginDN, and password to be used by the bean.

Parameters:
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.

CreateSecretStoreInstance

public 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.

Parameters:
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

setConnection

public void setConnection(Connection connection)
Sets the connection to be used by the bean. The URL, Password and the LoginDN properties are optional, if the connection is set.

Parameters:
connection - The Connection object.

getConnection

public Connection getConnection()
Returns the connection.

Returns:
Connection Connection object.

setUserDN

public void setUserDN(java.lang.String DN)
Sets the user DN whose SecretStore is to be accessed.

Setting this value as loginDN does not make any difference. By default, the person logging in is assumed to be the user.

Parameters:
DN - The distinguished name of the user whose SecretStore is to be accessed.

getUserDN

public java.lang.String getUserDN()
Returns the user DN.

Returns:
String The distinguished name of the user whose SecretStore is being accessed.

setLoginDN

public void setLoginDN(java.lang.String DN)
Sets the distinguished name of the user for authentication.

Parameters:
DN - The distinguished name of the user for authentication.

getLoginDN

public java.lang.String getLoginDN()
Returns the distinguished name of the user for authentication.

Returns:
String The distinguished name of the user for authentication.

setPassword

public void setPassword(java.lang.String password)
Deprecated. Replaced by setPassword(char[]).

Sets the password to be used for authentication.

Parameters:
password - Password of the user.

setPassword

public void setPassword(char[] password)
Sets the password to be used for authentication.

Parameters:
password - Password of the user.

setMasterPassword

public void setMasterPassword(java.lang.String password)
Deprecated. Replaced by setMasterPassword(char[]).

Sets the master password. If this property is set to true, SecretStoreInstance created by this bean will have a reference to master password.

Parameters:
password - Master password of the SecretStore.

setMasterPassword

public void setMasterPassword(char[] password)
Sets the master password. If this property is set to true, SecretStoreInstance created by this bean will have a reference to master password.

Parameters:
password - Master password of the SecretStore.

setURL

public void setURL(java.lang.String url)
Sets the URL of the LDAP server to be contacted.

Parameters:
url - URL of the LDAP server running the SecretStore service. The URL must have secure port also. For example, ldap://ldap.acme.com:636/

getURL

public java.lang.String getURL()
Returns the URL.

Returns:
String URL of the LDAP server.

isReady

public boolean isReady()
Tests whether the required input properties are set and the bean is in "initialized" state.

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.

Returns:
boolean True if the bean is in initialized state; else, returns False.

reset

public void reset()
Resets the output properties to the values they had before the execute method was called.

Sets the output property, SecretStoreInstance, to its default value i.e. Null.


execute

public void execute()
             throws CommandException
Creates a SecretStoreInstance object, which is used for doing further operations on the SecretStore.

Throws:
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
      }
 


getSecretStoreInstance

public SecretStoreInstance getSecretStoreInstance()
Returns the SecretStoreInstance created by the bean.

Returns:
SecretStoreInstance Object representing the SecretStore of the user.


Copyright © 2001-2003 Novell, Inc. All Rights Reserved.