Class DSAMERole

  • All Implemented Interfaces:
    Subject, Cloneable

    public class DSAMERole
    extends Object
    implements Subject
    DSAME Role plugin lets policy admins specify the DSAME roles as a subject. The plugin validates a user belonging to a DSAME role specified with this plugin.
    • Constructor Detail

      • DSAMERole

        public DSAMERole()
    • Method Detail

      • initialize

        public void initialize​(Map configParams)
                        throws PolicyException
        This method initializes the DSAME Role plugin with the organization DN, search configuration, ldap server name, in which this plugin is specified for a Policy.
        Specified by:
        initialize in interface Subject
        Parameters:
        configParams - configuration parameters as a map. The values in the map is java.util.Set, which contains one or more configuration paramaters.
        Throws:
        PolicyException - if an error occured during initialization of Subject instance
      • getValueSyntax

        public Syntax getValueSyntax​(SSOToken token)
                              throws SSOException
        Returns the syntax of the values this Subject implementation can have.
        Specified by:
        getValueSyntax in interface Subject
        Parameters:
        token - the SSOToken that will be used to determine the syntax
        Returns:
        set of of valid names for the user collection.
        Throws:
        SSOException - if SSO token is not valid
        PolicyException - if unable to get the list of valid names.
        See Also:
        Syntax
      • getValidValues

        public ValidValues getValidValues​(SSOToken token,
                                          String pattern)
                                   throws SSOException,
                                          PolicyException
        Returns a list of possible values for the Subject that matches the pattern.
        Specified by:
        getValidValues in interface Subject
        Parameters:
        token - the SSOToken that will be used to determine the possible values
        pattern - search pattern that will be used to narrow the list of valid names.
        Returns:
        ValidValues object
        Throws:
        SSOException - if SSO token is not valid
        PolicyException - if unable to get the list of valid names.
      • getDisplayNameForValue

        public String getDisplayNameForValue​(String value,
                                             Locale locale)
                                      throws NameNotFoundException
        Returns the display name for the value for the given locale. For all the valid values obtained through the methods getValidValues this method must be called by GUI and CLI to get the corresponding display name. The locale variable could be used by the plugin to customize the display name for the given locale. The locale variable could be null, in which case the plugin must use the default locale (most probabily en_US). Alternatively, if the plugin does not have to localize the value, it can just return the value as is.
        Specified by:
        getDisplayNameForValue in interface Subject
        Parameters:
        value - one of the valid value for the plugin
        locale - locale for which the display name must be customized
        Returns:
        the display name for the value for the given locale.
        Throws:
        NameNotFoundException - if the given value is not one of the valid values for the plugin
      • getValues

        public Set getValues()
        Returns the values that was set using the method setValues.
        Specified by:
        getValues in interface Subject
        Returns:
        values that have been set for the user collection
      • setValues

        public void setValues​(Set names)
                       throws InvalidNameException
        Sets the names for the instance of the Subject object. The names are obtained from the policy object, usually configured when a policy is created.
        Specified by:
        setValues in interface Subject
        Parameters:
        names - names selected for the instance of the user collection object.
        Throws:
        InvalidNameException - if the given names are not valid
      • isMember

        public boolean isMember​(SSOToken token)
                         throws SSOException,
                                PolicyException
        Determines if the user belongs to this instance of the Subject object.
        Specified by:
        isMember in interface Subject
        Parameters:
        token - single-sign-on token of the user
        Returns:
        true if the user is memeber of the given subject; false otherwise.
        Throws:
        SSOException - if SSO token is not valid
        PolicyException - if an error occured while checking if the user is a member of this subject
      • hashCode

        public int hashCode()
        Return a hash code for this DSAMERole.
        Overrides:
        hashCode in class Object
        Returns:
        a hash code for this DSAMERole object.
      • equals

        public boolean equals​(Object o)
        Indicates whether some other object is "equal to" this one.
        Overrides:
        equals in class Object
        Parameters:
        o - another object that will be compared with this one
        Returns:
        true if eqaul; false otherwise
      • clone

        public Object clone()
        Creates and returns a copy of this object.
        Specified by:
        clone in interface Subject
        Overrides:
        clone in class Object
        Returns:
        a copy of this object