Class RunMode
- java.lang.Object
 - 
- org.apache.sling.provisioning.model.Traceable
 - 
- org.apache.sling.provisioning.model.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 Summary
Constructors Constructor Description RunMode(java.lang.String[] names)Create a new run mode 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(RunMode o2)ArtifactGroupgetArtifactGroup(int startLevel)Find the artifact group.java.util.List<ArtifactGroup>getArtifactGroups()Get all artifact groupsConfigurationgetConfiguration(java.lang.String pid)Search a configuration with a pidConfigurationgetConfiguration(java.lang.String pid, java.lang.String factoryPid)Search a configuration with pid and factory pidItemList<Configuration>getConfigurations()Get all configurationsjava.lang.String[]getNames()Return the run mode names.ArtifactGroupgetOrCreateArtifactGroup(int startLevel)Get or create an artifact groupConfigurationgetOrCreateConfiguration(java.lang.String pid, java.lang.String factoryPid)Get or create the configurationKeyValueMap<java.lang.String>getSettings()Get the settingsstatic java.lang.String[]getSortedRunModesArray(java.lang.String[] names)Get an alphabetical sorted array of the run mode names.booleanisActive(java.util.Set<java.lang.String> activeRunModes)Check if this run mode is active wrt the given set of active run modes.booleanisRunMode(java.lang.String mode)Check if this run mode is tied to a single specific run mode name.booleanisSpecial()Check whether this run mode is a special onejava.lang.StringtoString()- 
Methods inherited from class org.apache.sling.provisioning.model.Traceable
getLocation, setLocation 
 - 
 
 - 
 
- 
- 
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:
 trueif the run mode is active.
 
- 
isSpecial
public boolean isSpecial()
Check whether this run mode is a special one- Returns:
 trueif 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:
 trueif 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 pidfactoryPid- 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 pidfactoryPid- 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:
 compareToin interfacejava.lang.Comparable<RunMode>- See Also:
 Comparable.compareTo(java.lang.Object)
 
 - 
 
 -