Enum ExecutionPhase

  • All Implemented Interfaces:
    Serializable, Comparable<ExecutionPhase>

    public enum ExecutionPhase
    extends Enum<ExecutionPhase>
    An execution phase allows knowing in which phase of the whole request processing a given action occurs. The execution phase is mainly useful during the flow and policy chain executions.
                                              ____________________________________________________
          ______________       request       |                       GATEWAY                      |      request        ______________
         |              |   ------------->   |                                                    |   ------------->   |              |
         |  DOWNSTREAM  |                    |  ----------- REQUEST / ASYNC_REQUEST  -----------> |                    |   UPSTREAM   |
         |   (client)   |   <-------------   |  <---------- RESPONSE / ASYNC_RESPONSE ----------- |   <-------------   |  (endpoint)  |
         |______________|      response      |                                                    |      response      |______________|
                                             |____________________________________________________|
     
    Author:
    Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com), GraviteeSource Team
    • Enum Constant Detail

      • REQUEST

        public static final ExecutionPhase REQUEST
        This phase represents the actions occurring from the downstream to the upstream in a sync execution context.
                                                  ______________________________
              ______________                     |            GATEWAY           |                     ______________
             |              |      request       |                              |      request       |              |
             |  DOWNSTREAM  |   ------------->   |  -------- REQUEST ---------> |   ------------->   |   UPSTREAM   |
             |   (client)   |                    |                              |                    |  (endpoint)  |
             |______________|                    |______________________________|                    |______________|
        
         
        For an HTTP request, it represents the policies executed before the endpoint is invoked by the gateway.
      • ASYNC_REQUEST

        public static final ExecutionPhase ASYNC_REQUEST
        This phase represents the actions occurring from the downstream to the upstream in an async execution context.
                                                  ______________________________
              ______________                     |            GATEWAY           |                     ______________
             |              |      request       |                              |      request       |              |
             |  DOWNSTREAM  |   ------------->   |  ----- ASYNC_REQUEST ------> |   ------------->   |   UPSTREAM   |
             |   (client)   |                    |                              |                    |  (endpoint)  |
             |______________|                    |______________________________|                    |______________|
        
         
      • RESPONSE

        public static final ExecutionPhase RESPONSE
        This phase represents the actions occurring from the upstream to the downstream in a sync execution context.
                                                  ______________________________
              ______________                     |            GATEWAY           |                     ______________
             |              |      response      |                              |      response      |              |
             |  DOWNSTREAM  |   <-------------   |  <------- RESPONSE --------- |   <-------------   |   UPSTREAM   |
             |   (client)   |                    |                              |                    |  (endpoint)  |
             |______________|                    |______________________________|                    |______________|
        
         
        For an HTTP request, it represents the policies executed after the endpoint has been invoked by the gateway.
      • ASYNC_RESPONSE

        public static final ExecutionPhase ASYNC_RESPONSE
        This phase represents the actions occurring from the upstream to the downstream in an async execution context.
                                                  ______________________________
              ______________                     |            GATEWAY           |                     ______________
             |              |      response      |                              |      response      |              |
             |  DOWNSTREAM  |   <-------------   |  <---- ASYNC_RESPONSE ------ |   <-------------   |   UPSTREAM   |
             |   (client)   |                    |                              |                    |  (endpoint)  |
             |______________|                    |______________________________|                    |______________|
        
         
    • Method Detail

      • values

        public static ExecutionPhase[] 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 (ExecutionPhase c : ExecutionPhase.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ExecutionPhase valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getLabel

        public String getLabel()