Class RealmNestedPrincipal
- java.lang.Object
-
- org.wildfly.security.auth.principal.RealmNestedPrincipal
-
- All Implemented Interfaces:
Serializable
,Principal
public final class RealmNestedPrincipal extends Object implements Principal, Serializable
A principal type which is used to find a specific identity in a specific realm. This principal can be used to locate an exact identity whose name may have changed or may be unknown, but which can be located another way (for example, by primary key).- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Principal
p
private String
r
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description RealmNestedPrincipal(String realmName, Principal nestedPrincipal)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Determine whether this principal is equal to the given object.boolean
equals(RealmNestedPrincipal obj)
Determine whether this principal is equal to the given object.String
getName()
Returns the name of this principal, which is composed of the realm name and the name of the nested principal.Principal
getNestedPrincipal()
Get the nested principal.<P extends Principal>
PgetNestedPrincipal(Class<P> principalClass)
Get the nested principal if it is of the given type class.String
getRealmName()
Get the realm name.int
hashCode()
Get the hash code of this principal.private void
readObject(ObjectInputStream ois)
String
toString()
Get this principal as a string.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
r
private final String r
-
p
private final Principal p
-
-
Method Detail
-
getRealmName
public String getRealmName()
Get the realm name.- Returns:
- the realm name (not
null
)
-
getNestedPrincipal
public Principal getNestedPrincipal()
Get the nested principal.- Returns:
- the nested principal (not
null
)
-
getNestedPrincipal
public <P extends Principal> P getNestedPrincipal(Class<P> principalClass)
Get the nested principal if it is of the given type class.- Returns:
- the nested principal, or
null
if the nested principal is not of the given type
-
getName
public String getName()
Returns the name of this principal, which is composed of the realm name and the name of the nested principal.
-
hashCode
public int hashCode()
Get the hash code of this principal.
-
equals
public boolean equals(Object obj)
Determine whether this principal is equal to the given object.
-
equals
public boolean equals(RealmNestedPrincipal obj)
Determine whether this principal is equal to the given object.- Parameters:
obj
- the object- Returns:
true
if they are equal,false
otherwise
-
toString
public String toString()
Get this principal as a string.
-
readObject
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
-