Class DynamicGroup

    • Constructor Detail

      • DynamicGroup

        protected DynamicGroup()
        Default constructor.
      • DynamicGroup

        public DynamicGroup​(CreationTemplate template,
                            AttrSet attrSet)
                     throws UMSException
        Constructs a DynamicGroup in memory with a given template for DynamicGroup. This is an in-memory representation of a new object; the save method must be called to save this new object to persistent storage.
        Parameters:
        template - Template for creating a group.
        attrSet - Attribute/value set, which should contain memberUrl.
        Throws:
        UMSException - if fail to instantiate from persistent storage.
      • DynamicGroup

        public DynamicGroup​(CreationTemplate template,
                            AttrSet attrSet,
                            Guid baseGuid,
                            String filter,
                            int scope)
                     throws UMSException
        Constructs a DynamicGroup in memory given a template for DynamicGroup. This is an in-memory representation of a new object and the save method must be called to save this new object to persistent storage.
        Parameters:
        template - Template for creating a group.
        attrSet - Attribute/value set, which should not contain member Url; any values of memberUrl will be overwritten by the explicit search criteria arguments.
        baseGuid - Search base for evaluating members of the group.
        filter - Search filter 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.
        Specified by:
        setSearchFilter in interface IDynamicMembership
        Parameters:
        filter - Search filter for evaluating members of the group.
      • getSearchFilter

        public String getSearchFilter()
        Returns the search filter used to evaluate this dynamic group.
        Specified by:
        getSearchFilter in interface IDynamicMembership
        Returns:
        Search filter for evaluating members of the group the scope in the filter has to be LDAPv2.SCOPE_ONE or LDAPv2.SCOPE_SUB.
      • setSearchBase

        public void setSearchBase​(Guid baseGuid)
        Sets the search base used to evaluate this dynamic group.
        Specified by:
        setSearchBase in interface IDynamicMembership
        Parameters:
        baseGuid - Search base for evaluating members of the group.
      • getSearchBase

        public Guid getSearchBase()
        Returns the search base used to evaluate this dynamic group.
        Specified by:
        getSearchBase in interface IDynamicMembership
        Returns:
        Search base for evaluating members of the group.
      • setSearchScope

        public void setSearchScope​(int scope)
        Sets the search scope used to evaluate this dynamic group.
        Specified by:
        setSearchScope in interface IDynamicMembership
        Parameters:
        scope - Search scope for evaluating members of the group. Use one of the search scope SCOPE_BASE, SCOPE_ONE, or SCOPE_SUB.
      • getSearchScope

        public int getSearchScope()
        Returns the search scope used to evaluate this dynamic group.
        Specified by:
        getSearchScope in interface IDynamicMembership
        Returns:
        Search scope for evaluating members of the group.
      • toUrlStr

        protected String toUrlStr​(String base,
                                  org.forgerock.opendj.ldap.Filter filter,
                                  org.forgerock.opendj.ldap.SearchScope scope)
        Convert the given parameters into an LDAP URL string. No LDAP host, port, and attribute to return are present in the LDAP URL. Only search base, filter and scope are given.
        Parameters:
        base - Search Base DN in the LDAP URL.
        filter - Search filter in LDAP URL.
        scope - Search scope in LDAP URL.
        Returns:
        LDAP URL.
      • setUrl

        protected void setUrl​(Guid baseGuid,
                              org.forgerock.opendj.ldap.Filter filter,
                              org.forgerock.opendj.ldap.SearchScope scope)
        Creates a new search definition; the change is not persistent until save() is called.
        Parameters:
        baseGuid - Search base for evaluating members of the group.
        filter - Search filter for evaluating members of the group.
        scope - Search scope for evaluating members of the group.
      • getUrl

        protected org.forgerock.opendj.ldap.LDAPUrl getUrl()
        Returns the native LDAP URL used to evaluate this dynamic group.
        Returns:
        LDAP URL for evaluating members of the group
      • setUrl

        protected void setUrl​(org.forgerock.opendj.ldap.LDAPUrl url)
        Sets the native LDAP URL used to evaluate this dynamic group.
        Parameters:
        url - LDAP URL for evaluating members of the group search scope in the url has to be LDAPv2.SCOPE_ONE or LDAPv2.SCOPE_SUB.
      • getMemberIDs

        protected SearchResults getMemberIDs​(String[] attributes)
                                      throws UMSException
        Returns the members of the group.
        Parameters:
        attributes - Attributes to return.
        Returns:
        Iterator for unique identifiers for members of the group.
        Throws:
        UMSException - if fail to search.
      • getMemberIDAt

        public Guid getMemberIDAt​(int index)
                           throws UMSException
        Returns a member given an index (zero-based).
        Specified by:
        getMemberIDAt in interface IMembership
        Parameters:
        index - Zero-based index into the group container.
        Returns:
        Unique identifier for a member.
        Throws:
        UMSException - if fail to search.
      • 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
        Parameters:
        guid - Identity of member to be checked for membership.
        Returns:
        true if it is a member.
        Throws:
        UMSException - if fail to evaluate group