public class MembershipContext
extends java.lang.Object
For example: if I only wants repository calls or queries 
 to work on items which are members of context 'contextA', I would push a collection 
 with a single element 'contextA'.
 
 
 try{
    MembershipContext.pushMembershipContexts(Collections.singleton("contextA"));
    // repository calls or query executions here.  
    
  }finally
  {
    MembershipContext.popMembershipContexts();
  }
  
  
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
MembershipContext.MembershipContextService
An instance to use to expose logging and other settings to nucleus. 
 | 
static class  | 
MembershipContext.MembershipContextsSnapshot
An opaque class representing the state of the MembershipContext
 stack for this thread. 
 | 
static class  | 
MembershipContext.MembershipContextsThreadLocalCopier
A JobThreadLocalValueCopier that copies our ThreadLocal for
 passing to another thread. 
 | 
| Modifier and Type | Field and Description | 
|---|---|
static java.lang.String | 
CLASS_VERSION  | 
static boolean | 
sDumpStackOnMembershipContextChange
Whether to dump stack on add/remove/clears. 
 | 
static boolean | 
sTrackPushers
Whether we are tracking the stacks of callers who enable membership filters
  These build up until a clear is called. 
 | 
| Constructor and Description | 
|---|
MembershipContext(java.lang.String pContextID)  | 
MembershipContext(java.lang.String pContextID,
                 boolean pExclusion)  | 
| Modifier and Type | Method and Description | 
|---|---|
static void | 
dumpPushers()
Dumps pushers for this thread to stdout. 
 | 
boolean | 
equals(java.lang.Object obj)  | 
static java.lang.String | 
format(java.lang.String key,
      java.lang.Object[] args)  | 
java.lang.String | 
getContextID()  | 
static java.util.Collection<MembershipContext> | 
getCurrentMembershipContexts()
Get the current set of membership Contexts for the this thread. 
 | 
static MembershipContext.MembershipContextsSnapshot | 
getSnapshot()
Return a snapshot of the state of the membership context. 
 | 
int | 
hashCode()  | 
boolean | 
isExclusion()  | 
static java.util.Collection<MembershipContext> | 
popMembershipContexts()  | 
static void | 
pushMembershipContexts(java.util.Collection<MembershipContext> pContextStringCollection)
Push a collection of membership contexts to the stack of contexts and 
 make it current in this thread. 
 | 
static void | 
pushMembershipContexts(GlobalContextType pGlobalType)
Push a global membership context on the stack. 
 | 
static void | 
reset()
Clears the state. 
 | 
static java.util.Collection<MembershipContext> | 
singleton(java.lang.String pContextID)
Utility method to create a single element object of this kind. 
 | 
static java.util.Collection<MembershipContext> | 
singletonNegation(java.lang.String pContextID)  | 
static ContextFilteringRules | 
toContextFilteringRules()
Convert current membership context to corresponding ContextFilteringRules object 
 | 
static ContextFilteringRules | 
toContextFilteringRules(java.util.Collection<MembershipContext> pMembershipContexts)
Convert current membership context to corresponding ContextFilteringRules object 
 | 
public static java.lang.String CLASS_VERSION
public static boolean sTrackPushers
public static boolean sDumpStackOnMembershipContextChange
public MembershipContext(java.lang.String pContextID)
pContextID - public MembershipContext(java.lang.String pContextID,
                         boolean pExclusion)
pContextID - the valuepExclusion - If this is an exclusion.public java.lang.String getContextID()
public boolean isExclusion()
public static java.util.Collection<MembershipContext> singleton(java.lang.String pContextID)
pContextID - public static java.util.Collection<MembershipContext> singletonNegation(java.lang.String pContextID)
public static ContextFilteringRules toContextFilteringRules()
public static ContextFilteringRules toContextFilteringRules(java.util.Collection<MembershipContext> pMembershipContexts)
public static void pushMembershipContexts(java.util.Collection<MembershipContext> pContextStringCollection)
    MembershipContext.pushMembershipContexts(MembershipContext.singleton('contextA'));
 pContextStringCollection - public static void pushMembershipContexts(GlobalContextType pGlobalType)
GlobalContextType enumeration.pGlobalType - public static java.util.Collection<MembershipContext> popMembershipContexts()
public static java.util.Collection<MembershipContext> getCurrentMembershipContexts()
public static java.lang.String format(java.lang.String key,
                                      java.lang.Object[] args)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic static void reset()
public static MembershipContext.MembershipContextsSnapshot getSnapshot()
public static void dumpPushers()