public class OsgiFramework
extends InstanceService
Controls OSGi framework using Apache Felix Web Console endpoints.
| Modifier and Type | Class and Description |
|---|---|
static class |
OsgiFramework.Companion |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BUNDLES_LIST_JSON |
static java.lang.String |
BUNDLES_PATH |
static java.lang.String |
COMPONENTS_LIST_JSON |
static java.lang.String |
COMPONENTS_PATH |
static java.lang.String |
CONFIGURATION_PATH |
static OsgiFramework.Companion |
Companion |
static java.lang.String |
EVENTS_LIST_JSON |
static java.lang.String |
VMSTAT_PATH |
| Constructor and Description |
|---|
OsgiFramework(InstanceSync sync)
Controls OSGi framework using Apache Felix Web Console endpoints.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure(java.lang.String pid,
java.util.Map<java.lang.String,? extends java.lang.Object> properties)
Set properties for existing OSGi configuration.
|
void |
deleteConfiguration(java.lang.String pid)
Delete existing OSGi configuration.
|
void |
deleteConfiguration(java.lang.String pid,
java.lang.String service)
Delete existing OSGi configuration.
|
BundleState |
determineBundleState()
Determine all OSGi bundle states.
|
ComponentState |
determineComponentState()
Determine OSGi components state.
|
ConfigurationState |
determineConfigurationState()
Determine all OSGi configuration PIDs.
|
EventState |
determineEventState()
Determine OSGi events for current moment.
|
void |
disableComponent(java.lang.String pid)
Disable OSGi component. Does nothing if already disabled.
|
void |
enableComponent(java.lang.String pid)
Enable OSGi component. Does nothing if already enabled.
|
Bundle |
findBundle(java.lang.String symbolicName)
Find OSGi bundle by symbolic name.
|
Component |
findComponent(java.lang.String pid)
Find OSGi component by PID.
|
Configuration |
findConfiguration(java.lang.String pid,
boolean metatypeChecking)
Find OSGi configuration by PID.
Also ensures that for given configuration there is metatype service available (to reduce typo errors).
|
Bundle |
getBundle(java.lang.String symbolicName)
Get OSGi bundle by symbolic name. Fail if not found.
|
java.util.List<com.cognifide.gradle.aem.common.instance.service.osgi.Bundle> |
getBundles()
Get all OSGi bundles.
|
Component |
getComponent(java.lang.String pid)
Get OSGi component by PID. Fail if not found.
|
java.util.List<com.cognifide.gradle.aem.common.instance.service.osgi.Component> |
getComponents()
Get all OSGi components.
|
Configuration |
getConfiguration(java.lang.String pid)
Get OSGi configuration by PID. Fail if not found.
|
kotlin.sequences.Sequence<com.cognifide.gradle.aem.common.instance.service.osgi.Configuration> |
getConfigurations()
Get all OSGi configurations.
|
kotlin.sequences.Sequence<com.cognifide.gradle.aem.common.instance.service.osgi.Configuration> |
getConfigurations(java.lang.String fpid)
Get all OSGi configurations for specified factory PID.
|
java.util.List<com.cognifide.gradle.aem.common.instance.service.osgi.Event> |
getEvents()
Get OSGi events for current moment.
|
void |
refreshBundle(java.lang.String symbolicName)
Refresh OSGi bundle by symbolic name.
|
void |
restart()
Restart OSGi framework (Apache Felix)
|
void |
restartBundle(java.lang.String symbolicName)
Stop then start again OSGi bundle. Works correctly even it is already stopped.
|
void |
restartComponent(java.lang.String pid)
Disable then enable again OSGi component. Works correctly even it is already disabled.
|
void |
saveConfiguration(java.lang.String pid,
java.util.Map<java.lang.String,? extends java.lang.Object> properties)
Set properties for existing OSGi configuration or create new.
|
void |
saveConfiguration(java.lang.String pid,
java.lang.String service,
java.util.Map<java.lang.String,? extends java.lang.Object> properties)
Set properties for existing OSGi configuration or create new.
|
void |
startBundle(java.lang.String symbolicName)
Start OSGi bundle. Does nothing if already started.
|
void |
stop()
Stop OSGi framework (Apache Felix)
|
void |
stopBundle(java.lang.String symbolicName)
Stop OSGi bundle. Does nothing if already stopped.
|
void |
updateBundle(java.lang.String symbolicName)
Update OSGi bundle by symbolic name.
|
void |
updateConfiguration(java.lang.String pid,
java.util.Map<java.lang.String,? extends java.lang.Object> properties)
Set properties for existing OSGi configuration.
|
void |
updateConfiguration(java.lang.String pid,
java.lang.String service,
java.util.Map<java.lang.String,? extends java.lang.Object> properties)
Set properties for existing OSGi configuration.
|
getAem, getInstance, getProject, getSync@NotNull public static java.lang.String BUNDLES_PATH
@NotNull public static java.lang.String BUNDLES_LIST_JSON
@NotNull public static java.lang.String COMPONENTS_PATH
@NotNull public static java.lang.String COMPONENTS_LIST_JSON
@NotNull public static java.lang.String EVENTS_LIST_JSON
@NotNull public static java.lang.String VMSTAT_PATH
@NotNull public static java.lang.String CONFIGURATION_PATH
public static OsgiFramework.Companion Companion
public OsgiFramework(@NotNull
InstanceSync sync)
Controls OSGi framework using Apache Felix Web Console endpoints.
@NotNull public java.util.List<com.cognifide.gradle.aem.common.instance.service.osgi.Bundle> getBundles()
Get all OSGi bundles.
@NotNull public BundleState determineBundleState()
Determine all OSGi bundle states.
@Nullable public Bundle findBundle(@NotNull java.lang.String symbolicName)
Find OSGi bundle by symbolic name.
@NotNull public Bundle getBundle(@NotNull java.lang.String symbolicName)
Get OSGi bundle by symbolic name. Fail if not found.
public void startBundle(@NotNull
java.lang.String symbolicName)
Start OSGi bundle. Does nothing if already started.
public void stopBundle(@NotNull
java.lang.String symbolicName)
Stop OSGi bundle. Does nothing if already stopped.
public void restartBundle(@NotNull
java.lang.String symbolicName)
Stop then start again OSGi bundle. Works correctly even it is already stopped.
public void refreshBundle(@NotNull
java.lang.String symbolicName)
Refresh OSGi bundle by symbolic name.
public void updateBundle(@NotNull
java.lang.String symbolicName)
Update OSGi bundle by symbolic name.
@NotNull public java.util.List<com.cognifide.gradle.aem.common.instance.service.osgi.Component> getComponents()
Get all OSGi components.
@NotNull public ComponentState determineComponentState()
Determine OSGi components state.
@Nullable public Component findComponent(@NotNull java.lang.String pid)
Find OSGi component by PID.
@NotNull public Component getComponent(@NotNull java.lang.String pid)
Get OSGi component by PID. Fail if not found.
public void enableComponent(@NotNull
java.lang.String pid)
Enable OSGi component. Does nothing if already enabled.
public void disableComponent(@NotNull
java.lang.String pid)
Disable OSGi component. Does nothing if already disabled.
public void restartComponent(@NotNull
java.lang.String pid)
Disable then enable again OSGi component. Works correctly even it is already disabled.
public void configure(@NotNull
java.lang.String pid,
@NotNull
java.util.Map<java.lang.String,? extends java.lang.Object> properties)
Set properties for existing OSGi configuration.
@NotNull public kotlin.sequences.Sequence<com.cognifide.gradle.aem.common.instance.service.osgi.Configuration> getConfigurations()
Get all OSGi configurations.
@NotNull public ConfigurationState determineConfigurationState()
Determine all OSGi configuration PIDs.
@Nullable public Configuration findConfiguration(@NotNull java.lang.String pid, boolean metatypeChecking)
Find OSGi configuration by PID. Also ensures that for given configuration there is metatype service available (to reduce typo errors).
@NotNull public Configuration getConfiguration(@NotNull java.lang.String pid)
Get OSGi configuration by PID. Fail if not found.
@NotNull
public kotlin.sequences.Sequence<com.cognifide.gradle.aem.common.instance.service.osgi.Configuration> getConfigurations(@NotNull
java.lang.String fpid)
Get all OSGi configurations for specified factory PID.
public void updateConfiguration(@NotNull
java.lang.String pid,
@NotNull
java.util.Map<java.lang.String,? extends java.lang.Object> properties)
Set properties for existing OSGi configuration.
public void updateConfiguration(@NotNull
java.lang.String pid,
@NotNull
java.lang.String service,
@NotNull
java.util.Map<java.lang.String,? extends java.lang.Object> properties)
Set properties for existing OSGi configuration.
public void saveConfiguration(@NotNull
java.lang.String pid,
@NotNull
java.util.Map<java.lang.String,? extends java.lang.Object> properties)
Set properties for existing OSGi configuration or create new.
public void saveConfiguration(@NotNull
java.lang.String pid,
@NotNull
java.lang.String service,
@NotNull
java.util.Map<java.lang.String,? extends java.lang.Object> properties)
Set properties for existing OSGi configuration or create new.
public void deleteConfiguration(@NotNull
java.lang.String pid)
Delete existing OSGi configuration.
public void deleteConfiguration(@NotNull
java.lang.String pid,
@NotNull
java.lang.String service)
Delete existing OSGi configuration.
@NotNull public java.util.List<com.cognifide.gradle.aem.common.instance.service.osgi.Event> getEvents()
Get OSGi events for current moment.
@NotNull public EventState determineEventState()
Determine OSGi events for current moment.
public void restart()
Restart OSGi framework (Apache Felix)
public void stop()
Stop OSGi framework (Apache Felix)
Warning! After executing instance will be no longer available.