BEA Systems, Inc.

com.beasys.commerce.axiom.contact.security
Class RealmLink

java.lang.Object
  |
  +--com.beasys.commerce.axiom.contact.security.RealmLink

public class RealmLink
extends java.lang.Object
implements UserManagementConstants

Utility class to ensure consistency between an external realm and the Commerce Server's personalization tables. This class will make some optimizations when querying the default RDBMS realm.


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, REQUEST_TYPE, SCHEMA, SCHEMA_GROUPS, SESSION_TYPE, USER_TYPE
 
Constructor Summary
protected RealmLink()
          DefaultConstructor.
 
Method Summary
static void addGroupToGroup(java.lang.String parentGroup, java.lang.String childGroup)
          Adds childGroup as a child of parentGroup
static void addUserToGroup(java.lang.String username, java.lang.String groupName)
          Adds a user to a group.
static boolean authUserPassword(java.lang.String username, java.lang.String password)
          Authenticates a username-password combination.
static void changeGroupName(java.lang.String oldGroupName, java.lang.String newGroupName)
          Changes the name of an existing group.
static java.lang.String[] getAllGroupNames()
          Returns the intersection of personalized group names with realm group names.
static java.lang.String[] getChildGroupNames(java.lang.String parentGroup)
          Gets the names of all child groups
static long getGroupId(java.lang.String groupName)
          Returns the unique identifier of a group
static java.lang.String getGroupName(long id)
          Returns the name of a group
static java.lang.String[] getGroupNamesForUser(java.lang.String username)
          Returns the list of group names of which a user is a member.
static java.lang.String getParentGroupName(java.lang.String childGroupName)
          Retrieves the parent group name for a group.
static java.lang.String[] getTopLevelGroupNames()
           
static long getUserId(java.lang.String username)
          Returns the unique identifier of a user
static java.lang.String getUserName(long id)
          Returns the name of a user
static java.lang.String[] getUserNames(java.lang.String searchExpression, int limit)
          Returns an array users' names matching the search expression Handled through SPI
static java.lang.String[] getUserNamesForGroup(java.lang.String groupName, java.lang.String searchExpression, int limit)
          Returns a group's list of members in the form of users' names
static void refreshAll()
          Instructs the current WebLogic CachingRealm to clear all of its caches
static void refreshGroups()
          Instructs the current WebLogic CachingRealm to refresh its cache of group information.
static void refreshUsers()
          Instructs the current WebLogic CachingRealm to refresh its cache of user information.
static void removeGroupFromGroup(java.lang.String parentGroup, java.lang.String childGroup)
          Removes childGroup from parentGroup
static void removeUserFromGroup(java.lang.String username, java.lang.String groupName)
          Removes a user from a group.
static void setPassword(java.lang.String username, java.lang.String password)
          Sets the password for a user.
static boolean userExists(java.lang.String username)
          Checks for existence of a User in the realm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealmLink

protected RealmLink()
DefaultConstructor.
Method Detail

userExists

public static boolean userExists(java.lang.String username)
Checks for existence of a User in the realm
Parameters:
username - the name of the user to look for
Throws:
ServiceProviderException - if a system error occurs

getUserNamesForGroup

public static java.lang.String[] getUserNamesForGroup(java.lang.String groupName,
                                                      java.lang.String searchExpression,
                                                      int limit)
Returns a group's list of members in the form of users' names
Parameters:
groupName - the name of the group
searchExpression - a search expression such as "J* Smith"
limit - a limit of results to return
Throws:
UserManagmentException - if a system error occurs

authUserPassword

public static boolean authUserPassword(java.lang.String username,
                                       java.lang.String password)
Authenticates a username-password combination.

addGroupToGroup

public static void addGroupToGroup(java.lang.String parentGroup,
                                   java.lang.String childGroup)
                            throws ServiceProviderException
Adds childGroup as a child of parentGroup
Parameters:
parentGroup - the name of the parent group
childGroup - the name of the group to add
Throws:
RemoteException - because of EJB contract
UserManagmentException - if a system error occurs

removeGroupFromGroup

public static void removeGroupFromGroup(java.lang.String parentGroup,
                                        java.lang.String childGroup)
                                 throws ServiceProviderException
