Class ContextMachineCache
- java.lang.Object
-
- org.ikasan.job.orchestration.context.cache.ContextMachineCache
-
public class ContextMachineCache extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancacheIsEmpty()This is intended to support testability and remove the need for reflective accessbooleancontainsInstanceIdentifier(java.lang.String contextInstanceId)java.util.Set<java.lang.String>contextInstanceIdentifiers()java.util.Set<java.lang.String>contextNames()A copy (so as not to break encapsulation) of the complete set of context namesjava.util.List<ContextMachine>getAllByContextName(java.lang.String contextName)A single plan can have multiple instancesjava.util.List<ContextMachine>getAllRunningByContextName(java.lang.String contextName)This returns plans that are running and not in a PREPARED stateContextMachinegetByContextInstanceId(java.lang.String contextInstanceId)java.util.concurrent.ConcurrentHashMap<java.lang.String,ContextMachine>getContextInstanceByContextInstanceIdCache()Get all Context Instances in the cacheContextMachinegetFirstByContextName(java.lang.String contextName)java.util.List<java.lang.String>getListOfContextInstanceIdByEnvironmentGroup(java.lang.String environmentGroup, boolean ignoreEnvironmentGroup)Gets a list of ContextInstances based on which environmentGroup they belong to.static ContextMachineCacheinstance()voidput(ContextMachine contextMachine)voidremove(ContextMachine contextMachine)voidresetAllCache()This is intended to support testability and remove the need for reflective accessjava.lang.StringtoString()
-
-
-
Method Detail
-
instance
public static ContextMachineCache instance()
-
getContextInstanceByContextInstanceIdCache
public java.util.concurrent.ConcurrentHashMap<java.lang.String,ContextMachine> getContextInstanceByContextInstanceIdCache()
Get all Context Instances in the cache
-
put
public void put(ContextMachine contextMachine)
-
getFirstByContextName
public ContextMachine getFirstByContextName(java.lang.String contextName)
- Parameters:
contextName- / planName to lookup- Returns:
- the first context machine that has the contextName / planName
-
getAllByContextName
public java.util.List<ContextMachine> getAllByContextName(java.lang.String contextName)
A single plan can have multiple instances- Parameters:
contextName- / planName to find- Returns:
- all the instances that are for the given plan
-
getAllRunningByContextName
public java.util.List<ContextMachine> getAllRunningByContextName(java.lang.String contextName)
This returns plans that are running and not in a PREPARED state- Parameters:
contextName- / planName to find- Returns:
- all running instances that are for the given plan
-
getByContextInstanceId
public ContextMachine getByContextInstanceId(java.lang.String contextInstanceId)
-
getListOfContextInstanceIdByEnvironmentGroup
public java.util.List<java.lang.String> getListOfContextInstanceIdByEnvironmentGroup(java.lang.String environmentGroup, boolean ignoreEnvironmentGroup)Gets a list of ContextInstances based on which environmentGroup they belong to.- Parameters:
environmentGroup- To check the cacheignoreEnvironmentGroup- set to true to target all active context instance regardless of what group it belongs to.- Returns:
- list of contextInstanceId in the cache that belongs to the environmentGroup
-
containsInstanceIdentifier
public boolean containsInstanceIdentifier(java.lang.String contextInstanceId)
-
contextNames
public java.util.Set<java.lang.String> contextNames()
A copy (so as not to break encapsulation) of the complete set of context names- Returns:
- a set of context names currently dealt with by this machine.
-
contextInstanceIdentifiers
public java.util.Set<java.lang.String> contextInstanceIdentifiers()
-
remove
public void remove(ContextMachine contextMachine)
-
resetAllCache
public void resetAllCache()
This is intended to support testability and remove the need for reflective access
-
cacheIsEmpty
public boolean cacheIsEmpty()
This is intended to support testability and remove the need for reflective access
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-