Package org.apache.sling.settings
Interface SlingSettingsService
The
SlingSettingsService provides basic Sling settings.
- Sling home : If the Sling launchpad is used
- Sling Id : A unique id of the installation
Run Mode Support
A run mode is simply a string like "author", "test", "development",...
The server can have a set of active run modes.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.Custom run modes are not supported in Cloud Servicestatic final StringDeprecated.Custom run modes are not supported in Cloud Servicestatic final Stringstatic final Stringstatic final Stringstatic final StringDeprecated.Custom run modes are not supported in Cloud Servicestatic final StringDeprecated.File handling is not supported in Cloud Service.static final StringDeprecated.File handling is not supported in Cloud Service. -
Method Summary
Modifier and TypeMethodDescriptiongetAbsolutePathWithinSlingHome(String relativePath) Deprecated.File handling is not supported in Cloud Service.intChecks if a given run mode spec is satisfied by the active run modes.Return the set of activate run modes.Return the optional description of the instance.Deprecated.File handling is not supported in Cloud Service.Deprecated.File handling is not supported in Cloud Service.The identifier of the running Sling instance.Return the optional name of the instance.
-
Field Details
-
SLING_HOME
Deprecated.File handling is not supported in Cloud Service.The name of the framework property defining the Sling home directory (value is "sling.home"). This is a Platform file system directory below which all runtime data, such as the Felix bundle archives, logfiles, the repository, etc., is located.This property is available calling the
BundleContext.getProperty(String)method.- See Also:
-
SLING_HOME_URL
Deprecated.File handling is not supported in Cloud Service.The name of the framework property defining the Sling home directory as an URL (value is "sling.home.url").The value of this property is assigned the value of
new File(${sling.home}).toURI().toString()before resolving the property variables.This property is available calling the
BundleContext.getProperty(String)method.- See Also:
-
RUN_MODES_PROPERTY
Deprecated.Custom run modes are not supported in Cloud ServiceThe name of the framework property defining the set of used run modes. The value is a comma separated list of run modes.- See Also:
-
RUN_MODE_OPTIONS
Deprecated.Custom run modes are not supported in Cloud ServiceThe name of the framework property defining the list of run mode options The value is a comma separated list of options where each option contains of a set of run modes separated by a | character.- Since:
- 1.2.0
- See Also:
-
RUN_MODE_INSTALL_OPTIONS
Deprecated.Custom run modes are not supported in Cloud ServiceThe name of the framework property defining the list of run mode options for installation time. The value is a comma separated list of options where each option contains of a set of run modes separated by a | character.- Since:
- 1.2.0
- See Also:
-
RUN_MODE_SPEC_OR_SEPARATOR
- See Also:
-
RUN_MODE_SPEC_AND_SEPARATOR
- See Also:
-
RUN_MODE_SPEC_NOT_PREFIX
- See Also:
-
-
Method Details
-
getAbsolutePathWithinSlingHome
Deprecated.File handling is not supported in Cloud Service.Utility method to generate an absolute path within Sling Home.- Returns:
- the absolute including the sling home directory.
- Since:
- 1.1.0
-
getSlingId
String getSlingId()The identifier of the running Sling instance.- Returns:
- The unique Sling identifier.
-
getSlingHomePath
Deprecated.File handling is not supported in Cloud Service.Returns the value of theSLING_HOMEproperty.- Returns:
- The sling home.
-
getSlingHome
Deprecated.File handling is not supported in Cloud Service.Returns the value of theSLING_HOME_URLproperty.- Returns:
- Sling home as a URL.
-
getRunModes
Return the set of activate run modes. This set might be empty.- Returns:
- A non modifiable set of run modes.
-
getBestRunModeMatchCountFromSpec
Checks if a given run mode spec is satisfied by the active run modes. A run mode spec consists out of run modes and operators (AND = ".", OR = "," and NOT = "-") and follows the following grammar in EBNF:
The operator order is first "-" (not), second "." (AND), last "," (OR).run mode spec ::= conjunctions { "," conjunctions } conjunctions ::= conjunction { '.' conjunction } conjunction ::= notrunmode | runmode notrunmode ::= '-' runmode- Parameters:
spec- the run mode spec string to check against- Returns:
- the number of matching run modes or 0 if no match. If multiple disjunctions match the one with the highest number of matching run modes is returned.
- Since:
- 1.4.0 (Sling Settings Bundle 1.3.12)
-
getSlingName
String getSlingName()Return the optional name of the instance.- Returns:
- The name of the instance or
null. - Since:
- 1.3
-
getSlingDescription
String getSlingDescription()Return the optional description of the instance.- Returns:
- The description of the instance or
null. - Since:
- 1.3
-