com.ibm.commerce.member.syncbeans

Class OrganizationSyncBean



  • public class OrganizationSyncBean
    extends MemberSyncBean
    A synchronization bean (sync bean) that allows client code to interact with organization data without having to worry about the underlying persistence layer: WebSphere Commerce database or an LDAP server. The organization sync bean makes use of the following sync helper data object classes by default, to read from and write to the WebSphere Commerce organization tables:
    • OrgEntityDO: ORGENTITY table
    • SelfAddressDO: ADDRESS table (self-address only)
    • MemberAttributesDO: MBRATTRVAL table
    VMMProxy is used to read from and write to LDAP, using Virtual Member Manager (VMM). VMM is a component of WebSphere Application Server (WAS) that's used when WAS security is configured to use the federated user repository.

    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 Detail

      • COPYRIGHT

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

      • OrganizationSyncBean

        public OrganizationSyncBean(TypedProperty tpCreate)
                             throws ECException,
                                    java.rmi.RemoteException,
                                    javax.persistence.NoResultException
        Constructor that creates a new organization in the database and LDAP. It is called by the organization registration commands when creating a new organization.
        Parameters:
        tpCreate - The properties of the new organization.
        Throws:
        ECException
        java.rmi.RemoteException
        javax.persistence.NoResultException
    • Method Detail

      • findByCommerceDN

        public static OrganizationSyncBean findByCommerceDN(java.lang.String strCommerceDN)
                                                     throws java.rmi.RemoteException,
                                                            javax.persistence.NoResultException,
                                                            ECException
        Finds an organization based on the distinguished name of the organization in the Commerce database. Synchronization of the organization between LDAP and the database is performed if the organization exists in either repository.
        Parameters:
        strCommerceDN - Distinguished name of the organization in the Commerce database.
        Returns:
        an instance of the OrganizationSyncBean.
        Throws:
        java.rmi.RemoteException
        javax.persistence.NoResultException
        ECException
      • findByMemberId

        public static OrganizationSyncBean findByMemberId(java.lang.String strMemberId)
                                                   throws java.rmi.RemoteException,
                                                          javax.persistence.NoResultException,
                                                          ECException
        Finds an organization by member ID. Synchronization of the organization between LDAP and the database is performed if the organization exists in the database.
        Parameters:
        strMemberId - The member ID.
        Returns:
        an instance of OrganizationSyncBean.
        Throws:
        java.rmi.RemoteException
        javax.persistence.NoResultException - Thrown if the organization does not exist in the database.
        ECException
      • getRoles

        public java.lang.Integer[] getRoles()
                                     throws javax.persistence.NoResultException
        Returns an array of role IDs that the organization has.
        Returns:
        an array of role IDs that the organization has.
        Throws:
        javax.persistence.NoResultException
      • getAncestors

        public java.lang.Long[] getAncestors()
                                      throws javax.persistence.NoResultException
        Returns an array of orgEntity IDs of the ancestors.
        Returns:
        an array of orgEntity IDs of the ancestors.
        Throws:
        javax.persistence.NoResultException
      • getDescendants

        public java.lang.Long[] getDescendants()
                                        throws javax.persistence.NoResultException
        Returns an array of member IDs of all the descendants of this organization. The descendants include organizations and users.
        Returns:
        an array of member IDs of all the descendants of this organization. The descendants include organizations and users.
        Throws:
        javax.persistence.NoResultException - thrown if a finder exception occurs.
      • getChildren

        public java.lang.Long[] getChildren()
                                     throws javax.persistence.NoResultException
        Returns an array of member IDs of the immediate children (one level) of the organization. The children are either organizations or users.
        Returns:
        an array of member IDs of the immediate children (one level) of the organization. The children are either organizations or users.
        Throws:
        javax.persistence.NoResultException
      • getChildOrgEntities

        public java.lang.Long[] getChildOrgEntities()
                                             throws javax.naming.NamingException,
                                                    javax.persistence.NoResultException
        Returns an array of orgEntity IDs that are immediate children (one level) of this orgEntity.
        Returns:
        an array of orgEntity IDs that are immediate children (one level) of this orgEntity.
        Throws:
        javax.naming.NamingException - thrown if a naming exception occurs.
        javax.persistence.NoResultException - thrown if a finder exception occurs.
      • getChildUsers

        public java.lang.Long[] getChildUsers()
                                       throws javax.naming.NamingException,
                                              javax.persistence.NoResultException
        Returns an array of user IDs that are immediate children (one level) of the organization.
        Returns:
        an array of user IDs that are immediate children (one level) of the organization.
        Throws:
        javax.naming.NamingException - thrown if a naming exception occurs.
        javax.persistence.NoResultException - thrown if a finder exception occurs.
      • getDescendantOrgEntities

        public java.lang.Long[] getDescendantOrgEntities()
                                                  throws javax.persistence.NoResultException
        Returns an array of orgEntity IDs of all the descendant orgEntities.
        Returns:
        an array of orgEntity IDs of all the descendant orgEntities. If the organization has not been resolved, then null is returned.
        Throws:
        javax.persistence.NoResultException - thrown if a finder exception occurs.
      • getDescendantUsers

        public java.lang.Long[] getDescendantUsers()
                                            throws javax.naming.NamingException,
                                                   javax.persistence.NoResultException
        Returns an array of user IDs that are descendants of the organization.
        Returns:
        an array of user IDs that are descendants of the organization.
        Throws:
        javax.naming.NamingException
        javax.persistence.NoResultException
      • findByLDAPDN

        public static OrganizationSyncBean findByLDAPDN(java.lang.String astrLDAPDN)
                                                 throws java.rmi.RemoteException,
                                                        javax.persistence.NoResultException,
                                                        ECException
        Finds an organization based on the distinguished name of the organization in LDAP. Synchronization of the organization between LDAP and the database is performed if the organization exists in either repository.
        Parameters:
        astrLDAPDN - Distinguished name of the organization in LDAP.
        Returns:
        an instance of the OrganizationSyncBean.
        Throws:
        java.rmi.RemoteException
        javax.persistence.NoResultException
        ECException