Class AssignableDynamicGroup

    • Constructor Detail

      • AssignableDynamicGroup

        public AssignableDynamicGroup()
        Default constructor
      • AssignableDynamicGroup

        public AssignableDynamicGroup​(CreationTemplate template,
                                      AttrSet attrSet)
                               throws UMSException
        Constructs an in memory AssignableDynamicGroup object with a given template. This is an in memory Group object and one needs to call save method to save this newly created object to persistent storage.
        Parameters:
        template - Template for creating a group.
        attrSet - Attribute/value set.
        Throws:
        UMSException - if fail to instantiate from persistent storage.
      • AssignableDynamicGroup

        public AssignableDynamicGroup​(CreationTemplate template,
                                      AttrSet attrSet,
                                      Guid baseGuid,
                                      int scope)
                               throws UMSException
        Constructs an AssignableDynamicGroup object with a given template. This is an in memory Group object and one needs to call save method to save this newly created object to persistent storage.
        Parameters:
        template - Template for creating a group.
        attrSet - Attribute-value set which should not contain member URL; any values of member URL will be overwritten by the explicit search criteria arguments.
        baseGuid - Search base for evaluating members of the group
        scope - Search scope for evaluating members of the group has to be LDAPv2.SCOPE_ONE or LDAPv2.SCOPE_SUB.
        Throws:
        UMSException - if fail to instantiate from persistent storage
    • Method Detail

      • setSearchFilter

        public void setSearchFilter​(String filter)
        Sets the search filter used to evaluate this dynamic group. For an AssignableDynamicGroup, the filter is always "memberof=THIS_DN", so this method should not generally be called outside the package.
        Specified by:
        setSearchFilter in interface IDynamicMembership
        Overrides:
        setSearchFilter in class DynamicGroup
        Parameters:
        filter - Search filter for evaluating members of the group the scope in the filter has to be LDAPv2.SCOPE_ONE or LDAPv2.SCOPE_SUB.
      • setGuid

        protected void setGuid​(Guid guid)
        Sets the GUID of the entity; used within the package.
        Overrides:
        setGuid in class PersistentObject
        Parameters:
        guid - GUID REVIEW: This method overloads the PersistentObject.setGuid() method. Hence the signature has to match, and we can't throw the UMSException that could be thrown from "setSearchFilter". Is it enough to log such an error ???
      • addMember

        public void addMember​(Guid userGuid)
                       throws UMSException
        Adds a member to the group. The change is saved to persistent storage.
        Specified by:
        addMember in interface IAssignableMembership
        Parameters:
        userGuid - Globally unique identifier for the member to be added.
        Throws:
        UMSException - if fail to save to persistent storage or if the user is not within the scope of the group.
      • addMember

        public void addMember​(PersistentObject member)
                       throws UMSException
        Adds a member to the group. The change is saved to persistent storage.
        Specified by:
        addMember in interface IAssignableMembership
        Parameters:
        member - Object to be added as member.
        Throws:
        UMSException - if fail to save to persistent storage or if the user is not within the scope of the group.
      • addMembers

        public void addMembers​(Guid[] guids)
                        throws UMSException
        Adds a list of members to the group. The change is saved to persistent storage.
        Specified by:
        addMembers in interface IAssignableMembership
        Parameters:
        guids - Array of member GUIDs to be added as members to the group.
        Throws:
        UMSException - if fail to save to persistent storage.
      • removeMember

        public void removeMember​(Guid guid)
                          throws UMSException
        Removes a member from the group. The change is saved to persistent storage.
        Specified by:
        removeMember in interface IAssignableMembership
        Parameters:
        guid - Unique identifier for the member to be removed.
        Throws:
        UMSException - if fail to save to persistent storage.
      • hasMember

        public boolean hasMember​(Guid guid)
                          throws UMSException
        Returns true if a given identifier is a member of the group.
        Specified by:
        hasMember in interface IMembership
        Overrides:
        hasMember in class DynamicGroup
        Parameters:
        guid - Identity of member to be checked for membership.
        Returns:
        true if it is a member.
        Throws:
        UMSException - if fail to read object for guid.