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_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(EntityLocal entity,
AttributeSensor<java.util.Map<TKey,TVal>> sensor,
TKey key) |
static Lifecycle |
getExpectedState(Entity entity) |
static <TKey,TVal> |
getMapSensorEntry(EntityLocal 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 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 <TKey,TVal> |
updateMapSensorEntry(EntityLocal 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<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(EntityLocal entity, AttributeSensor<java.util.Map<TKey,TVal>> sensor, TKey key)
public static <TKey,TVal> void clearMapSensorEntry(EntityLocal entity, AttributeSensor<java.util.Map<TKey,TVal>> sensor, TKey key)
public static <TKey,TVal> void updateMapSensorEntry(EntityLocal entity, AttributeSensor<java.util.Map<TKey,TVal>> sensor, TKey key, TVal v)
public static final EnricherSpec<?> newEnricherForServiceStateFromProblemsAndUp()
public static final EnricherSpec<?> newEnricherForServiceState(java.lang.Class<? extends Enricher> type)
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