Class GrouperContext
java.lang.Object
edu.internet2.middleware.grouper.hibernate.GrouperContext
holds threadlocal information about the current context of the database transactions. The inner context is for operations like addGroup. The outer context is for e.g. web requests like UI or WS
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
assignAuditEntryFields
(AuditEntry auditEntry) assign fields in audit entrystatic void
assignAuditEntryFieldsOuter
(AuditEntry auditEntry) assign fields in audit entry from outer audit (note, this might not exist)static boolean
see if there is an inner contextstatic GrouperContext
createNewDefaultContext
(GrouperEngineIdentifier grouperEngineIdentifier, boolean exceptionIfDefaultAlreadyExists, boolean useServerIpAddressAsUserIpAddress) static void
drop the current default contextip address of caller, or of gsh hostcontext idmember id of the logged in usermember id that the logged in user is acting asstatic void
tell the context another query occurredstatic void
incrementQueryCount
(int queries) tell the context another query occurredstatic void
internal_assignCurrentInnerContext
(GrouperContext newCurrentInnerContext) internal use only, set current inner contextstatic void
internal_assignCurrentOuterContext
(GrouperContext newCurrentOuterContext) internal use only, set current outer contextstatic void
internal_assignDefaultContext
(GrouperContext newDefaultContext) internal use only, set default contextstatic GrouperContext
internal use only, current inner contextstatic GrouperContext
internal use only, current outer contextstatic GrouperContext
internal use only, default contextstatic String
retrieveContextId
(boolean requireContext) retrieve current context idstatic GrouperContext
void
setCallerIpAddress
(String callerIpAddress1) ip address of caller, or of gsh hostvoid
setLoggedInMemberId
(String loggedInMemberId1) member id of the logged in uservoid
setLoggedInMemberIdActAs
(String loggedInMemberIdActAs1) member id that the logged in user is acting as
-
Field Details
-
totalQueryCount
public static long totalQueryCountfor testing, see how many queries
-
-
Constructor Details
-
GrouperContext
public GrouperContext()
-
-
Method Details
-
contextExistsInner
public static boolean contextExistsInner()see if there is an inner context- Returns:
- true if inner context
-
assignAuditEntryFieldsOuter
assign fields in audit entry from outer audit (note, this might not exist)- Parameters:
auditEntry
-
-
getGrouperEngine
- Returns:
- the grouper enginge
-
assignAuditEntryFields
assign fields in audit entry- Parameters:
auditEntry
-
-
retrieveDefaultContext
- Returns:
- the default context
-
internal_retrieveCurrentInnerContext
internal use only, current inner context- Returns:
- current inner context
-
internal_assignCurrentInnerContext
internal use only, set current inner context- Parameters:
newCurrentInnerContext
- current inner context
-
internal_retrieveCurrentOuterContext
internal use only, current outer context- Returns:
- current outer context
-
internal_assignCurrentOuterContext
internal use only, set current outer context- Parameters:
newCurrentOuterContext
- current outer context
-
internal_retrieveDefaultContext
internal use only, default context- Returns:
- default context
-
internal_assignDefaultContext
internal use only, set default context- Parameters:
newDefaultContext
- default context
-
retrieveContextId
retrieve current context id- Parameters:
requireContext
- true to require context (if required in grouper.properties)- Returns:
- context id
-
deleteDefaultContext
public static void deleteDefaultContext()drop the current default context -
createNewDefaultContext
public static GrouperContext createNewDefaultContext(GrouperEngineIdentifier grouperEngineIdentifier, boolean exceptionIfDefaultAlreadyExists, boolean useServerIpAddressAsUserIpAddress) - Parameters:
exceptionIfDefaultAlreadyExists
-grouperEngineIdentifier
-useServerIpAddressAsUserIpAddress
- if the users use this server, use that for user ip address- Returns:
- the context
-
incrementQueryCount
public static void incrementQueryCount()tell the context another query occurred -
incrementQueryCount
public static void incrementQueryCount(int queries) tell the context another query occurred -
getContextId
context id- Returns:
- context id
-
getCallerIpAddress
ip address of caller, or of gsh host- Returns:
- the ip address
-
setCallerIpAddress
ip address of caller, or of gsh host- Parameters:
callerIpAddress1
-
-
getLoggedInMemberId
member id of the logged in user- Returns:
- member id
-
setLoggedInMemberId
member id of the logged in user- Parameters:
loggedInMemberId1
-
-
getLoggedInMemberIdActAs
member id that the logged in user is acting as- Returns:
- member id
-
setLoggedInMemberIdActAs
member id that the logged in user is acting as- Parameters:
loggedInMemberIdActAs1
-
-