Package org.gcube.common.health.api
Class ContextState
java.lang.Object
org.gcube.common.health.api.ContextState
The state of an application in one of its Contexts:
pending before it has been prepared
there, active when it works there, degraded when it works with a problem to verify,
inactive when it cannot work there. A degraded or inactive state has a
reason, which names the Context, e.g. "CKAN not found or not configured in /gcube/devsec/CCP". The
health is public: the reason names what is missing, never a secret.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe value of an application that works in the Context.static final StringThe value of an application that works in the Context with a problem to verify.static final StringThe value of an application that cannot work in the Context.static final StringThe value of an application not prepared yet in the Context. -
Method Summary
Modifier and TypeMethodDescriptionstatic ContextStateactive()Returns the state of an application that works in the Context.static ContextStateReturns the state of an application that works in the Context with a problem to verify.booleanReturns the reason of adegradedorinactivestate.getValue()Returns the value of the state:pending,active,degradedorinactive.inthashCode()static ContextStateReturns the state of an application that cannot work in the Context.booleanTells whether the application works in the Context (activeordegraded).static ContextStatepending()Returns the state of an application not prepared yet in the Context.toString()
-
Field Details
-
PENDING
The value of an application not prepared yet in the Context.- See Also:
-
ACTIVE
The value of an application that works in the Context.- See Also:
-
DEGRADED
The value of an application that works in the Context with a problem to verify.- See Also:
-
INACTIVE
The value of an application that cannot work in the Context.- See Also:
-
-
Method Details
-
pending
Returns the state of an application not prepared yet in the Context.- Returns:
- the
pendingstate
-
active
Returns the state of an application that works in the Context.- Returns:
- the
activestate
-
degraded
Returns the state of an application that works in the Context with a problem to verify.- Parameters:
reason- the problem, naming the Context- Returns:
- the
degradedstate
-
inactive
Returns the state of an application that cannot work in the Context.- Parameters:
reason- why, naming the Context- Returns:
- the
inactivestate
-
getValue
Returns the value of the state:pending,active,degradedorinactive.- Returns:
- the value
-
getReason
Returns the reason of adegradedorinactivestate.- Returns:
- the reason, or
nullforpendingandactive
-
isWorking
public boolean isWorking()Tells whether the application works in the Context (activeordegraded).- Returns:
truewhen it works there
-
equals
-
hashCode
public int hashCode() -
toString
-