© 2001 BEA Systems, Inc.

com.beasys.commerce.bridge.ldap
Class LDAPConfigurationBean

com.beasys.commerce.bridge.ldap.LDAPConfigurationBean
All Implemented Interfaces:
LDAPBridgeConstants

public class LDAPConfigurationBean
implements 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.


Field Summary
static java.lang.String BEA_HOME
           
static java.lang.String CONFIG_DIR
           
static java.lang.String CONFIG_XML
           
static java.lang.String WLCS_DOMAIN
           
 
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 getName()
          Gets the name of the LDAP realm.
 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 getUserAuthentication()
          Gets the user authentication of 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 loadXMLConfigFile()
           
 void print()
          END GETTER
 void readXMLFile(java.io.InputStream is)
           
 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.
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
           
 void test()
           
 

Field Detail

BEA_HOME

public static final java.lang.String BEA_HOME

WLCS_DOMAIN

public static final java.lang.String WLCS_DOMAIN

CONFIG_XML

public static final java.lang.String CONFIG_XML

CONFIG_DIR

public static final java.lang.String CONFIG_DIR
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.

ejbRemove

public void ejbRemove()
This method is required by the EJB Specification, but is not used by this example.

ejbPassivate

public void ejbPassivate()
This method is required by the EJB Specification, but is not used by this example.

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
Sets the session context.
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

loadXMLConfigFile

public void loadXMLConfigFile()
                       throws java.rmi.RemoteException,
                              java.lang.Exception

readXMLFile

public void readXMLFile(java.io.InputStream is)
                 throws java.lang.Exception

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException

getName

public java.lang.String getName()
                         throws java.lang.Exception,
                                java.rmi.RemoteException
Gets the name of the LDAP realm.
Returns:
the name for the server
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

getUserAuthentication

public java.lang.String getUserAuthentication()
                                       throws java.lang.Exception,
                                              java.rmi.RemoteException
Gets the user authentication of the LDAP server.
Returns:
the user authentication 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

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

print

public void print()
END GETTER

test

public void test()

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)

© 2001 BEA Systems, Inc.

Copyright © 2001 BEA Systems, Inc. All Rights Reserved