edu.internet2.middleware.grouper.hooks.beans
Enum GrouperContextTypeBuiltIn

java.lang.Object
  extended by java.lang.Enum<GrouperContextTypeBuiltIn>
      extended by edu.internet2.middleware.grouper.hooks.beans.GrouperContextTypeBuiltIn
All Implemented Interfaces:
GrouperContextType, Serializable, Comparable<GrouperContextTypeBuiltIn>

public enum GrouperContextTypeBuiltIn
extends Enum<GrouperContextTypeBuiltIn>
implements GrouperContextType

type of context


Enum Constant Summary
ANT_TOOLS
          ant tools like schema-export etc
GROUPER_API
          normal API call
GROUPER_LOADER
          from grouper loader
GROUPER_UI
          from the UI
GROUPER_WS
          from the ws
GSH
          from grouper shell
UNKNOWN
          if the context type if not known
USDU
          from undeleted subject utility
 
Method Summary
static GrouperContextType _internal_getThreadLocalGrouperContextType()
           
static GrouperContextType currentGrouperContext()
          current grouper context.
static void setDefaultContext(GrouperContextType defaultContext)
          global default context (if not one set in thread local)
static void setThreadLocalContext(GrouperContextType grouperContextType)
           
static GrouperContextTypeBuiltIn valueOf(String name)
          Returns the enum constant of this type with the specified name.
static GrouperContextTypeBuiltIn[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.internet2.middleware.grouper.hooks.beans.GrouperContextType
name
 

Enum Constant Detail

GROUPER_API

public static final GrouperContextTypeBuiltIn GROUPER_API
normal API call


ANT_TOOLS

public static final GrouperContextTypeBuiltIn ANT_TOOLS
ant tools like schema-export etc


GROUPER_UI

public static final GrouperContextTypeBuiltIn GROUPER_UI
from the UI


GROUPER_WS

public static final GrouperContextTypeBuiltIn GROUPER_WS
from the ws


GSH

public static final GrouperContextTypeBuiltIn GSH
from grouper shell


UNKNOWN

public static final GrouperContextTypeBuiltIn UNKNOWN
if the context type if not known


USDU

public static final GrouperContextTypeBuiltIn USDU
from undeleted subject utility


GROUPER_LOADER

public static final GrouperContextTypeBuiltIn GROUPER_LOADER
from grouper loader

Method Detail

values

public static GrouperContextTypeBuiltIn[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (GrouperContextTypeBuiltIn c : GrouperContextTypeBuiltIn.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static GrouperContextTypeBuiltIn valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

setDefaultContext

public static void setDefaultContext(GrouperContextType defaultContext)
global default context (if not one set in thread local)

Parameters:
defaultContext - the defaultContext to set

setThreadLocalContext

public static void setThreadLocalContext(GrouperContextType grouperContextType)
Parameters:
grouperContextType -

currentGrouperContext

public static GrouperContextType currentGrouperContext()
current grouper context. Will not return null, if null will return UNKNOWN. This defaults to the default global context, but if the threadlocal one was set, use that instead.

Returns:
the threadlocal if there is one there, or global

_internal_getThreadLocalGrouperContextType

public static GrouperContextType _internal_getThreadLocalGrouperContextType()
Returns:
the threadLocalGrouperContextType