Package gda.beamline.health
Class ComponentHealthConditionBase
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.beamline.health.ComponentHealthConditionBase
- All Implemented Interfaces:
ComponentHealthCondition,Configurable,Findable
- Direct Known Subclasses:
ScannableHealthCondition,ServerCondition
public abstract class ComponentHealthConditionBase
extends FindableConfigurableBase
implements ComponentHealthCondition
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BeamlineHealthStatevoidDefault implementation for classes that do not have to do any specific configuration.
Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.Return the current state of the component.
For a scannable, this would be its position: for a service, it could indicate whether it is running, paused etc.protected StringReturn a user-friendly description of the component e.g.Return a message that can be displayed to the user is the corresponding condition is not metReturn the health state for this component, based on the condition itself and whether it is critical for the functioning of the beamline.booleanIndicate whether this is critical for the overall health of the beamlinebooleanIndicates whether the condition is enabled.protected abstract StringvoidsetCritical(boolean critical) voidsetDescription(String description) voidsetEnabled(boolean enabled) voidsetErrorMessage(String errorMessage) toString()Methods inherited from class gda.factory.FindableConfigurableBase
getName, setNameMethods inherited from class gda.factory.ConfigurableBase
isConfigureAtStartup, isConfigured, reconfigure, setConfigured
-
Constructor Details
-
ComponentHealthConditionBase
public ComponentHealthConditionBase()
-
-
Method Details
-
configure
Description copied from class:ConfigurableBaseDefault implementation for classes that do not have to do any specific configuration.
Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classConfigurableBase- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
getDefaultErrorMessage
-
getCurrentState
Description copied from interface:ComponentHealthConditionReturn the current state of the component.
For a scannable, this would be its position: for a service, it could indicate whether it is running, paused etc.- Specified by:
getCurrentStatein interfaceComponentHealthCondition
-
readCurrentState
-
getHealthState
Description copied from interface:ComponentHealthConditionReturn the health state for this component, based on the condition itself and whether it is critical for the functioning of the beamline.- Specified by:
getHealthStatein interfaceComponentHealthCondition
-
calculateHealthState
-
getDescription
Description copied from interface:ComponentHealthConditionReturn a user-friendly description of the component e.g. for display in the GUI- Specified by:
getDescriptionin interfaceComponentHealthCondition
-
setDescription
- Specified by:
setDescriptionin interfaceComponentHealthCondition
-
getErrorMessage
Description copied from interface:ComponentHealthConditionReturn a message that can be displayed to the user is the corresponding condition is not met- Specified by:
getErrorMessagein interfaceComponentHealthCondition
-
setErrorMessage
- Specified by:
setErrorMessagein interfaceComponentHealthCondition
-
isCritical
public boolean isCritical()Description copied from interface:ComponentHealthConditionIndicate whether this is critical for the overall health of the beamline- Specified by:
isCriticalin interfaceComponentHealthCondition
-
setCritical
public void setCritical(boolean critical) - Specified by:
setCriticalin interfaceComponentHealthCondition
-
isEnabled
public boolean isEnabled()Description copied from interface:ComponentHealthConditionIndicates whether the condition is enabled.- Specified by:
isEnabledin interfaceComponentHealthCondition
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabledin interfaceComponentHealthCondition
-
toString
-