Package org.jenkinsci.plugins.cloudstats
Class ProvisioningActivity
java.lang.Object
org.jenkinsci.plugins.cloudstats.ProvisioningActivity
- All Implemented Interfaces:
ModelObject,Comparable<ProvisioningActivity>
@ExportedBean
public final class ProvisioningActivity
extends Object
implements ModelObject, Comparable<ProvisioningActivity>
Record of provisioning attempt lifecycle.
- Author:
- ogondza.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classActivity identifier.static enumProgress of an activity.static enum -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidenter(ProvisioningActivity.Phase phase) Make the phase of this activity entered.booleanMake sure the phase of this activity is entered.booleanGet currentProvisioningActivity.Phase.Get currentPhaseExecution.longgetDuration(PhaseExecution execution) Get duration of the activity phase.getId()getName()PhaseExecutionor null in case it is/was not executed.Get a snapshot of phase executions for phases that have already started.longStatus of the activity as a whole.inthashCode()booleantoString()
-
Field Details
-
PREMATURE_COMPLETION_DETECTED
- See Also:
-
-
Constructor Details
-
ProvisioningActivity
-
-
Method Details
-
getId
-
getStarted
-
getStartedTimestamp
@Exported public long getStartedTimestamp() -
getPhaseExecution
PhaseExecutionor null in case it is/was not executed. -
getPhaseExecutions
@Exported(inline=true) @NonNull public Map<ProvisioningActivity.Phase,PhaseExecution> getPhaseExecutions()Get a snapshot of phase executions for phases that have already started.Phases that have not yet been entered are absent from the returned map. The iteration order follows declaration order of
ProvisioningActivity.Phase.- Returns:
- Unmodifiable map of started
ProvisioningActivity.Phases to their (non-null)PhaseExecution.
-
getCurrentPhaseExecution
Get currentPhaseExecution. -
getCurrentPhase
Get currentProvisioningActivity.Phase. -
getStatus
Status of the activity as a whole.It is the works status of any of the phases, OK by default.
-
enter
Make the phase of this activity entered.- Throws:
IllegalArgumentException- In case phases are entered repeatedly.
-
enterIfNotAlready
Make sure the phase of this activity is entered.Exposed for convenience of clients that can be invoked repeatedly and have no easier way to tell if phase was entered already, such as launch listener.
- Returns:
trueis phase was entered.
-
getName
-
getDisplayName
- Specified by:
getDisplayNamein interfaceModelObject
-
getPhase
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public PhaseExecution getPhase(@NonNull String phaseName) -
getDuration
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public long getDuration(@NonNull PhaseExecution execution) Get duration of the activity phase.- Returns:
- Positive integer in case the phase is completed, negative in case it is in progress
-
isFor
-
compareTo
- Specified by:
compareToin interfaceComparable<ProvisioningActivity>
-
toString
-
equals
-
hashCode
public int hashCode()
-