Package org.ldaptive.jaas
Class LdapRole
- java.lang.Object
-
- org.ldaptive.jaas.LdapRole
-
- All Implemented Interfaces:
Comparable<Principal>,Principal
public class LdapRole extends Object implements Principal, Comparable<Principal>
Provides a custom implementation for adding LDAP principals to a subject that represent roles.
-
-
Field Summary
Fields Modifier and Type Field Description private static intHASH_CODE_SEEDhash code seed.private StringroleNameLDAP role name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Principal p)booleanequals(Object o)StringgetName()inthashCode()static Set<LdapRole>toRoles(Collection<LdapAttribute> attributes)Iterates over the supplied attributes and returns all values as a set of ldap roles.static Set<LdapRole>toRoles(LdapEntry entry)Iterates over the supplied entry and returns all attributes as a set of ldap roles.static Set<LdapRole>toRoles(SearchResponse result)Iterates over the supplied result and returns all attributes as a set of ldap roles.StringtoString()
-
-
-
Field Detail
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
roleName
private final String roleName
LDAP role name.
-
-
Constructor Detail
-
LdapRole
public LdapRole(String name)
Creates a new ldap role with the supplied name.- Parameters:
name- of this role
-
-
Method Detail
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
toString
public String toString()
-
compareTo
public int compareTo(Principal p)
- Specified by:
compareToin interfaceComparable<Principal>
-
toRoles
public static 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 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 Set<LdapRole> toRoles(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
-
-