Class SimplePrincipal
- java.lang.Object
-
- org.wicketstuff.security.hive.authorization.SimplePrincipal
-
- All Implemented Interfaces:
Serializable,Principal
public class SimplePrincipal extends Object implements Principal
A very simple principal. It does not imply any subject on its own. This is only provided as a convenience to get started. Developers are likely to build there own principal and decorate it with jpa annotations to store / retrieve it from a database where they are coupled to users.- Author:
- marrink
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimplePrincipal(String name)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Compares this principal to the specified object.StringgetName()Returns the name of this principal.inthashCode()Returns a hashcode for this principal.booleanimplies(Subject subject)By default this principal does not imply any additional subjects.
-
-
-
Constructor Detail
-
SimplePrincipal
public SimplePrincipal(String name)
Constructor.- Parameters:
name- the name of this principal
-
-
Method Detail
-
getName
public final String getName()
Description copied from interface:PrincipalReturns the name of this principal.- Specified by:
getNamein interfacePrincipal- Returns:
- the name of this principal.
- See Also:
Principal.getName()
-
implies
public boolean implies(Subject subject)
By default this principal does not imply any additional subjects.- Specified by:
impliesin interfacePrincipal- Parameters:
subject- a subject or null if no user has logged in yet- Returns:
- true if the subject in any way implies this principal, false otherwise.
- See Also:
Principal.implies(org.wicketstuff.security.hive.authentication.Subject)
-
hashCode
public int hashCode()
Description copied from interface:PrincipalReturns a hashcode for this principal.- Specified by:
hashCodein interfacePrincipal- Overrides:
hashCodein classObject- Returns:
- a hashcode for this principal.
- See Also:
Object.hashCode()
-
equals
public boolean equals(Object obj)
Description copied from interface:PrincipalCompares this principal to the specified object. Returns true if the object passed in matches the principal represented by the implementation of this interface.- Specified by:
equalsin interfacePrincipal- Overrides:
equalsin classObject- Parameters:
obj- principal to compare with.- Returns:
- true if the principal passed in is the same as this principal, false otherwise.
- See Also:
Object.equals(java.lang.Object)
-
-