© 2001 BEA Systems, Inc.

com.beasys.commerce.axiom.contact
Class RealmConfigurationBean

com.beasys.commerce.axiom.contact.RealmConfigurationBean
All Implemented Interfaces:
SchemaManagerConstants, UserManagementConstants

public class RealmConfigurationBean
implements UserManagementConstants

RealmConfigurationBean configures information regarding the underlying Realm for use in the personalization server.


Field Summary
 javax.ejb.SessionContext _ctx
           
protected  javax.naming.Context _environmentNamingContext
           
 
Fields inherited from interface com.beasys.commerce.axiom.contact.UserManagementConstants
ANONYMOUS_PROFILE, CACHED_PROFILE, DEFAULT_SCOPE, DEFAULT_SUCCESSOR, DEFAULT_SUCCESSOR_HOME, DEFAULT_SUCCESSOR_JNDI, DEFAULT_SUCCESSOR_PK, DEFAULT_USER, DEFAULT_USER_HOME, DEFAULT_USER_JNDI, DEFAULT_USER_PK, GROUP, GROUP_ENTITY_HOME, PROFILE_MGR, PROFILE_SUCCESSOR, PROFILE_USER, REALM_CONFIG, RESERVED_SCOPE, USER, USER_ENTITY_HOME, USER_MGR
 
Fields inherited from interface com.beasys.commerce.foundation.property.SchemaManagerConstants
APPLICATION_INIT_TYPE, CATALOG_TYPE, CONTENT_TYPE, EVENT_TYPE, REQUEST_TYPE, SCHEMA, SCHEMA_GROUPS, SCHEMA_MANAGER, SESSION_TYPE, USER_TYPE
 
Constructor Summary
RealmConfigurationBean()
           
 
Method Summary
 java.lang.String cleanupMisconfiguredUsers()
          Removes misconfigured users (those found in the database but not in the realm) from the database.
 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.util.ArrayList getAllDBGroups()
          Returns all the groups that are in the database.
 java.util.ArrayList getAllRealmGroups()
          Returns all the groups that exist in the Realm.
 int getConfiguredGroupCount()
          Returns a count of the realm groups configured for personalization use.
 int getConfiguredUserCount()
          Returns a count of the realm users configured for personalization use.
protected  java.sql.Connection getConnection()
          Get a connection to the database
 java.util.ArrayList getDBUsers()
          Returns just the users found in the database.
protected  javax.naming.Context getEnvironmentNamingContext()
          Returns the bean's environment naming context.
 java.lang.String[] getMisconfiguredUsers()
          Returns the usernames that exist in the database, but not in the realm.
 java.lang.String getRealmClassName()
          Returns the name of the security realm class being used.
 java.util.ArrayList getRealmUsers()
          Returns just the users from the Realm.
 boolean isDefaultRealm()
          Determines if the system is running in the default RDBMSRealm
 void registerGroup(java.lang.String groupName)
          Adds the necessary entries in the database for the group to start being used in the system.
 void setSessionContext(javax.ejb.SessionContext ctx)
          Sets the session context.
 void unregisterGroup(java.lang.String groupName)
          Removes all relevant entries for a group from the database.
 boolean useRealmForGroups()
          Determines if the realm should be solely responsible for group information (rather than WLPS managed tables).
 

Field Detail

_ctx

public javax.ejb.SessionContext _ctx

_environmentNamingContext

protected transient javax.naming.Context _environmentNamingContext
Constructor Detail

RealmConfigurationBean

public RealmConfigurationBean()
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

getConfiguredUserCount

public int getConfiguredUserCount()
                           throws java.rmi.RemoteException,
                                  UserManagementException
Returns a count of the realm users configured for personalization use.
Returns:
a count of the realm users configured for personalization use
Throws:
UserManagementException - group count error
RemoteException - general error

getMisconfiguredUsers

public java.lang.String[] getMisconfiguredUsers()
                                         throws java.rmi.RemoteException,
                                                UserManagementException
Returns the usernames that exist in the database, but not in the realm.
Returns:
the usersnames for the users that are misconfigured
Throws:
UserManagementException - user find error
RemoteException - general error

cleanupMisconfiguredUsers

public java.lang.String cleanupMisconfiguredUsers()
                                           throws java.rmi.RemoteException,
                                                  UserManagementException
Removes misconfigured users (those found in the database but not in the realm) from the database.
Returns:
a status message for the operation
Throws:
UserManagementException - error cleaning up users
RemoteException - general error

getRealmUsers

public java.util.ArrayList getRealmUsers()
                                  throws java.rmi.RemoteException,
                                         UserManagementException
Returns just the users from the Realm.
Returns:
a list of usernames returned from the realm
Throws:
UserManagementException - error accessing realm
RemoteException - general error

getDBUsers

public java.util.ArrayList getDBUsers()
                               throws java.rmi.RemoteException,
                                      UserManagementException
Returns just the users found in the database.
Returns:
a list of usernames in the database
Throws:
UserManagementException - error accessing the database
RemoteException - general error

getConfiguredGroupCount

public int getConfiguredGroupCount()
                            throws java.rmi.RemoteException,
                                   UserManagementException
Returns a count of the realm groups configured for personalization use.
Throws:
UserManagementException - group count error
RemoteException - general error

getAllRealmGroups

public java.util.ArrayList getAllRealmGroups()
                                      throws java.rmi.RemoteException,
                                             UserManagementException
Returns all the groups that exist in the Realm.
Throws:
RemoteException - general error
UserManagementException - realm error

getAllDBGroups

public java.util.ArrayList getAllDBGroups()
                                   throws java.rmi.RemoteException,
                                          UserManagementException
Returns all the groups that are in the database.
Throws:
RemoteException - general error
UserManagementException - LDAP error

registerGroup

public void registerGroup(java.lang.String groupName)
                   throws java.rmi.RemoteException,
                          UserManagementException
Adds the necessary entries in the database for the group to start being used in the system.
Parameters:
groupName - the name of the group to register
Throws:
RemoteException - general error
UserManagementException - DB related error

unregisterGroup

public void unregisterGroup(java.lang.String groupName)
                     throws java.rmi.RemoteException,
                            UserManagementException
Removes all relevant entries for a group from the database.
Parameters:
groupName - the name of the group to unregister
Throws:
RemoteException - general error
UserManagementException - DB related error

getRealmClassName

public java.lang.String getRealmClassName()
                                   throws java.rmi.RemoteException
Returns the name of the security realm class being used.
Returns:
the name of the security realm class being used

isDefaultRealm

public boolean isDefaultRealm()
                       throws java.rmi.RemoteException
Determines if the system is running in the default RDBMSRealm
Returns:
true if the default realm is being used

useRealmForGroups

public boolean useRealmForGroups()
                          throws java.rmi.RemoteException
Determines if the realm should be solely responsible for group information (rather than WLPS managed tables). This will return true if the property commerce.usermgmt.useRealmForGroups is set to "true", and the default RDBMSRealm is not being used.
Returns:
true if group info should only come from the realm

getConnection

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

getEnvironmentNamingContext

protected final javax.naming.Context getEnvironmentNamingContext()
                                                          throws javax.naming.NamingException
Returns the bean's environment naming context.
Throws:
javax.naming.NamingException - - if a naming exception is encountered

© 2001 BEA Systems, Inc.

Copyright © 2001 BEA Systems, Inc. All Rights Reserved