Class FilteredRole

    • Field Detail

      • FILTER_ATTR_NAME

        public static final String FILTER_ATTR_NAME
        Name of the filter attribute, which controls membership.
        See Also:
        Constant Field Values
      • FILTEREDROLE_OBJECTCLASSES

        public static final String[] FILTEREDROLE_OBJECTCLASSES
        LDAP object classes that define the nsFilteredRoleDefinition, the iPlanet Directory Server object class that maps to FilteredRole.
      • FILTEREDROLE_ATTRIBUTES

        public static final String[] FILTEREDROLE_ATTRIBUTES
        The attributes that are required for FilteredRole. Any creation template for FilteredRole should have these attributes.
    • Constructor Detail

      • FilteredRole

        public FilteredRole()
        No argument constructor
      • FilteredRole

        public FilteredRole​(String name,
                            String filter)
                     throws UMSException
        Constructs a FilteredRole object in-memory using the default template registered for FilteredRole. The save method must be called to save the new object to persistent storage.
        Parameters:
        name - name for the role
        filter - the filter that controls membership
        Throws:
        UMSException - on failure to instantiate
      • FilteredRole

        public FilteredRole​(CreationTemplate template,
                            AttrSet attrSet)
                     throws UMSException
        Constructs a FilteredRole object in memory with a given template. The save method must be called to save the new object to persistent storage.
        Parameters:
        template - Template for creating a group
        attrSet - Attribute/value set
        Throws:
        UMSException - on failure to instantiate
    • Method Detail

      • setFilter

        public void setFilter​(String filter)
                       throws UMSException
        Sets the filter that controls the membership.
        Specified by:
        setFilter in interface IFilteredMembership
        Parameters:
        filter - the filter that controls the membership
        Throws:
        UMSException - if there is any error while setting the filter
      • getMembers

        protected SearchResults getMembers​(String[] attributes)
                                    throws UMSException
        TO DO : incomplete, fix the logic of building the base and filter Gets the members of the role
        Parameters:
        attributes - Attributes to return
        Returns:
        SearchResults for iterating through the unique identifiers of members of the role
        Throws:
        UMSException - on failure to search
      • getMembers

        protected SearchResults getMembers​(String[] attributes,
                                           String filter)
                                    throws InvalidSearchFilterException,
                                           UMSException
        TO DO : incomplete, fix the logic of building the base and filter Gets the members of the role
        Parameters:
        attributes - Attributes to return
        filter - an LDAP filter to select a subset of members
        Returns:
        SearchResults for iterating through the unique identifiers of members of the role
        Throws:
        InvalidSearchFilterException - on invalid search filter
        UMSException - on failure to search
      • getMemberIDs

        public SearchResults getMemberIDs​(String filter)
                                   throws UMSException
        Gets the members of the role meeting an LDAP filter condition.
        Parameters:
        filter - an LDAP filter to select a subset of members
        Returns:
        SearchResults for iterating through the unique identifiers of members of the role
        Throws:
        UMSException - on failure to search
      • getMemberIDAt

        public Guid getMemberIDAt​(int index)
                           throws UMSException
        Gets 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 - on failure to search
      • hasMember

        public boolean hasMember​(Guid guid)
                          throws UMSException
        Checks if a given identifier is a member of the role.
        Specified by:
        hasMember in interface IMembership
        Parameters:
        guid - guid of the member to be checked for membership
        Returns:
        true if it is a member
        Throws:
        UMSException - on failure to read object for guid