Class RunMode

  • All Implemented Interfaces:
    java.lang.Comparable<RunMode>

    public class RunMode
    extends Traceable
    implements java.lang.Comparable<RunMode>
    A run mode is a collection of - artifacts (through start levels) - configurations - settings Only if all run modes are active, this run mode is active. In addition to custom, user defined run modes, special run modes exists. A special run mode name starts with a colon.
    • Constructor Detail

      • RunMode

        public RunMode​(java.lang.String[] names)
        Create a new run mode
        Parameters:
        names - The run mode names
    • Method Detail

      • getSortedRunModesArray

        public static java.lang.String[] getSortedRunModesArray​(java.lang.String[] names)
        Get an alphabetical sorted array of the run mode names.
        Parameters:
        names - The run mode names
        Returns:
        The sorted run mode names
      • getNames

        public java.lang.String[] getNames()
        Return the run mode names.
        Returns:
        The array of run mode names or null.
      • isActive

        public boolean isActive​(java.util.Set<java.lang.String> activeRunModes)
        Check if this run mode is active wrt the given set of active run modes.
        Parameters:
        activeRunModes - The set of active run modes.
        Returns:
        true if the run mode is active.
      • isSpecial

        public boolean isSpecial()
        Check whether this run mode is a special one
        Returns:
        true if it is special
      • isRunMode

        public boolean isRunMode​(java.lang.String mode)
        Check if this run mode is tied to a single specific run mode name.
        Parameters:
        mode - The name of the run mode
        Returns:
        true if this run mode is tied to exactly the single one.
      • getArtifactGroup

        public ArtifactGroup getArtifactGroup​(int startLevel)
        Find the artifact group.
        Parameters:
        startLevel - the start level
        Returns:
        The artifact group for that level or null.
      • getOrCreateArtifactGroup

        public ArtifactGroup getOrCreateArtifactGroup​(int startLevel)
        Get or create an artifact group
        Parameters:
        startLevel - The start level
        Returns:
        The artifact group.
      • getConfiguration

        public Configuration getConfiguration​(java.lang.String pid)
        Search a configuration with a pid
        Parameters:
        pid - The configuration pid
        Returns:
        The configuration or null
      • getConfiguration

        public Configuration getConfiguration​(java.lang.String pid,
                                              java.lang.String factoryPid)
        Search a configuration with pid and factory pid
        Parameters:
        pid - The pid
        factoryPid - The optional factory pid
        Returns:
        The configuration or null.
      • getOrCreateConfiguration

        public Configuration getOrCreateConfiguration​(java.lang.String pid,
                                                      java.lang.String factoryPid)
        Get or create the configuration
        Parameters:
        pid - The pid
        factoryPid - The optional factory pid
        Returns:
        The configuration
      • getArtifactGroups

        public java.util.List<ArtifactGroup> getArtifactGroups()
        Get all artifact groups
        Returns:
        List of artifact groups
      • getConfigurations

        public ItemList<Configuration> getConfigurations()
        Get all configurations
        Returns:
        List of configurations
      • getSettings

        public KeyValueMap<java.lang.String> getSettings()
        Get the settings
        Returns:
        Map with the settings.
      • compareTo

        public int compareTo​(RunMode o2)
        Specified by:
        compareTo in interface java.lang.Comparable<RunMode>
        See Also:
        Comparable.compareTo(java.lang.Object)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Traceable