|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.internet2.middleware.grouper.hooks.beans.HooksContext
public class HooksContext
context in which hooks are running
| Field Summary | |
|---|---|
static java.lang.String |
HOOKS_KEY_SUBJECT_ACT_AS
hooks internal attribute key for grouper session |
static java.lang.String |
HOOKS_KEY_SUBJECT_LOGGED_IN
hooks internal attribute key for grouper session |
static java.lang.String |
KEY_HTTP_SERVLET_REQUEST
if application, key in context for request |
static java.lang.String |
KEY_HTTP_SERVLET_RESPONSE
if application, key in context for response |
static java.lang.String |
KEY_HTTP_SESSION
if application, key in context for session |
| Constructor Summary | |
|---|---|
HooksContext()
constructor |
|
HooksContext(boolean theAsynchronous,
java.util.Map<java.lang.String,java.lang.Object> threadSafeAttributes,
edu.internet2.middleware.subject.Subject theAsynchronousGrouperSessionSubject,
java.lang.String theAynchronousHookId)
constructor |
|
| Method Summary | |
|---|---|
edu.internet2.middleware.subject.Subject |
_internal_getAsynchronousGrouperSessionSubject()
keep track of grouper session subject if needed |
boolean |
_internal_isAsynchronousGrouperSessionStarted()
if we started one, we should stop it |
java.util.Map<java.lang.String,java.lang.Object> |
_internal_threadSafeAttributes()
look at all threadlocal attributes, and extract the names and values of the threadsafe ones. |
static void |
assignSubjectActAs(edu.internet2.middleware.subject.Subject subject)
this will be a threadsafe attribute |
static void |
assignSubjectLoggedIn(edu.internet2.middleware.subject.Subject subject)
this will be a threadsafe attribute |
java.util.Set<java.lang.String> |
attributeKeySet()
keys of attributes (all put together, global, threadlocal, local |
static void |
clearThreadLocal()
clear out the threadlocal attributes at a point when everything should be clear |
edu.internet2.middleware.subject.Subject |
getAsynchronousGrouperSessionSubject()
if this is an asynchronous hook, the grouper session subject is passed from the other thread to this thread, this is that subject. |
java.lang.Object |
getAttribute(java.lang.String key)
get an attribute |
GrouperContextType |
getGrouperContextType()
get the context in which the hooks are running, e.g. |
java.lang.String |
getHookId()
keep a unique id to keep the logs straight |
edu.internet2.middleware.subject.Subject |
getSubjectActAs()
current acting subject in app (if applicable), or just the current subject |
edu.internet2.middleware.subject.Subject |
getSubjectFromGrouperSession()
current user in the grouper session or null if none there |
edu.internet2.middleware.subject.Subject |
getSubjectLoggedIn()
current user logged in to app (e.g. |
GrouperSession |
grouperSession()
get the grouper session from the grouper session threadlocal |
boolean |
isAsynchronous()
if this context is asynchronous |
boolean |
isSubjectActAsInGroup(java.lang.String groupName)
see if the current act as subject is in a certain group. |
boolean |
isSubjectFromGrouperSessionInGroup(java.lang.String groupName)
see if the current subject in grouper session is in a certain group (e.g. for authorization) |
static void |
setAttributeThreadLocal(java.lang.String key,
java.lang.Object value,
boolean okToCopyToNewThread)
set a threadlocal attribute |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String HOOKS_KEY_SUBJECT_LOGGED_IN
public static final java.lang.String HOOKS_KEY_SUBJECT_ACT_AS
public static final java.lang.String KEY_HTTP_SERVLET_RESPONSE
public static final java.lang.String KEY_HTTP_SESSION
public static final java.lang.String KEY_HTTP_SERVLET_REQUEST
| Constructor Detail |
|---|
public HooksContext()
public HooksContext(boolean theAsynchronous,
java.util.Map<java.lang.String,java.lang.Object> threadSafeAttributes,
edu.internet2.middleware.subject.Subject theAsynchronousGrouperSessionSubject,
java.lang.String theAynchronousHookId)
theAsynchronous - true if this is in a new thread, false if notthreadSafeAttributes - attributes from another thread if applicabletheAsynchronousGrouperSessionSubject - if asynchronous, pass in who the grouper subject should betheAynchronousHookId - if we are asynchronous, pass in what the hook id should be| Method Detail |
|---|
public edu.internet2.middleware.subject.Subject getSubjectLoggedIn()
public edu.internet2.middleware.subject.Subject getSubjectFromGrouperSession()
public edu.internet2.middleware.subject.Subject getSubjectActAs()
public GrouperSession grouperSession()
public edu.internet2.middleware.subject.Subject getAsynchronousGrouperSessionSubject()
public static void assignSubjectLoggedIn(edu.internet2.middleware.subject.Subject subject)
subject - or null to clearpublic static void assignSubjectActAs(edu.internet2.middleware.subject.Subject subject)
subject - or null to clearpublic boolean isSubjectActAsInGroup(java.lang.String groupName)
groupName -
public boolean isSubjectFromGrouperSessionInGroup(java.lang.String groupName)
groupName - fully qualified group name to check
public java.util.Map<java.lang.String,java.lang.Object> _internal_threadSafeAttributes()
public GrouperContextType getGrouperContextType()
public static void setAttributeThreadLocal(java.lang.String key,
java.lang.Object value,
boolean okToCopyToNewThread)
key - value - okToCopyToNewThread - if this should be set for hooks spawned in new threadpublic static void clearThreadLocal()
public java.util.Set<java.lang.String> attributeKeySet()
public java.lang.Object getAttribute(java.lang.String key)
key -
public boolean isAsynchronous()
public edu.internet2.middleware.subject.Subject _internal_getAsynchronousGrouperSessionSubject()
public boolean _internal_isAsynchronousGrouperSessionStarted()
public java.lang.String getHookId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||