Class ContextMachineCache


  • public class ContextMachineCache
    extends java.lang.Object
    • Method Detail

      • getContextInstanceByContextInstanceIdCache

        public java.util.concurrent.ConcurrentHashMap<java.lang.String,​ContextMachine> getContextInstanceByContextInstanceIdCache()
        Get all Context Instances in the cache
      • 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 cache
        ignoreEnvironmentGroup - 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()
      • 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:
        toString in class java.lang.Object