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 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()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfacejava.security.Principal
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in interfacejava.security.Principal
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.security.Principal
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfacejava.security.Principal
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(java.security.Principal p)
- Specified by:
compareTo
in 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
-
-