Package org.ldaptive.jaas
Class LdapRole
- java.lang.Object
-
- org.ldaptive.jaas.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 intcompareTo(java.security.Principal p)booleanequals(java.lang.Object o)java.lang.StringgetName()inthashCode()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.StringtoString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfacejava.security.Principal
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin interfacejava.security.Principal- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.security.Principal- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfacejava.security.Principal- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(java.security.Principal p)
- Specified by:
compareToin interfacejava.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
-
-