Package org.ldaptive.jaas
Class LdapRole
- java.lang.Object
-
- org.ldaptive.jaas.LdapRole
-
- All Implemented Interfaces:
Serializable
,Comparable<Principal>
,Principal
public class LdapRole extends Object implements Principal, Serializable, Comparable<Principal>
Provides a custom implementation for adding LDAP principals to a subject that represent roles.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static int
HASH_CODE_SEED
hash code seed.private String
roleName
LDAP role name.private static long
serialVersionUID
serial version uid.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Principal p)
boolean
equals(Object o)
String
getName()
int
hashCode()
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.String
toString()
-
-
-
Field Detail
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
serialVersionUID
private static final long serialVersionUID
serial version uid.- 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:
compareTo
in 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
-
-