Class DockerDisabled
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<DockerDisabled>
-
- com.nirima.jenkins.plugins.docker.DockerDisabled
-
- All Implemented Interfaces:
Describable<DockerDisabled>
,Serializable
public class DockerDisabled extends AbstractDescribableImpl<DockerDisabled> implements Serializable
Records that the user has disabled something "until further notice", or the system has disabled something for a period, or both.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DockerDisabled.DescriptorImpl
-
Constructor Summary
Constructors Constructor Description DockerDisabled()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disableBySystem(String reasonGiven, long durationInMilliseconds, Throwable exception)
Called from owning classes to record a problem that will causeisDisabled()
to return true for a period.boolean
equals(Object o)
boolean
getDisabledByChoice()
boolean
getDisabledBySystem()
boolean
getEnabledByChoice()
String
getExceptionWhenDisabledBySystemString()
String
getReasonWhyDisabledBySystem()
String
getWhenDisabledBySystemString()
String
getWhenReEnableBySystemString()
int
hashCode()
boolean
isDisabled()
Indicates if we are currently disabled for any reason (either the user has ticked the disable box ordisableBySystem(String, long, Throwable)
has been called recently).protected long
readTimeNowInNanoseconds()
void
setDisabledByChoice(boolean disabledByChoice)
void
setEnabledByChoice(boolean enabledByChoice)
String
toString()
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Method Detail
-
setDisabledByChoice
@DataBoundSetter public void setDisabledByChoice(boolean disabledByChoice)
-
getDisabledByChoice
public boolean getDisabledByChoice()
-
disableBySystem
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void disableBySystem(@NonNull String reasonGiven, long durationInMilliseconds, @Nullable Throwable exception)
Called from owning classes to record a problem that will causeisDisabled()
to return true for a period.- Parameters:
reasonGiven
- Human-readable String stating why.durationInMilliseconds
- Length of time, in milliseconds, the disablement should continue.exception
- Optional exception.
-
isDisabled
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isDisabled()
Indicates if we are currently disabled for any reason (either the user has ticked the disable box ordisableBySystem(String, long, Throwable)
has been called recently).- Returns:
- true if we are currently disabled.
-
setEnabledByChoice
@DataBoundSetter public void setEnabledByChoice(boolean enabledByChoice)
-
getEnabledByChoice
public boolean getEnabledByChoice()
-
getDisabledBySystem
public boolean getDisabledBySystem()
-
getWhenDisabledBySystemString
public String getWhenDisabledBySystemString()
- Returns:
- How long ago this was disabled by the system, e.g. "3 min 0 sec".
-
getWhenReEnableBySystemString
public String getWhenReEnableBySystemString()
- Returns:
- How long ago this will remain disabled by the system, e.g. "2 min 0 sec".
-
getReasonWhyDisabledBySystem
public String getReasonWhyDisabledBySystem()
-
getExceptionWhenDisabledBySystemString
public String getExceptionWhenDisabledBySystemString()
-
readTimeNowInNanoseconds
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) protected long readTimeNowInNanoseconds()
-
-