public class UserSyncBean extends MemberSyncBean
If WebSphere Commerce is configured to use its own database as the master member profile repository, then the sync beans will only interact with WebSphere Commerce member tables. If on the other hand, WebSphere Commerce is configured to use an LDAP server as the master profile repository, the sync beans will persist member data to LDAP as well as the WebSphere Commerce database. During a read operation, the sync bean's properties are first populated based on the data in the database. Then, if the data on the LDAP server has been updated since the last synchronization, any LDAP properties that are configured to be synchronized will overwrite the existing property values. The ldapentry.xml configuration file controls which properties are synchronized between WebSphere Commerce and LDAP, and in which direction:
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
The IBM Copyright notice field.
|
Constructor and Description |
---|
UserSyncBean(TypedProperty tpCreate)
Constructor that creates a new user in the database and LDAP.
|
Modifier and Type | Method and Description |
---|---|
protected boolean | existsInDB()
Checks if the user exists in the database.
|
protected boolean | existsInLDAP()
Checks if the user exists in LDAP.
|
static UserSyncBean | findByCommerceDN(java.lang.String strCommerceDN)
Finds a user based on the distinguished name of the user in the Commerce database.
|
static UserSyncBean | findByLDAPDN(java.lang.String strLDAPDN)
Finds a user based on the distinguished name of the user in LDAP.
|
static UserSyncBean | findByLogonId(java.lang.String strLogonId)
Finds a user by logon ID.
|
static UserSyncBean | findByMemberId(java.lang.String strMemberId)
Finds a user by member ID.
|
protected static commonj.sdo.DataObject | findInLDAPByDN(java.lang.String astrDN)
Finder method to lookup member in LDAP by DN.
|
static commonj.sdo.DataObject | findInLDAPByLogonId(java.lang.String astrLogonId)
Finds a user in LDAP by logon ID.
|
java.lang.Long[] | getAncestors()
Returns a list of orgEntity IDs of the ancestors.
|
java.lang.Integer[] | getRoles()
Returns a list of role IDs that the user has.
|
java.lang.Integer[] | getRoles(java.lang.String astrOrgEntityId)
Returns a list of roles that the user has in the specified organization
|
java.lang.Integer[] | getRolesForOrgEntityAndAncestors(java.lang.String astrOrgEntityId)
Gets all roles assigned to this user for the specified organization and all of the organization's ancestor organizations.
|
protected void | initDOs()
Initialization for the list of data object classes for reading and writing data to the various user database tables.
|
static boolean | isMigrationEnabled()
Returns whether or not existing users in the database should be migrated to LDAP during logon or update of the user profile.
|
protected boolean | isSynchronizationNeeded()
Checks if synchronization is needed between the database and LDAP.
|
void | updatePasswordInLDAP(java.lang.String strLogonPassword)
Updates the user's password in LDAP.
|
public static final java.lang.String COPYRIGHT
public UserSyncBean(TypedProperty tpCreate) throws ECException, java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException, javax.ejb.CreateException
public static boolean isMigrationEnabled()
public static UserSyncBean findByLogonId(java.lang.String strLogonId) throws javax.ejb.CreateException, java.rmi.RemoteException, javax.naming.NamingException, javax.ejb.FinderException, ECException
If user data is stored only in the database, this finder method will lookup the user using the "logonId" field in the USERREG table.
If LDAP is the master repository for user profile data, the logonId field in the database will contain the DN in lower case. Thus, if the input logon ID is a DN string, findByCommerceDN() will be called. However, if the input logon ID is a short name (non-DN) and the user is found in LDAP, then the user will be found in the database using the "DN" field of the USERS table. If the user has been updated in LDAP since the last synchronization, the database will be updated with the most recent values from LDAP.
public static UserSyncBean findByMemberId(java.lang.String strMemberId) throws javax.naming.NamingException, javax.ejb.CreateException, java.rmi.RemoteException, javax.ejb.FinderException, ECException
public static commonj.sdo.DataObject findInLDAPByLogonId(java.lang.String astrLogonId) throws javax.ejb.CreateException, java.rmi.RemoteException, javax.naming.NamingException, javax.ejb.FinderException, ECException
protected static commonj.sdo.DataObject findInLDAPByDN(java.lang.String astrDN) throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException, javax.ejb.CreateException, ECException
public java.lang.Integer[] getRoles() throws javax.naming.NamingException, javax.ejb.CreateException, java.rmi.RemoteException, javax.ejb.FinderException
public java.lang.Integer[] getRoles(java.lang.String astrOrgEntityId) throws javax.naming.NamingException, javax.ejb.CreateException, java.rmi.RemoteException, javax.ejb.FinderException
public java.lang.Integer[] getRolesForOrgEntityAndAncestors(java.lang.String astrOrgEntityId) throws javax.naming.NamingException, javax.ejb.CreateException, java.rmi.RemoteException, javax.ejb.FinderException
public java.lang.Long[] getAncestors() throws javax.naming.NamingException, javax.ejb.CreateException, java.rmi.RemoteException, javax.ejb.FinderException
protected void initDOs() throws ECException
The default logic is to use the following data object classes:
public void updatePasswordInLDAP(java.lang.String strLogonPassword) throws ECException, java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException
protected boolean isSynchronizationNeeded()
protected boolean existsInDB()
protected boolean existsInLDAP()
public static UserSyncBean findByCommerceDN(java.lang.String strCommerceDN) throws javax.naming.NamingException, javax.ejb.CreateException, java.rmi.RemoteException, javax.ejb.FinderException, ECException
public static UserSyncBean findByLDAPDN(java.lang.String strLDAPDN) throws javax.naming.NamingException, javax.ejb.CreateException, java.rmi.RemoteException, javax.ejb.FinderException, ECException