BEA Systems, Inc.

com.beasys.commerce.bridge.ldap
Class LDAPConfigurationBean

java.lang.Object
  |
  +--com.beasys.commerce.bridge.ldap.LDAPConfigurationBean

public class LDAPConfigurationBean
extends java.lang.Object
implements javax.ejb.SessionBean, LDAPBridgeConstants

LDAPPropertiesBean retrieves and sets values for the client's LDAP configuration - NOTE: the server(s) should be restarted before any changes caused by calling a setter method in this bean are expected to have taken effect. This is to ensure that the changes are picked up in beans that exist in other VMs as in a cluster.

See Also:
Serialized Form

Fields inherited from interface com.beasys.commerce.bridge.ldap.LDAPBridgeConstants
LDAP_CONFIG, LDAP_ENABLED_ATTRIBUTE, LDAP_GROUP_ATTRIBUTE, LDAP_USER_ATTRIBUTE
 
Constructor Summary
LDAPConfigurationBean()
           
 
Method Summary
 void addGroupAttribute(java.lang.String attribute)
          Adds an attribute to the list of attributes to be retrieved from the LDAP server for group entries
 void addUserAttribute(java.lang.String attribute)
          Adds an attribute to the list of attributes to be retrieved from the LDAP server for user entries
protected  void debugBundle(java.util.ResourceBundle bundle)
           
 void ejbActivate()
          This method is required by the EJB Specification, but is not used by this example.
 void ejbCreate()
          Creates the session bean.
 void ejbPassivate()
          This method is required by the EJB Specification, but is not used by this example.
 void ejbRemove()
          This method is required by the EJB Specification, but is not used by this example.
 java.lang.String getAuthenticationType()
          Gets the authentication type for the LDAP server.
protected  java.sql.Connection getConnection()
          Get a connection to the database
 java.lang.String[] getGroupAttributes()
          Returns the names of the attributes to be retrieved from the LDAP server for group entities.
 java.lang.String getGroupDN()
          Gets the group DN for the LDAP server.
 java.lang.String getGroupNameAttribute()
          Gets the group name attribute for the LDAP server.
 java.lang.String getGroupUserNameAttribute()
          Gets the group user name attribute for the LDAP server.
 java.lang.String getPrincipal()
          Gets the principal user for the LDAP server.
 java.lang.String getPrincipalCredential()
          Gets the principal password for the LDAP server.
 java.lang.String getServerURL()
          Gets the URL for the LDAP server.
 java.lang.String[] getUserAttributes()
          Returns the names of the attributes to be retrieved from the LDAP server for user entities.
 java.lang.String getUserCommonNameAttribute()
          Gets the user common name attribute for the LDAP server.
 java.lang.String getUserDN()
          Gets the user DN for the LDAP server.
 java.lang.String getUserNameAttribute()
          Gets the user name attribute for the LDAP server.
 java.lang.String getUserPasswordAttribute()
          Gets the user password attribute for the LDAP server.
 boolean groupIsContext()
          Indicates whether the group is context.
 boolean isLDAPEnabled()
          Check the current configuration to determine if LDAP is enabled
 boolean isSSL()
          Indicates whether SSL must be used to communicate with the LDAP server.
 void removeGroupAttribute(java.lang.String attribute)
          Removes an attribute from the list of attributes to be retrieved from the LDAP server for group entries
 void removeUserAttribute(java.lang.String attribute)
          Removes an attribute from the list of attributes to be retrieved from the LDAP server for user entries
 void setGroupAttributes(java.lang.String[] newAttributes)
          Sets the names of the attributes to be retrieved from the LDAP server for group entries, according to the provided array.
 void setLDAPEnabled(boolean flag)
          Set the flag to enable LDAP
 void setSessionContext(javax.ejb.SessionContext ctx)
          Sets the session context.
 void setUserAttributes(java.lang.String[] newAttributes)
          Sets the names of the attributes to be retrieved from the LDAP server for user entries, according to the provided array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDAPConfigurationBean

public LDAPConfigurationBean()
Method Detail

ejbCreate

public void ejbCreate()
Creates the session bean.

ejbActivate

public void ejbActivate()
This method is required by the EJB Specification, but is not used by this example.
Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbRemove

public void ejbRemove()
This method is required by the EJB Specification, but is not used by this example.
Specified by:
ejbRemove in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
This method is required by the EJB Specification, but is not used by this example.
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

setSessionContext

public final void setSessionContext(javax.ejb.SessionContext ctx)
Sets the session context.
Specified by:
setSessionContext in interface javax.ejb.SessionBean
Parameters:
ctx - Context for session

addGroupAttribute

public void addGroupAttribute(java.lang.String attribute)
                       throws java.lang.Exception,
                              java.rmi.RemoteException
Adds an attribute to the list of attributes to be retrieved from the LDAP server for group entries
Parameters:
attribute - the name of the attribute to add
Throws:
RemoteException - general error

removeGroupAttribute

public void removeGroupAttribute(java.lang.String attribute)
                          throws java.lang.Exception,
                                 java.rmi.RemoteException
Removes an attribute from the list of attributes to be retrieved from the LDAP server for group entries
Parameters:
attribute - the name of the attribute to remove
Throws:
RemoteException - general error

getGroupAttributes

public java.lang.String[] getGroupAttributes()
                                      throws java.lang.Exception,
                                             java.rmi.RemoteException
Returns the names of the attributes to be retrieved from the LDAP server for group entities.
Returns:
String [] group attribute names. If no attributes, returns an empty array.
Throws:
RemoteException - general error

