Class GrouperContext

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

public class GrouperContext extends 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 Details

    • totalQueryCount

      public static long totalQueryCount
      for 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

      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
    • internal_retrieveCurrentInnerContext

      public static GrouperContext internal_retrieveCurrentInnerContext()
      internal use only, current inner context
      Returns:
      current inner context
    • internal_assignCurrentInnerContext

      public static void internal_assignCurrentInnerContext(GrouperContext newCurrentInnerContext)
      internal use only, set current inner context
      Parameters:
      newCurrentInnerContext - current inner context
    • internal_retrieveCurrentOuterContext

      public static GrouperContext internal_retrieveCurrentOuterContext()
      internal use only, current outer context
      Returns:
      current outer context
    • internal_assignCurrentOuterContext

      public static void internal_assignCurrentOuterContext(GrouperContext newCurrentOuterContext)
      internal use only, set current outer context
      Parameters:
      newCurrentOuterContext - current outer context
    • internal_retrieveDefaultContext

      public static GrouperContext internal_retrieveDefaultContext()
      internal use only, default context
      Returns:
      default context
    • internal_assignDefaultContext

      public static void internal_assignDefaultContext(GrouperContext newDefaultContext)
      internal use only, set default context
      Parameters:
      newDefaultContext - default context
    • retrieveContextId

      public static 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
    • incrementQueryCount

      public static void incrementQueryCount(int queries)
      tell the context another query occurred
    • getContextId

      public String getContextId()
      context id
      Returns:
      context id
    • getCallerIpAddress

      public String getCallerIpAddress()
      ip address of caller, or of gsh host
      Returns:
      the ip address
    • setCallerIpAddress

      public void setCallerIpAddress(String callerIpAddress1)
      ip address of caller, or of gsh host
      Parameters:
      callerIpAddress1 -
    • getLoggedInMemberId

      public String getLoggedInMemberId()
      member id of the logged in user
      Returns:
      member id
    • setLoggedInMemberId

      public void setLoggedInMemberId(String loggedInMemberId1)
      member id of the logged in user
      Parameters:
      loggedInMemberId1 -
    • getLoggedInMemberIdActAs

      public String getLoggedInMemberIdActAs()
      member id that the logged in user is acting as
      Returns:
      member id
    • setLoggedInMemberIdActAs

      public void setLoggedInMemberIdActAs(String loggedInMemberIdActAs1)
      member id that the logged in user is acting as
      Parameters:
      loggedInMemberIdActAs1 -