Class AbstractAllocationStorage


  • public abstract class AbstractAllocationStorage
    extends Object
    Manages the sets of container ID, name and allocated components
    • Constructor Detail

      • AbstractAllocationStorage

        public AbstractAllocationStorage()
    • Method Detail

      • saveContainerComponent

        protected static void saveContainerComponent​(String containerId,
                                                     String containerName,
                                                     Class<?> component,
                                                     String assemblyContext)
        Stores a tuple of container ID, name and one component, as well as the assembly context of the component.
        Parameters:
        containerId - key, can be used multiple times
        containerName - value
        component - value
        assemblyContext - ID of the assembly context
      • getContainerName

        public static String getContainerName​(String containerId)
      • getContainerID

        public static String getContainerID​(String container)
        FIXME: Possible source of errors if two container have the same name?
        Parameters:
        container -
        Returns:
      • getContainerIds

        public static Collection<String> getContainerIds()
        Returns a set of all container ids
        Returns:
        Set of container ids
      • getContainerNames

        public static Collection<String> getContainerNames()
        Returns a set of all container names
        Returns:
        Set of container names
      • getComponents

        public static Collection<ComponentAllocation> getComponents​(String containerId)
        Returns a collection of components to a given container id
        Parameters:
        containerId -
        Returns:
        collection of components
      • initContainerTemplate

        protected abstract void initContainerTemplate()
      • initContainer

        public static void initContainer()
      • setActiveContainer

        public static void setActiveContainer​(String containerId)
      • getActiveContainer

        public static String getActiveContainer()
        Returns the container of this current component. FIXME: Also returns the FIRST container if local mode is active, since no container has been (and can not be) chosen for this hardware node.
        Returns:
      • setLocalMode

        public static void setLocalMode​(boolean localMode)
      • isLocalMode

        public static boolean isLocalMode()