Class PrivilegeManager

    • Field Detail

      • debug

        public static final Debug debug
        Debug for Policy Administration Point classes
      • superAdminSubject

        public static final Subject superAdminSubject
    • Method Detail

      • getInstance

        public static PrivilegeManager getInstance​(String realm,
                                                   Subject subject)
        Returns instance of configured PrivilegeManager
        Parameters:
        subject - subject that would be used for the privilege management operations
        Returns:
        instance of configured PrivilegeManager
      • initialize

        public void initialize​(String realm,
                               Subject subject)
        Initializes the object.
        Parameters:
        realm - Realm name
        subject - subject to initilialize the privilege manager with
      • findByName

        public abstract Privilege findByName​(String name,
                                             Subject subject)
                                      throws EntitlementException
        Returns a privilege.
        Parameters:
        name - name for the privilege to be returned
        subject - Subject to be used to obtain the privilege.
        Throws:
        EntitlementException - if privilege is not found or if the provided subject is not permitted to access it.
      • modify

        public abstract void modify​(String existingName,
                                    Privilege privilege)
                             throws EntitlementException
        Modifies the specified policy.
        Parameters:
        existingName - The existing policy name
        privilege - The new policy content
        Throws:
        EntitlementException - When an error occurs during modification
      • searchNames

        public Set<String> searchNames​(Set<SearchFilter> filter,
                                       int searchSizeLimit,
                                       int searchTimeLimit)
                                throws EntitlementException
        Returns a set of privilege names for a given search criteria.
        Specified by:
        searchNames in interface IPrivilegeManager<Privilege>
        Parameters:
        filter - Set of search filter.
        searchSizeLimit - Search size limit.
        searchTimeLimit - Search time limit in seconds.
        Returns:
        a set of privilege names for a given search criteria.
        Throws:
        EntitlementException - if search failed.
      • search

        public List<Privilege> search​(Set<SearchFilter> filter,
                                      int searchSizeLimit,
                                      int searchTimeLimit)
                               throws EntitlementException
        Returns a set of privileges that match the given search criteria.
        Parameters:
        filter - the search filters to apply. An empty set means no filtering (returns all privileges).
        searchSizeLimit - the maximum number of privileges to return.
        searchTimeLimit - the maximum time limit in seconds. NOT IMPLEMENTED.
        Returns:
        the matching privileges.
        Throws:
        EntitlementException - if the search fails for any reason.
      • search

        public List<Privilege> search​(Set<SearchFilter> filter)
                               throws EntitlementException
        Returns a set of privileges that match the given search criteria with no size or time limits.
        Parameters:
        filter - the search filters to apply. An empty set means no filtering (returns all privileges).
        Returns:
        the matching privileges.
        Throws:
        EntitlementException - if the search fails for any reason.
      • findAllPoliciesByApplication

        public abstract List<Privilege> findAllPoliciesByApplication​(String application)
                                                              throws EntitlementException
        Finds all policies within the realm and passed application.
        Parameters:
        application - the application
        Returns:
        list of matching policies
        Throws:
        EntitlementException - should some error occur
      • findAllPoliciesByIdentityUid

        public abstract List<Privilege> findAllPoliciesByIdentityUid​(String uid)
                                                              throws EntitlementException
        Finds all policies based on the identity uid, whether user or group uid.
        Parameters:
        uid - identity uid
        Returns:
        list of matching policies else an empty list
        Throws:
        EntitlementException - should some query error occur
      • getRealm

        public String getRealm()
        Returns realm name.
        Returns:
        realm name.
      • getAdminSubject

        protected Subject getAdminSubject()
      • isNameValid

        public static boolean isNameValid​(String target)