Class BaseSubject
- java.lang.Object
-
- org.wicketstuff.security.hive.authentication.BaseSubject
-
- All Implemented Interfaces:
Serializable,Subject
public class BaseSubject extends Object implements Subject
Default implementation of a Subject. Usable by both wicket applications and other type of applications like soap.- Author:
- marrink
- See Also:
Subject, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BaseSubject()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddPrincipal(Principal principal)Adds a new principal to this subject.Set<Principal>getPrincipals()A readonly view of the principals.booleanisReadOnly()When set it is no longer possible to change the set of principals of this subject.voidsetReadOnly()Mark this subject as readonly.
-
-
-
Method Detail
-
getPrincipals
public final Set<Principal> getPrincipals()
Description copied from interface:SubjectA readonly view of the principals.- Specified by:
getPrincipalsin interfaceSubject- Returns:
- the principals
- See Also:
Subject.getPrincipals()
-
isReadOnly
public final boolean isReadOnly()
Description copied from interface:SubjectWhen set it is no longer possible to change the set of principals of this subject.- Specified by:
isReadOnlyin interfaceSubject- Returns:
- true if this Subject is readonly, false otherwise
- See Also:
Subject.isReadOnly()
-
setReadOnly
public final void setReadOnly()
Description copied from interface:SubjectMark this subject as readonly. preventing principals to be added or removed. Note this method is always called on a subject after it has been handed over to the security layer.- Specified by:
setReadOnlyin interfaceSubject- See Also:
Subject.setReadOnly()
-
addPrincipal
public final boolean addPrincipal(Principal principal)
Adds a new principal to this subject.- Parameters:
principal-- Returns:
- true if the principal was added, false if it wasn't for instance because the subject is readonly.
-
-