setGroupAttributes

public void setGroupAttributes(java.lang.String[] newAttributes)
                        throws java.lang.Exception,
                               java.rmi.RemoteException
Sets the names of the attributes to be retrieved from the LDAP server for group entries, according to the provided array.
Throws:
RemoteException - general error

addUserAttribute

public void addUserAttribute(java.lang.String attribute)
                      throws java.lang.Exception,
                             java.rmi.RemoteException
Adds an attribute to the list of attributes to be retrieved from the LDAP server for user entries
Parameters:
attribute - the name of the attribute to add
Throws:
RemoteException - general error

removeUserAttribute

public void removeUserAttribute(java.lang.String attribute)
                         throws java.lang.Exception,
                                java.rmi.RemoteException
Removes an attribute from the list of attributes to be retrieved from the LDAP server for user entries
Parameters:
attribute - the name of the attribute to remove
Throws:
RemoteException - general error

getUserAttributes

public java.lang.String[] getUserAttributes()
                                     throws java.lang.Exception,
                                            java.rmi.RemoteException
Returns the names of the attributes to be retrieved from the LDAP server for user entities.
Returns:
String [] user attribute names. If no attributes, returns an empty array.
Throws:
RemoteException - general error

setUserAttributes

public void setUserAttributes(java.lang.String[] newAttributes)
                       throws java.lang.Exception,
                              java.rmi.RemoteException
Sets the names of the attributes to be retrieved from the LDAP server for user entries, according to the provided array.
Throws:
RemoteException - general error

getPrincipal

public java.lang.String getPrincipal()
                              throws java.lang.Exception,
                                     java.rmi.RemoteException
Gets the principal user for the LDAP server.
Returns:
the principal user for the server
Throws:
RemoteException - general error

getServerURL

public java.lang.String getServerURL()
                              throws java.lang.Exception,
                                     java.rmi.RemoteException
Gets the URL for the LDAP server.
Returns:
the URL for the server
Throws:
RemoteException - general error

getPrincipalCredential

public java.lang.String getPrincipalCredential()
                                        throws java.lang.Exception,
                                               java.rmi.RemoteException
Gets the principal password for the LDAP server.
Returns:
the principal password for the server
Throws:
RemoteException - general error

isSSL

public boolean isSSL()
              throws java.lang.Exception,
                     java.rmi.RemoteException
Indicates whether SSL must be used to communicate with the LDAP server.
Returns:
whether SSL must be used to communicate with the LDAP server.
Throws:
RemoteException - general error

getAuthenticationType

public java.lang.String getAuthenticationType()
                                       throws java.lang.Exception,
                                              java.rmi.RemoteException
Gets the authentication type for the LDAP server.
Returns:
the authentication type for the server
Throws:
RemoteException - general error

getUserDN

public java.lang.String getUserDN()
                           throws java.lang.Exception,
                                  java.rmi.RemoteException
Gets the user DN for the LDAP server.
Returns:
the user DN for the server
Throws:
RemoteException - general error

getGroupDN

public java.lang.String getGroupDN()
                            throws java.lang.Exception,
                                   java.rmi.RemoteException
Gets the group DN for the LDAP server.
Returns:
the group DN for the server
Throws:
RemoteException - general error

getUserNameAttribute

public java.lang.String getUserNameAttribute()
                                      throws java.lang.Exception,
                                             java.rmi.RemoteException
Gets the user name attribute for the LDAP server.
Returns:
the user name attribute for the server
Throws:
RemoteException - general error

getGroupNameAttribute

public java.lang.String getGroupNameAttribute()
                                       throws java.lang.Exception,
                                              java.rmi.RemoteException
Gets the group name attribute for the LDAP server.
Returns:
the group name attribute for the server
Throws:
RemoteException - general error

getGroupUserNameAttribute

public java.lang.String getGroupUserNameAttribute()
                                           throws java.lang.Exception,
                                                  java.rmi.RemoteException
Gets the group user name attribute for the LDAP server.
Returns:
the group user name attribute for the server
Throws:
RemoteException - general error

getUserPasswordAttribute

public java.lang.String getUserPasswordAttribute()
                                          throws java.lang.Exception,
                                                 java.rmi.RemoteException
Gets the user password attribute for the LDAP server.
Returns:
the user name attribute for the server
Throws:
RemoteException - general error

getUserCommonNameAttribute

public java.lang.String getUserCommonNameAttribute()
                                            throws java.lang.Exception,
                                                   java.rmi.RemoteException
Gets the user common name attribute for the LDAP server.
Returns:
the user common name for the server
Throws:
RemoteException - general error

groupIsContext

public boolean groupIsContext()
                       throws java.lang.Exception,
                              java.rmi.RemoteException
Indicates whether the group is context.
Returns:
whether the group is context.
Throws:
RemoteException - general error

isLDAPEnabled

public boolean isLDAPEnabled()
                      throws java.lang.Exception,
                             java.rmi.RemoteException
Check the current configuration to determine if LDAP is enabled
Returns:
true if ldap is enabled, false otherwise
Throws:
RemoteException - general error

setLDAPEnabled

public void setLDAPEnabled(boolean flag)
                    throws java.lang.Exception,
                           java.rmi.RemoteException
Set the flag to enable LDAP
Parameters:
flag - true to enable LDAP, false to disable it
Throws:
RemoteException - general error

getConnection

protected java.sql.Connection getConnection()
                                     throws java.sql.SQLException
Get a connection to the database

debugBundle

protected void debugBundle(java.util.ResourceBundle bundle)

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved