Enum Class UploadState

java.lang.Object
java.lang.Enum<UploadState>
com.iizix.gyro.UploadState
All Implemented Interfaces:
Serializable, Comparable<UploadState>, Constable

public enum UploadState extends Enum<UploadState>
The states of one file inside an upload reservation, in the order they normally occur.

A file moves RESERVED → UPLOADING → COMPLETE → VERIFIED → CONSUMED; the three terminal states CONSUMED, FAILED and CANCELLED release the file's quota, and REFUSED is the state of a file the reservation never accepted. PAUSED is a detour from RESERVED or UPLOADING, taken by the App or by the client and left on resume.

Author:
Christopher Mindus
  • Enum Constant Details

    • RESERVED

      public static final UploadState RESERVED
      Accepted by the reservation, no byte received yet.
    • UPLOADING

      public static final UploadState UPLOADING
      At least one chunk has been received and acknowledged.
    • PAUSED

      public static final UploadState PAUSED
      Paused by the App or by the client, from RESERVED or UPLOADING; back to that state on resume. The servlet refuses chunks while the App holds the pause; the idle timeout is suspended and the maximum pause time runs instead. Not terminal.
    • COMPLETE

      public static final UploadState COMPLETE
      The last chunk has been received; verification has not run yet.
    • VERIFIED

      public static final UploadState VERIFIED
      Verified (type and size) and handed to the listener; still owned by the server.
    • CONSUMED

      public static final UploadState CONSUMED
      Ownership was taken by the API user, or the file was deleted by it; never swept. Terminal.
    • FAILED

      public static final UploadState FAILED
      Verification or the transfer failed; the file has been deleted. Terminal.
    • CANCELLED

      public static final UploadState CANCELLED
      Cancelled by the client, the App, a timeout or disposal; the file has been deleted. Terminal.
    • REFUSED

      public static final UploadState REFUSED
      Never accepted by the reservation (quota, size, type, count). Terminal.
  • Method Details

    • values

      public static UploadState[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static UploadState valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isTerminal

      public boolean isTerminal()
      Checks if the state is terminal, i.e. the file's quota has been released and no further transition happens.
      Returns:
      true for CONSUMED, FAILED, CANCELLED and REFUSED.