public class DefaultBusinessServiceStateMachine extends Object implements BusinessServiceStateMachine
Modifier and Type | Field and Description |
---|---|
static Status |
MIN_SEVERITY |
Constructor and Description |
---|
DefaultBusinessServiceStateMachine() |
Modifier and Type | Method and Description |
---|---|
void |
addHandler(BusinessServiceStateChangeHandler handler,
Map<String,String> attributes)
Registers a state change handler.
|
List<GraphVertex> |
calculateImpact(Application application) |
List<GraphVertex> |
calculateImpact(BusinessService businessService) |
List<GraphVertex> |
calculateImpact(IpService ipService) |
List<GraphVertex> |
calculateImpact(String reductionKey) |
Set<GraphEdge> |
calculateImpacting(BusinessService businessService) |
List<GraphVertex> |
calculateRootCause(BusinessService businessService) |
BusinessServiceStateMachine |
clone(boolean preserveState) |
ThresholdResultExplanation |
explain(BusinessService businessService,
Threshold threshold) |
BusinessServiceGraph |
getGraph()
This returns the actual graph of the
BusinessServiceStateMachine . |
Status |
getOperationalStatus(BusinessService businessService)
Retrieves the current operational status of a Business Service.
|
Status |
getOperationalStatus(Edge edge)
Retrieves the current operational status of the element associated with a particular Edge.
|
Status |
getOperationalStatus(IpService ipService)
Retrieves the current operational status of a particular IP service.
|
Status |
getOperationalStatus(String reductionKey)
Retrieves the current operational status of a particular reduction key.
|
void |
handleAllAlarms(List<AlarmWrapper> alarms)
Updates the states of the Business Services using the given list of alarms.
|
void |
handleNewOrUpdatedAlarm(AlarmWrapper alarm)
Updates the states of the Business Services.
|
boolean |
removeHandler(BusinessServiceStateChangeHandler handler,
Map<String,String> attributes)
Unregisters a state change handler.
|
void |
renderGraphToPng(File tempFile) |
void |
setAlarmProvider(AlarmProvider alarmProvider) |
void |
setBusinessServices(List<BusinessService> businessServices)
Sets the list of Business Services that need to managed by the state machine.
|
static List<StatusWithIndex> |
weighEdges(Collection<GraphEdge> edges) |
static List<StatusWithIndex> |
weighStatuses(Map<GraphEdge,Status> edgesWithStatus)
Apply the edges weights to the associated statuses set in the map,
ignoring the actual status stored in the edge.
|
public static final Status MIN_SEVERITY
public void setBusinessServices(List<BusinessService> businessServices)
BusinessServiceStateMachine
setBusinessServices
in interface BusinessServiceStateMachine
businessServices
- list of services to managepublic void handleNewOrUpdatedAlarm(AlarmWrapper alarm)
BusinessServiceStateMachine
handleNewOrUpdatedAlarm
in interface BusinessServiceStateMachine
public void handleAllAlarms(List<AlarmWrapper> alarms)
BusinessServiceStateMachine
handleAllAlarms
in interface BusinessServiceStateMachine
public static List<StatusWithIndex> weighEdges(Collection<GraphEdge> edges)
public static List<StatusWithIndex> weighStatuses(Map<GraphEdge,Status> edgesWithStatus)
edgesWithStatus
- public Status getOperationalStatus(BusinessService businessService)
BusinessServiceStateMachine
getOperationalStatus
in interface BusinessServiceStateMachine
businessService
- Business Service to querypublic Status getOperationalStatus(IpService ipService)
BusinessServiceStateMachine
getOperationalStatus
in interface BusinessServiceStateMachine
ipService
- IP Service to querypublic Status getOperationalStatus(String reductionKey)
BusinessServiceStateMachine
getOperationalStatus
in interface BusinessServiceStateMachine
reductionKey
- reduction key to query forpublic Status getOperationalStatus(Edge edge)
BusinessServiceStateMachine
BusinessServiceStateMachine.getOperationalStatus(String)
,
BusinessServiceStateMachine.getOperationalStatus(IpService)
or BusinessServiceStateMachine.getOperationalStatus(BusinessService)
depending
on the type of the edge.
This method DOES NOT return the mapped status of the edge.getOperationalStatus
in interface BusinessServiceStateMachine
edge
- edge to query forpublic void setAlarmProvider(AlarmProvider alarmProvider)
public void addHandler(BusinessServiceStateChangeHandler handler, Map<String,String> attributes)
BusinessServiceStateMachine
addHandler
in interface BusinessServiceStateMachine
handler
- handler to registerattributes
- map of service attributes, required for compatibility with the ONMS-OSGi bridge.public boolean removeHandler(BusinessServiceStateChangeHandler handler, Map<String,String> attributes)
BusinessServiceStateMachine
removeHandler
in interface BusinessServiceStateMachine
handler
- handler to unregisterattributes
- map of service attributes, required for compatibility with the ONMS-OSGi bridge.public void renderGraphToPng(File tempFile)
renderGraphToPng
in interface BusinessServiceStateMachine
public BusinessServiceGraph getGraph()
BusinessServiceStateMachine
BusinessServiceStateMachine
.
Please DO NOT MODIFY any object in that graph.getGraph
in interface BusinessServiceStateMachine
BusinessServiceStateMachine
. DO NOT MODIFY!public Set<GraphEdge> calculateImpacting(BusinessService businessService)
calculateImpacting
in interface BusinessServiceStateMachine
public BusinessServiceStateMachine clone(boolean preserveState)
clone
in interface BusinessServiceStateMachine
public List<GraphVertex> calculateRootCause(BusinessService businessService)
calculateRootCause
in interface BusinessServiceStateMachine
public List<GraphVertex> calculateImpact(BusinessService businessService)
calculateImpact
in interface BusinessServiceStateMachine
public List<GraphVertex> calculateImpact(IpService ipService)
calculateImpact
in interface BusinessServiceStateMachine
public List<GraphVertex> calculateImpact(Application application)
calculateImpact
in interface BusinessServiceStateMachine
public List<GraphVertex> calculateImpact(String reductionKey)
calculateImpact
in interface BusinessServiceStateMachine
public ThresholdResultExplanation explain(BusinessService businessService, Threshold threshold)
explain
in interface BusinessServiceStateMachine
Copyright © 2021. All rights reserved.