Interface Subject
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BaseSubject
public interface Subject extends Serializable
Subject represents (part of) an authenticated entity, such as an individual, a corporation, or a login id. It can be decorated with certain rights (Principals). Most implementations will provide some means to add (and sometimes remove) principals, however all must honor the readonly flag.setReadOnly()is automatically triggered after a login. Subjects are created byLoginContexts as placeholder for the permissions of a user for the duration of the session.- Author:
- marrink
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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
Set<Principal> getPrincipals()
A readonly view of the principals.- Returns:
- the principals
-
isReadOnly
boolean isReadOnly()
When set it is no longer possible to change the set of principals of this subject.- Returns:
- true if this Subject is readonly, false otherwise
-
setReadOnly
void setReadOnly()
Mark 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.
-
-