public class WSSubjectSourceImpl extends Object implements SubjectSource
SubjectSource plugin
interface for use when an ObjectGrid is accessed in a WebSphere
Application Server.
This implementation gets either a runAs Subject or a caller Subject
from WebSphere Application Server thread. Users can use the
setType(int) method to indicate what type of Subject will be
retrieved. If RUN_AS_SUBJECT is used, the runAs Subject will be
returned; if CALLER_SUBJECT is used, the caller Subject will be
returned.
SubjectSource| Modifier and Type | Field and Description |
|---|---|
static int |
CALLER_SUBJECT
A constant representing the caller Subject type
|
static int |
RUN_AS_SUBJECT
A constant representing the runAs Subject type
|
| Constructor and Description |
|---|
WSSubjectSourceImpl()
Creates a new WSSubjectSourceImpl with the RunAs Subject type
|
WSSubjectSourceImpl(int type)
Creates a new WSSubjectSourceImpl with the specified Subject type
|
| Modifier and Type | Method and Description |
|---|---|
Subject |
getSubject()
Converts a passed-in Subject to a new Subject object.
|
int |
getType()
Gets the subject type
|
void |
setType(int type)
Sets the subject type, either
RUN_AS_SUBJECT or
CALLER_SUBJECT |
public static final int RUN_AS_SUBJECT
public static final int CALLER_SUBJECT
public WSSubjectSourceImpl()
public WSSubjectSourceImpl(int type)
type - the Subject typeIllegalArgumentException - if the specified type is invalidpublic int getType()
setType(int) method, or the default value of
RUN_AS_SUBJECT if the default constructor is usedRUN_AS_SUBJECT,
setType(int)public void setType(int type)
RUN_AS_SUBJECT or
CALLER_SUBJECTtype - the subject typeIllegalArgumentException - if the specified type is invalidpublic Subject getSubject() throws ObjectGridSecurityException
getSubject in interface SubjectSourceObjectGridSecurityException - if an error occurs during processingSubjectSource.getSubject()