Package io.muserver

Enum ResponseState

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ResponseState>

    public enum ResponseState
    extends java.lang.Enum<ResponseState>
    The state of a response
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CLIENT_DISCONNECTED
      The client disconnected before the full request and response was completed.
      ERRORED
      An error (such as an unhandled exception in a callback) occurred before the exchange was completed.
      FINISHED
      The full response was streamed to the client
      FINISHING
      Completion initiated.
      FULL_SENT
      A non-chunked response has been successfully sent to the client
      NOTHING
      Nothing has started yet
      STREAMING
      Response body has started streaming, but is not complete
      TIMED_OUT
      The idle timeout (as specified in MuServerBuilder.withIdleTimeout(long, TimeUnit)) occurred and so the response was cancelled early.
      UPGRADED
      Upgraded successfully to a websocket
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean completedSuccessfully()  
      boolean endState()  
      static ResponseState valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ResponseState[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NOTHING

        public static final ResponseState NOTHING
        Nothing has started yet
      • FULL_SENT

        public static final ResponseState FULL_SENT
        A non-chunked response has been successfully sent to the client
      • STREAMING

        public static final ResponseState STREAMING
        Response body has started streaming, but is not complete
      • FINISHING

        public static final ResponseState FINISHING
        Completion initiated. The final response part is being sent to the client.
      • FINISHED

        public static final ResponseState FINISHED
        The full response was streamed to the client
      • ERRORED

        public static final ResponseState ERRORED
        An error (such as an unhandled exception in a callback) occurred before the exchange was completed.
      • CLIENT_DISCONNECTED

        public static final ResponseState CLIENT_DISCONNECTED
        The client disconnected before the full request and response was completed.
      • UPGRADED

        public static final ResponseState UPGRADED
        Upgraded successfully to a websocket
    • Method Detail

      • values

        public static ResponseState[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ResponseState c : ResponseState.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ResponseState valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • endState

        public boolean endState()
        Returns:
        True if the request and response has finished, either successfully or not.
      • completedSuccessfully

        public boolean completedSuccessfully()
        Returns:
        True if the full response was sent to the client with no unexpected errors.