Class DiskSpaceMonitorDescriptor.DiskSpace

java.lang.Object
hudson.slaves.OfflineCause
hudson.node_monitors.MonitorOfflineCause
hudson.node_monitors.DiskSpaceMonitorDescriptor.DiskSpace
All Implemented Interfaces:
Serializable
Enclosing class:
DiskSpaceMonitorDescriptor

@ExportedBean public static final class DiskSpaceMonitorDescriptor.DiskSpace extends MonitorOfflineCause implements Serializable
Value object that represents the disk space.
See Also:
  • Field Details

    • size

      @Exported public final long size
  • Constructor Details

    • DiskSpace

      public DiskSpace(String path, long size)
      Parameters:
      path - Specify the file path that was monitored.
  • Method Details

    • setTotalSize

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void setTotalSize(long totalSize)
    • getTotalSize

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Exported public long getTotalSize()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPath

      @Exported public String getPath()
      The path that was checked
    • getFreeSize

      @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public long getFreeSize()
    • getGbLeft

      @Deprecated(since="2.434") public String getGbLeft()
      Deprecated.
      Directly use the size field or to get a human-readable value with units use Functions.humanReadableByteSize(long)
      Gets GB left.
    • toHtml

      public String toHtml()
      Returns the HTML representation of the space.
    • isTriggered

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isTriggered()
    • isWarning

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isWarning()
    • setTrigger

      protected void setTrigger(Class<? extends AbstractDiskSpaceMonitor> trigger)
      Sets the trigger class which made the decision
    • setThreshold

      public void setThreshold(long threshold)
    • getThreshold

      @Exported public long getThreshold()
    • setWarningThreshold

      public void setWarningThreshold(long warningThreshold)
    • getWarningThreshold

      @Exported public long getWarningThreshold()
    • getTrigger

      public Class<? extends AbstractDiskSpaceMonitor> getTrigger()
      Description copied from class: MonitorOfflineCause
      Identify monitor implementation that put computer offline.
      Specified by:
      getTrigger in class MonitorOfflineCause
    • parse

      public static DiskSpaceMonitorDescriptor.DiskSpace parse(String size) throws ParseException
      Parses a human readable size description like "1GB", "0.5m", "500KiB", etc. into DiskSpaceMonitorDescriptor.DiskSpace
      Throws:
      ParseException - If failed to parse.