org.ldaptive.jaas
Class LdapRole

java.lang.Object
  extended by 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.

Version:
$Revision: 3189 $ $Date: 2016-11-01 17:21:43 -0400 (Tue, 01 Nov 2016) $
Author:
Middleware Services
See Also:
Serialized Form

Constructor Summary
LdapRole(String name)
          Creates a new ldap role with the supplied name.
 
Method Summary
 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(SearchResult result)
          Iterates over the supplied result and returns all attributes as a set of ldap roles.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LdapRole

public LdapRole(String name)
Creates a new ldap role with the supplied name.

Parameters:
name - of this role
Method Detail

getName

public String getName()

Specified by:
getName in interface Principal

equals

public boolean equals(Object o)

Specified by:
equals in interface Principal
Overrides:
equals in class Object

hashCode

public int hashCode()

Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object

toString

public String toString()

Specified by:
toString in interface Principal
Overrides:
toString in class Object

compareTo

public int compareTo(Principal p)

Specified by:
compareTo in interface Comparable<Principal>

toRoles

public static Set<LdapRole> toRoles(SearchResult 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


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.