|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.grouper.GrouperSession
public class GrouperSession
Context for interacting with the Grouper API and Groups Registry.
Constructor Summary | |
---|---|
GrouperSession()
Default constructor. |
Method Summary | |
---|---|
static java.lang.Object |
callbackGrouperSession(GrouperSession grouperSession,
GrouperSessionHandler grouperSessionHandler)
call this to send a callback for the grouper session object. cant use inverse of control for this since it runs it. |
static void |
clearGrouperSession()
clear the threadlocal grouper session (dont really need to call this, just stop the session, but this is here for testing) |
static void |
clearGrouperSessions()
clear the threadlocal grouper sessions (dont really need to call this, just stop the session, but this is here for testing) |
java.lang.String |
getAccessClass()
Get name of class implenting AccessAdapter privilege interface. |
AccessResolver |
getAccessResolver()
|
java.lang.String |
getAttributeDefClass()
Get name of class implenting AccessAdapter privilege interface. |
AttributeDefResolver |
getAttributeDefResolver()
|
Member |
getMember()
Get the Member associated with this API session. |
java.lang.String |
getMemberUuid()
|
java.lang.String |
getNamingClass()
Get name of class implenting NamingAdapter privilege interface. |
NamingResolver |
getNamingResolver()
|
java.lang.String |
getSessionId()
Get this session's id. |
java.util.Date |
getStartTime()
Get this session's start time. |
long |
getStartTimeLong()
|
edu.internet2.middleware.subject.Subject |
getSubject()
Get the Subject associated with this API session. |
edu.internet2.middleware.subject.Subject |
getSubjectDb()
Get the Subject associated with this API session. |
java.lang.String |
getUuid()
|
static java.lang.Object |
internal_callbackRootGrouperSession(GrouperSessionHandler grouperSessionHandler)
call this to send a callback for the root grouper session object. |
GrouperSession |
internal_getRootSession()
|
boolean |
isConsiderIfWheelMember()
if we should take into consideration that we are a wheel member (or act as self if false) |
void |
setConsiderIfWheelMember(boolean considerIfWheelMember1)
if we should take into consideration that we are a wheel member (or act as self if false) |
void |
setMemberUuid(java.lang.String memberUUID1)
|
void |
setStartTimeLong(long startTime1)
|
void |
setSubject(edu.internet2.middleware.subject.Subject subject1)
|
void |
setUuid(java.lang.String uuid1)
|
static GrouperSession |
start(edu.internet2.middleware.subject.Subject subject)
Start a session for interacting with the Grouper API. |
static GrouperSession |
start(edu.internet2.middleware.subject.Subject subject,
boolean addToThreadLocal)
Start a session for interacting with the Grouper API. |
static GrouperSession |
startBySubjectIdAndSource(java.lang.String subjectId,
java.lang.String sourceId)
start a session based on a sourceId and subjectId |
static GrouperSession |
startBySubjectIdAndSource(java.lang.String subjectId,
java.lang.String sourceId,
boolean addToThreadLocal)
start a session based on a sourceId and subjectId |
static GrouperSession |
startBySubjectIdentifierAndSource(java.lang.String subjectIdentifier,
java.lang.String sourceId)
start a session based on a sourceId and subjectId |
static GrouperSession |
startBySubjectIdentifierAndSource(java.lang.String subjectIdentifier,
java.lang.String sourceId,
boolean addToThreadLocal)
start a session based on a sourceId and subjectId |
static GrouperSessionResult |
startIfNotStarted(edu.internet2.middleware.subject.Subject subject)
Start a session for interacting with the Grouper API. |
static GrouperSession |
startRootSession()
Start a session for interacting with the Grouper API. |
static GrouperSession |
startRootSession(boolean addToThreadLocal)
Start a session for interacting with the Grouper API. |
static GrouperSessionResult |
startRootSessionIfNotStarted()
Start a root session for interacting with the Grouper API. |
static GrouperSession |
staticGrouperSession()
get the threadlocal grouper session. access this through inverse of control. |
static GrouperSession |
staticGrouperSession(boolean exceptionOnNull)
get the threadlocal grouper session. access this through inverse of control. |
void |
stop()
Stop this API session. |
static void |
stopQuietly(GrouperSession session)
stop a session quietly |
java.lang.String |
toString()
|
java.lang.String |
toStringDto()
|
void |
validate()
|
static void |
validate(GrouperSession s)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GrouperSession()
Method Detail |
---|
public boolean isConsiderIfWheelMember()
public void setConsiderIfWheelMember(boolean considerIfWheelMember1)
considerIfWheelMember1
- public static void stopQuietly(GrouperSession session)
session
- public static GrouperSession startBySubjectIdAndSource(java.lang.String subjectId, java.lang.String sourceId)
sourceId
- if null search all sourcessubjectId
-
public static GrouperSession startBySubjectIdAndSource(java.lang.String subjectId, java.lang.String sourceId, boolean addToThreadLocal)
sourceId
- if null search all sourcessubjectId
- addToThreadLocal
- true if it should be in threadlocal, false if not
public static GrouperSession startBySubjectIdentifierAndSource(java.lang.String subjectIdentifier, java.lang.String sourceId)
sourceId
- if null search all sourcessubjectIdentifier
-
public static GrouperSession startBySubjectIdentifierAndSource(java.lang.String subjectIdentifier, java.lang.String sourceId, boolean addToThreadLocal)
subjectIdentifier
- sourceId
- if null search all sourcesaddToThreadLocal
-
public static GrouperSession start(edu.internet2.middleware.subject.Subject subject) throws SessionException
// Start a Grouper API session. GrouperSession s = GrouperSession.subject);
subject
- Start session as this Subject
.
SessionException
public static GrouperSessionResult startIfNotStarted(edu.internet2.middleware.subject.Subject subject) throws SessionException
// Start a Grouper API session. GrouperSession s = GrouperSession.subject);
subject
- Start session as this Subject
.
SessionException
public static GrouperSession startRootSession(boolean addToThreadLocal) throws SessionException
// Start a Grouper API session. GrouperSession s = GrouperSession.start(subject);
addToThreadLocal
- true to add this to the grouper session
threadlocal which replaces the current one
SessionException
public static GrouperSession startRootSession() throws SessionException
// Start a Grouper API session. GrouperSession s = GrouperSession.start(subject);
SessionException
public static GrouperSession start(edu.internet2.middleware.subject.Subject subject, boolean addToThreadLocal) throws SessionException
// Start a Grouper API session. GrouperSession s = GrouperSession.start(subject);
subject
- Start session as this Subject
.addToThreadLocal
- true to add this to the grouper session
threadlocal which replaces the current one. Though if in the context of a callback,
the callback has precedence, and you should use an inner callback to preempt it (callbackGrouperSession)
SessionException
public static void validate(GrouperSession s) throws java.lang.IllegalStateException
s
-
java.lang.IllegalStateException
public java.lang.String getAccessClass()
AccessAdapter
privilege interface.
String klass = s.getAccessClass();
public java.lang.String getAttributeDefClass()
AccessAdapter
privilege interface.
String klass = s.getAccessClass();
public AccessResolver getAccessResolver()
AccessResolver
used by this session.public Member getMember() throws java.lang.IllegalStateException
Member
associated with this API session.
Member m = s.getMember();
As of 1.2.0, this method throws an IllegalStateException
instead of
a NullPointerException
when the member cannot be retrieved.
Member
object.
java.lang.IllegalStateException
- if Member
cannot be returned.public java.lang.String getNamingClass()
NamingAdapter
privilege interface.
String klass = s.getNamingClass();
public NamingResolver getNamingResolver()
NamingResolver
used by this session.public java.lang.String getSessionId()
String id = s.internal_getSessionId();
public java.util.Date getStartTime()
Date startTime = s.getStartTime();
public edu.internet2.middleware.subject.Subject getSubject() throws GrouperException
Subject
associated with this API session.
Subject subj = s.getSubject();
Subject
object.
GrouperException
public edu.internet2.middleware.subject.Subject getSubjectDb() throws GrouperException
Subject
associated with this API session.
Subject subj = s.getSubject();
Subject
object.
GrouperException
public void stop() throws SessionException
s.stop();
SessionException
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public void validate() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public GrouperSession internal_getRootSession() throws GrouperException
GrouperException
public java.lang.String getMemberUuid()
public long getStartTimeLong()
public java.lang.String getUuid()
public void setMemberUuid(java.lang.String memberUUID1)
memberUUID1
- public void setStartTimeLong(long startTime1)
startTime1
- public void setSubject(edu.internet2.middleware.subject.Subject subject1)
subject1
- public void setUuid(java.lang.String uuid1)
uuid1
- public java.lang.String toStringDto()
public AttributeDefResolver getAttributeDefResolver()
AttributeDefResolver
used by this session.public static GrouperSessionResult startRootSessionIfNotStarted() throws SessionException
SessionException
public static java.lang.Object callbackGrouperSession(GrouperSession grouperSession, GrouperSessionHandler grouperSessionHandler) throws GrouperSessionException
grouperSession
- is the session to do an inverse of control ongrouperSessionHandler
- will get the callback
GrouperSessionException
- if there is a problem, will preserve runtime exceptions so they are
thrown to the caller. The GrouperSessionException wraps the underlying exceptionpublic static java.lang.Object internal_callbackRootGrouperSession(GrouperSessionHandler grouperSessionHandler) throws GrouperSessionException
grouperSessionHandler
- will get the callback
GrouperSessionException
- if there is a problem, will preserve runtime exceptions so they are
thrown to the caller. The GrouperSessionException wraps the underlying exceptionpublic static GrouperSession staticGrouperSession()
public static void clearGrouperSession()
public static void clearGrouperSessions()
public static GrouperSession staticGrouperSession(boolean exceptionOnNull) throws java.lang.IllegalStateException
exceptionOnNull
- true if exception when there is none there
java.lang.IllegalStateException
- if no sessions available
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |