public class ServiceStateLogic
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembers |
static class |
ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembersSpec |
static class |
ServiceStateLogic.ComputeServiceState
Enricher which sets
Attributes.SERVICE_STATE_ACTUAL on changes to
Attributes.SERVICE_STATE_EXPECTED , Attributes.SERVICE_PROBLEMS , and Attributes.SERVICE_UP |
static class |
ServiceStateLogic.ServiceNotUpLogic |
static class |
ServiceStateLogic.ServiceProblemsLogic |
Modifier and Type | Field and Description |
---|---|
static AttributeSensor<java.util.Map<java.lang.String,java.lang.Object>> |
SERVICE_NOT_UP_DIAGNOSTICS |
static AttributeSensor<java.util.Map<java.lang.String,java.lang.Object>> |
SERVICE_NOT_UP_INDICATORS |
static AttributeSensor<java.util.Map<java.lang.String,java.lang.Object>> |
SERVICE_PROBLEMS |
static AttributeSensor<Lifecycle> |
SERVICE_STATE_ACTUAL |
static AttributeSensor<Lifecycle.Transition> |
SERVICE_STATE_EXPECTED |
static AttributeSensor<java.lang.Boolean> |
SERVICE_UP |
Modifier and Type | Method and Description |
---|---|
static <TKey,TVal> |
clearMapSensorEntry(Entity entity,
AttributeSensor<java.util.Map<TKey,TVal>> sensor,
TKey key) |
static Lifecycle |
getActualState(Entity entity) |
static Lifecycle |
getExpectedState(Entity entity) |
static <TKey,TVal> |
getMapSensorEntry(Entity entity,
AttributeSensor<java.util.Map<TKey,TVal>> sensor,
TKey key) |
static boolean |
isExpectedState(Entity entity,
Lifecycle state) |
static EnricherSpec<?> |
newEnricherForServiceState(java.lang.Class<? extends Enricher> type) |
static EnricherSpec<?> |
newEnricherForServiceStateFromProblemsAndUp() |
static EnricherSpec<?> |
newEnricherForServiceUp(java.lang.Boolean fromChildren,
java.lang.Boolean fromMembers) |
static EnricherSpec<?> |
newEnricherForServiceUpFromChildren()
An enricher that sets
servive.isUp on an entity only when all children are
also reporting as healthy. |
static EnricherSpec<?> |
newEnricherForServiceUpFromChildrenWithQuorumCheck(QuorumCheck quorumCheck) |
static EnricherSpec<?> |
newEnricherForServiceUpFromMembers() |
static ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembersSpec |
newEnricherFromChildren()
provides the default
ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembers enricher,
using the default unique tag (ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembers.DEFAULT_UNIQUE_TAG ),
configured here to require none on fire, and either no children or at least one up child,
the spec can be further configured as appropriate |
static ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembersSpec |
newEnricherFromChildrenState()
as
newEnricherFromChildren() but only publishing service problems,
listening to children and members, ignoring service up,
and using the same logic
(viz looking at children and members and requiring none are on fire) by default |
static ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembersSpec |
newEnricherFromChildrenUp()
as
newEnricherFromChildren() but only publishing service not-up indicators,
using a different unique tag (ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembers.DEFAULT_UNIQUE_TAG_UP ),
listening to children only, ignoring lifecycle/service-state,
and using the same logic
(viz looking only at children (not members) and requiring either no children or at least one child up) by default |
static void |
setExpectedState(Entity entity,
Lifecycle state) |
static void |
setExpectedStateRunningWithErrors(Entity entity) |
static <TKey,TVal> |
updateMapSensorEntry(Entity entity,
AttributeSensor<java.util.Map<TKey,TVal>> sensor,
TKey key,
TVal v)
update the given key in the given map sensor
|
public static final AttributeSensor<java.lang.Boolean> SERVICE_UP
public static final AttributeSensor<java.util.Map<java.lang.String,java.lang.Object>> SERVICE_NOT_UP_INDICATORS
public static final AttributeSensor<java.util.Map<java.lang.String,java.lang.Object>> SERVICE_NOT_UP_DIAGNOSTICS
public static final AttributeSensor<Lifecycle> SERVICE_STATE_ACTUAL
public static final AttributeSensor<Lifecycle.Transition> SERVICE_STATE_EXPECTED
public static final AttributeSensor<java.util.Map<java.lang.String,java.lang.Object>> SERVICE_PROBLEMS
public static <TKey,TVal> TVal getMapSensorEntry(Entity entity, AttributeSensor<java.util.Map<TKey,TVal>> sensor, TKey key)
public static <TKey,TVal> void clearMapSensorEntry(Entity entity, AttributeSensor<java.util.Map<TKey,TVal>> sensor, TKey key)
public static <TKey,TVal> void updateMapSensorEntry(Entity entity, AttributeSensor<java.util.Map<TKey,TVal>> sensor, TKey key, TVal v)
public static void setExpectedStateRunningWithErrors(Entity entity)
public static final EnricherSpec<?> newEnricherForServiceStateFromProblemsAndUp()
public static final EnricherSpec<?> newEnricherForServiceState(java.lang.Class<? extends Enricher> type)
public static final EnricherSpec<?> newEnricherForServiceUpFromChildren()
servive.isUp
on an entity only when all children are
also reporting as healthy.
Equivalent to the following YAML configuration.
brooklyn.enrichers: - type: org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic$ComputeServiceIndicatorsFromChildrenAndMembers brooklyn.config: enricher.aggregating.fromChildren: true enricher.aggregating.fromMembers: false enricher.suppressDuplicates: true enricher.service_state.children_and_members.quorum.up: all enricher.service_state.children_and_members.ignore_entities.service_state_values: [ "STOPPING", "STOPPED", "DESTROYED" ]
public static final EnricherSpec<?> newEnricherForServiceUpFromMembers()
public static final EnricherSpec<?> newEnricherForServiceUpFromChildrenWithQuorumCheck(QuorumCheck quorumCheck)
public static final EnricherSpec<?> newEnricherForServiceUp(java.lang.Boolean fromChildren, java.lang.Boolean fromMembers)
public static ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembersSpec newEnricherFromChildren()
ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembers
enricher,
using the default unique tag (ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembers.DEFAULT_UNIQUE_TAG
),
configured here to require none on fire, and either no children or at least one up child,
the spec can be further configured as appropriatepublic static ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembersSpec newEnricherFromChildrenUp()
newEnricherFromChildren()
but only publishing service not-up indicators,
using a different unique tag (ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembers.DEFAULT_UNIQUE_TAG_UP
),
listening to children only, ignoring lifecycle/service-state,
and using the same logic
(viz looking only at children (not members) and requiring either no children or at least one child up) by defaultpublic static ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembersSpec newEnricherFromChildrenState()
newEnricherFromChildren()
but only publishing service problems,
listening to children and members, ignoring service up,
and using the same logic
(viz looking at children and members and requiring none are on fire) by default