IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.security.plugins.builtins
Class WSSubjectSourceImpl

java.lang.Object
  extended by com.ibm.websphere.objectgrid.security.plugins.builtins.WSSubjectSourceImpl
All Implemented Interfaces:
SubjectSource

public class WSSubjectSourceImpl
extends Object
implements SubjectSource

This class is a implementation of the 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.

Since:
WAS XD 6.0
See Also:
SubjectSource

Field Summary
static int CALLER_SUBJECT
          A constant representing the caller Subject type
static int RUN_AS_SUBJECT
          A constant representing the runAs Subject type
 
Constructor Summary
WSSubjectSourceImpl()
          Creates a new WSSubjectSourceImpl with the RunAs Subject type
WSSubjectSourceImpl(int type)
          Creates a new WSSubjectSourceImpl with the specified Subject type
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RUN_AS_SUBJECT

public static final int RUN_AS_SUBJECT
A constant representing the runAs Subject type

See Also:
Constant Field Values

CALLER_SUBJECT

public static final int CALLER_SUBJECT
A constant representing the caller Subject type

See Also:
Constant Field Values
Constructor Detail

WSSubjectSourceImpl

public WSSubjectSourceImpl()
Creates a new WSSubjectSourceImpl with the RunAs Subject type


WSSubjectSourceImpl

public WSSubjectSourceImpl(int type)
Creates a new WSSubjectSourceImpl with the specified Subject type

Parameters:
type - the Subject type
Throws:
IllegalArgumentException - if the specified type is invalid
Method Detail

getType

public int getType()
Gets the subject type

Returns:
the argument that was passed to the constructor or the setType(int) method, or the default value of RUN_AS_SUBJECT if the default constructor is used
See Also:
RUN_AS_SUBJECT, setType(int)

setType

public void setType(int type)
Sets the subject type, either RUN_AS_SUBJECT or CALLER_SUBJECT

Parameters:
type - the subject type
Throws:
IllegalArgumentException - if the specified type is invalid

getSubject

public Subject getSubject()
                   throws ObjectGridSecurityException
Converts a passed-in Subject to a new Subject object.

Specified by:
getSubject in interface SubjectSource
Returns:
the converted subject
Throws:
ObjectGridSecurityException - if an error occurs during processing
See Also:
SubjectSource.getSubject()

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.