com.ibm.commerce.member.syncbeans

Class SyncBeanBase

  • java.lang.Object
    • com.ibm.commerce.member.syncbeans.SyncBeanBase
  • Direct Known Subclasses:
    MemberSyncBean


    public abstract class SyncBeanBase
    extends java.lang.Object
    The base class for the synchronization beans, also known as sync beans. Sync beans allow member data to be accessed without having to worry about the underlying persistence layer: WebSphere Commerce database or an LDAP server. The most commonly used sync beans are the UserSyncBean and OrganizationSyncBean. These sync beans are used to access user and organization data respectively. The sync beans make use of sync helper data object classes, that extend from DOBase, and are used to read from and write to the WebSphere Commerce database tables. VMMProxy is used to read from and write to LDAP.

    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:

    • LDAP to WebSphere Commerce
    • WebSphere Commerce to LDAP
    • Bidirectional
    • LDAP only
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      The IBM Copyright notice field.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      static java.lang.String getCommerceDN(java.lang.String astrLDAPDN, commonj.sdo.DataObject adoMember)
      Gets the Commerce DN corresponding to the given LDAP DN.
      static java.lang.String getLDAPDN(java.lang.String astrCommerceDN)
      Gets the LDAP DN corresponding to the given Commerce DN.
      commonj.sdo.DataObject getLDAPMember()
      Gets the entity data object corresponding to the member in LDAP.
      java.lang.String getMemberId()
      Gets the member ID that corresponds to this sync bean.
      short getMemberType()
      Gets the member type: ECMemberCommandParameterConstants.MEMBER_TYPE_UNKNOWN = -1 ECMemberCommandParameterConstants.MEMBER_TYPE_PERSON = 0 ECMemberCommandParameterConstants.MEMBER_TYPE_GROUP = 1 ECMemberCommandParameterConstants.MEMBER_TYPE_ORGANIZATION = 2 ECMemberCommandParameterConstants.MEMBER_TYPE_ORGANIZATIONAL_UNIT = 3
      TypedProperty getProperties()
      Gets the properties of the sync bean.
      java.lang.String getProperty(java.lang.String strAttributeName)
      Gets the value of the specified attribute.
      java.util.Vector getProperty(java.lang.String strAttributeName, java.lang.String strStoreEntityId)
      Gets a vector of member attribute values based on the attribute name and store ID.
      com.ibm.commerce.member.objects.WMMMapAccessBean getWMMMapAccessBean()
      Get the WMMMap access bean that corresponds to the row in the WMMMAP table for this sync bean.
      static boolean isWMMEnabled()
      Deprecated. 
      void refresh()
      Refresh the bean by first getting the values from the database.
      void update(TypedProperty tpUpdate)
      Updates data in the sync bean, and then persists it to the Commerce database and LDAP.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM Copyright notice field.
        See Also:
        Constant Field Values
    • Method Detail

      • isWMMEnabled

        public static boolean isWMMEnabled()
        Deprecated. in WC 7.0, replaced by MemberHelper.isLDAPUsedForProfileStorage()
        Returns whether or not LDAP is used for storing member profile data. It is based on the setting of ProfileDataStorage flag in the instance configuration file.
        Returns:
        true if LDAP is enabled; false otherwise.
      • getMemberId

        public java.lang.String getMemberId()
        Gets the member ID that corresponds to this sync bean.
        Returns:
        the member ID.
      • getLDAPMember

        public commonj.sdo.DataObject getLDAPMember()
        Gets the entity data object corresponding to the member in LDAP.
        Returns:
        the entity data object corresponding to the member in LDAP.
      • getWMMMapAccessBean

        public com.ibm.commerce.member.objects.WMMMapAccessBean getWMMMapAccessBean()
        Get the WMMMap access bean that corresponds to the row in the WMMMAP table for this sync bean.
        Returns:
        the WMMMap access bean.
      • getMemberType

        public short getMemberType()
        Gets the member type:
      • ECMemberCommandParameterConstants.MEMBER_TYPE_UNKNOWN = -1
      • ECMemberCommandParameterConstants.MEMBER_TYPE_PERSON = 0
      • ECMemberCommandParameterConstants.MEMBER_TYPE_GROUP = 1
      • ECMemberCommandParameterConstants.MEMBER_TYPE_ORGANIZATION = 2
      • ECMemberCommandParameterConstants.MEMBER_TYPE_ORGANIZATIONAL_UNIT = 3
Returns:
the member type.
  • getProperties

    public TypedProperty getProperties()
    Gets the properties of the sync bean.
    Returns:
    the properties.
  • getProperty

    public java.lang.String getProperty(java.lang.String strAttributeName)
    Gets the value of the specified attribute.
    Parameters:
    strAttributeName - The name of the attribute to be retrieved.
    Returns:
    the value of the specified attribute name.
  • getProperty

    public java.util.Vector getProperty(java.lang.String strAttributeName,
                                        java.lang.String strStoreEntityId)
    Gets a vector of member attribute values based on the attribute name and store ID.
    Parameters:
    strAttributeName - The attribute name to be retrieved.
    strStoreEntityId - The store ID context.
    Returns:
    a vector of the value of retrieved attribute
  • refresh

    public void refresh()
                 throws java.rmi.RemoteException,
                        ECException
    Refresh the bean by first getting the values from the database. Then overwrite the values with any data from LDAP, if the entity exists in LDAP. If the entity does not exist in LDAP, then create it there, as long as this is not a UserSyncBean. This method is called during find and update scenarios, but not during create.
    Throws:
    java.rmi.RemoteException
    ECException
  • update

    public void update(TypedProperty tpUpdate)
                throws java.rmi.RemoteException,
                       javax.persistence.NoResultException,
                       ECException
    Updates data in the sync bean, and then persists it to the Commerce database and LDAP. Called by the member update commands as well as Logon command in the case that a user is migrated from the database to LDAP.
    Parameters:
    tpUpdate - Update properties.
    Throws:
    java.rmi.RemoteException
    javax.persistence.NoResultException
    ECException
  • getCommerceDN

    public static java.lang.String getCommerceDN(java.lang.String astrLDAPDN,
                                                 commonj.sdo.DataObject adoMember)
                                          throws ECException
    Gets the Commerce DN corresponding to the given LDAP DN. Delegates to LDAPIntegrationCmd.getCommerceDN(String, DataObject).
    Parameters:
    astrLDAPDN - The LDAP DN.
    adoMember - The entity object representing the member.
    Returns:
    The Commerce DN corresponding to the given LDAP DN.
    Throws:
    ECException - Thrown if an error occurs.
  • getLDAPDN

    public static java.lang.String getLDAPDN(java.lang.String astrCommerceDN)
                                      throws ECException
    Gets the LDAP DN corresponding to the given Commerce DN. Delegates to LDAPIntegrationCmd.getLDAPDN(String).
    Parameters:
    astrCommerceDN - The Commerce DN.
    Returns:
    The LDAP DN corresponding to the given Commerce DN.
    Throws:
    ECException - Thrown if an error occurs.