Class RunMode
java.lang.Object
org.apache.sling.provisioning.model.Traceable
org.apache.sling.provisioning.model.RunMode
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionint
getArtifactGroup
(int startLevel) Find the artifact group.Get all artifact groupsgetConfiguration
(String pid) Search a configuration with a pidgetConfiguration
(String pid, String factoryPid) Search a configuration with pid and factory pidGet all configurationsString[]
getNames()
Return the run mode names.getOrCreateArtifactGroup
(int startLevel) Get or create an artifact groupgetOrCreateConfiguration
(String pid, String factoryPid) Get or create the configurationGet the settingsstatic String[]
getSortedRunModesArray
(String[] names) Get an alphabetical sorted array of the run mode names.boolean
Check if this run mode is active wrt the given set of active run modes.boolean
Check if this run mode is tied to a single specific run mode name.boolean
Check whether this run mode is a special onetoString()
Methods inherited from class org.apache.sling.provisioning.model.Traceable
getLocation, setLocation
-
Constructor Details
-
RunMode
Create a new run mode- Parameters:
names
- The run mode names
-
-
Method Details
-
getSortedRunModesArray
Get an alphabetical sorted array of the run mode names.- Parameters:
names
- The run mode names- Returns:
- The sorted run mode names
-
getNames
Return the run mode names.- Returns:
- The array of run mode names or
null
.
-
isActive
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
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
Find the artifact group.- Parameters:
startLevel
- the start level- Returns:
- The artifact group for that level or
null
.
-
getOrCreateArtifactGroup
Get or create an artifact group- Parameters:
startLevel
- The start level- Returns:
- The artifact group.
-
getConfiguration
Search a configuration with a pid- Parameters:
pid
- The configuration pid- Returns:
- The configuration or
null
-
getConfiguration
Search a configuration with pid and factory pid- Parameters:
pid
- The pidfactoryPid
- The optional factory pid- Returns:
- The configuration or
null
.
-
getOrCreateConfiguration
Get or create the configuration- Parameters:
pid
- The pidfactoryPid
- The optional factory pid- Returns:
- The configuration
-
getArtifactGroups
Get all artifact groups- Returns:
- List of artifact groups
-
getConfigurations
Get all configurations- Returns:
- List of configurations
-
getSettings
Get the settings- Returns:
- Map with the settings.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<RunMode>
- See Also:
-
toString
-