edu.internet2.middleware.grouper.hibernate
Class GrouperContext

java.lang.Object
  extended by edu.internet2.middleware.grouper.hibernate.GrouperContext

public class GrouperContext
extends java.lang.Object

 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
static long totalQueryCount
          for testing, see how many queries
 
Constructor Summary
GrouperContext()
           
 
Method Summary
static void assignAuditEntryFields(AuditEntry auditEntry)
          assign fields in audit entry
static void assignAuditEntryFieldsOuter(AuditEntry auditEntry)
          assign fields in audit entry from outer audit (note, this might not exist)
static boolean contextExistsInner()
          see if there is an inner context
static GrouperContext createNewDefaultContext(GrouperEngineIdentifier grouperEngineIdentifier, boolean exceptionIfDefaultAlreadyExists, boolean useServerIpAddressAsUserIpAddress)
           
static void deleteDefaultContext()
          drop the current default context
 java.lang.String getCallerIpAddress()
          ip address of caller, or of gsh host
 java.lang.String getContextId()
          context id
 GrouperEngineBuiltin getGrouperEngine()
           
 java.lang.String getLoggedInMemberId()
          member id of the logged in user
 java.lang.String getLoggedInMemberIdActAs()
          member id that the logged in user is acting as
static void incrementQueryCount()
          tell the context another query occurred
static java.lang.String retrieveContextId(boolean requireContext)
          retrieve current context id
static GrouperContext retrieveDefaultContext()
           
 void setCallerIpAddress(java.lang.String callerIpAddress1)
          ip address of caller, or of gsh host
 void setLoggedInMemberId(java.lang.String loggedInMemberId1)
          member id of the logged in user
 void setLoggedInMemberIdActAs(java.lang.String loggedInMemberIdActAs1)
          member id that the logged in user is acting as
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

totalQueryCount

public static long totalQueryCount
for testing, see how many queries

Constructor Detail

GrouperContext

public GrouperContext()
Method Detail

contextExistsInner

public static boolean contextExistsInner()
see if there is an inner context

Returns:
true if inner context

assignAuditEntryFieldsOuter

public static void assignAuditEntryFieldsOuter(AuditEntry auditEntry)
assign fields in audit entry from outer audit (note, this might not exist)

Parameters:
auditEntry -

getGrouperEngine

public GrouperEngineBuiltin getGrouperEngine()
Returns:
the grouper enginge

assignAuditEntryFields

public static void assignAuditEntryFields(AuditEntry auditEntry)
assign fields in audit entry

Parameters:
auditEntry -

retrieveDefaultContext

public static GrouperContext retrieveDefaultContext()
Returns:
the default context

retrieveContextId

public static java.lang.String retrieveContextId(boolean requireContext)
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


getContextId

public java.lang.String getContextId()
context id

Returns:
context id

getCallerIpAddress

public java.lang.String getCallerIpAddress()
ip address of caller, or of gsh host

Returns:
the ip address

setCallerIpAddress

public void setCallerIpAddress(java.lang.String callerIpAddress1)
ip address of caller, or of gsh host

Parameters:
callerIpAddress1 -

getLoggedInMemberId

public java.lang.String getLoggedInMemberId()
member id of the logged in user

Returns:
member id

setLoggedInMemberId

public void setLoggedInMemberId(java.lang.String loggedInMemberId1)
member id of the logged in user

Parameters:
loggedInMemberId1 -

getLoggedInMemberIdActAs

public java.lang.String getLoggedInMemberIdActAs()
member id that the logged in user is acting as

Returns:
member id

setLoggedInMemberIdActAs

public void setLoggedInMemberIdActAs(java.lang.String loggedInMemberIdActAs1)
member id that the logged in user is acting as

Parameters:
loggedInMemberIdActAs1 -