Removes childGroup from parentGroup
Parameters:
parentGroup - the name of the parent group
childGroup - the name of the group to remove
Throws:
RemoteException - because of EJB contract
ServiceProviderException - if a system error occurs

getChildGroupNames

public static java.lang.String[] getChildGroupNames(java.lang.String parentGroup)
                                             throws ServiceProviderException
Gets the names of all child groups
Parameters:
parentGroup - the group whose children to retrieve
Returns:
an array of the names of this group's children
Throws:
RemoteException - because of EJB contract
ServiceProviderException - if a system error occurs

changeGroupName

public static void changeGroupName(java.lang.String oldGroupName,
                                   java.lang.String newGroupName)
                            throws ServiceProviderException
Changes the name of an existing group.
Parameters:
oldGroupName - the old group name
newGroupName - the new group name

getParentGroupName

public static java.lang.String getParentGroupName(java.lang.String childGroupName)
                                           throws ServiceProviderException
Retrieves the parent group name for a group.
Parameters:
childGroupName - the name of the group whose parent group name is sought
Returns:
parent group name; null if no parent
Throws:
ServiceProviderException - if a system error occurs

addUserToGroup

public static void addUserToGroup(java.lang.String username,
                                  java.lang.String groupName)
                           throws ServiceProviderException
Adds a user to a group.
Parameters:
username - the username of the user to add
groupName - the name to the group to which the user should be added
Throws:
ServiceProviderException - if a system error occurs

removeUserFromGroup

public static void removeUserFromGroup(java.lang.String username,
                                       java.lang.String groupName)
                                throws ServiceProviderException
Removes a user from a group.
Parameters:
username - the username of the user to remove
groupName - the name of the group from which the user should be removed
Throws:
RemoteException - because of EJB contract
ServiceProviderException - if a system error occurs

getAllGroupNames

public static java.lang.String[] getAllGroupNames()
                                           throws ServiceProviderException
Returns the intersection of personalized group names with realm group names.

getTopLevelGroupNames

public static java.lang.String[] getTopLevelGroupNames()
                                                throws ServiceProviderException
Returns:
a list of names of groups that do not have a parent group

getGroupNamesForUser

public static java.lang.String[] getGroupNamesForUser(java.lang.String username)
                                               throws ServiceProviderException
Returns the list of group names of which a user is a member.
Parameters:
username - the username of the user
Returns:
the list of groups of which a user is a member
Throws:
RemoteException - because of EJB contract
UserManagmentException - if a system error occurs

getUserNames

public static java.lang.String[] getUserNames(java.lang.String searchExpression,
                                              int limit)
                                       throws UserManagementException
Returns an array users' names matching the search expression Handled through SPI
Parameters:
searchExpression - a search expression such as "J* Smith"
limit - a limit of results to return
Throws:
RemoteException - because of EJB contract
UserManagmentException - if a system error occurs

refreshGroups

public static void refreshGroups()
Instructs the current WebLogic CachingRealm to refresh its cache of group information.

refreshUsers

public static void refreshUsers()
Instructs the current WebLogic CachingRealm to refresh its cache of user information.

refreshAll

public static void refreshAll()
Instructs the current WebLogic CachingRealm to clear all of its caches

getGroupId

public static long getGroupId(java.lang.String groupName)
                       throws ServiceProviderException
Returns the unique identifier of a group
Parameters:
groupName - the group to query

getUserId

public static long getUserId(java.lang.String username)
                      throws ServiceProviderException
Returns the unique identifier of a user
Parameters:
username - the user to query

getGroupName

public static java.lang.String getGroupName(long id)
                                     throws ServiceProviderException
Returns the name of a group
Parameters:
id - the unique identifier of the group to query

getUserName

public static java.lang.String getUserName(long id)
                                    throws ServiceProviderException
Returns the name of a user
Parameters:
id - the unique identifier of the user to query

setPassword

public static void setPassword(java.lang.String username,
                               java.lang.String password)
                        throws ServiceProviderException
Sets the password for a user. The system must be running with the provided RDBMSRealm. The password will be encrypted before being stored in the database.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved