Class LdapRole

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<java.security.Principal>, java.security.Principal

    public class LdapRole
    extends java.lang.Object
    implements java.security.Principal, java.io.Serializable, java.lang.Comparable<java.security.Principal>
    Provides a custom implementation for adding LDAP principals to a subject that represent roles.
    Author:
    Middleware Services
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      LdapRole​(java.lang.String name)
      Creates a new ldap role with the supplied name.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(java.security.Principal p)  
      boolean equals​(java.lang.Object o)  
      java.lang.String getName()  
      int hashCode()  
      static java.util.Set<LdapRole> toRoles​(java.util.Collection<LdapAttribute> attributes)
      Iterates over the supplied attributes and returns all values as a set of ldap roles.
      static java.util.Set<LdapRole> toRoles​(LdapEntry entry)
      Iterates over the supplied entry and returns all attributes as a set of ldap roles.
      static java.util.Set<LdapRole> toRoles​(SearchResponse result)
      Iterates over the supplied result and returns all attributes as a set of ldap roles.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.security.Principal

        implies
    • Constructor Detail

      • LdapRole

        public LdapRole​(java.lang.String name)
        Creates a new ldap role with the supplied name.
        Parameters:
        name - of this role
    • Method Detail

      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface java.security.Principal
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.security.Principal
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.security.Principal
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.security.Principal
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(java.security.Principal p)
        Specified by:
        compareTo in interface java.lang.Comparable<java.security.Principal>
      • toRoles

        public static java.util.Set<LdapRole> toRoles​(SearchResponse result)
        Iterates over the supplied result and returns all attributes as a set of ldap roles.
        Parameters:
        result - to read
        Returns:
        ldap roles
      • toRoles

        public static java.util.Set<LdapRole> toRoles​(LdapEntry entry)
        Iterates over the supplied entry and returns all attributes as a set of ldap roles.
        Parameters:
        entry - to read
        Returns:
        ldap roles
      • toRoles

        public static java.util.Set<LdapRole> toRoles​(java.util.Collection<LdapAttribute> attributes)
        Iterates over the supplied attributes and returns all values as a set of ldap roles.
        Parameters:
        attributes - to read
        Returns:
        ldap roles