Class TransportActionProxy


  • public final class TransportActionProxy
    extends java.lang.Object
    TransportActionProxy allows an arbitrary action to be executed on a defined target node while the initial request is sent to a second node that acts as a request proxy to the target node. This is useful if a node is not directly connected to a target node but is connected to an intermediate node that establishes a transitive connection.
    • Method Detail

      • registerProxyActionWithDynamicResponseType

        public static void registerProxyActionWithDynamicResponseType​(TransportService service,
                                                                      java.lang.String action,
                                                                      java.util.function.Function<TransportRequest,​Writeable.Reader<? extends TransportResponse>> responseFunction)
        Registers a proxy request handler that allows to forward requests for the given action to another node. To be used when the response type changes based on the upcoming request (quite rare)
      • registerProxyAction

        public static void registerProxyAction​(TransportService service,
                                               java.lang.String action,
                                               Writeable.Reader<? extends TransportResponse> reader)
        Registers a proxy request handler that allows to forward requests for the given action to another node. To be used when the response type is always the same (most of the cases).
      • getProxyAction

        public static java.lang.String getProxyAction​(java.lang.String action)
        Returns the corresponding proxy action for the given action
      • unwrapAction

        public static java.lang.String unwrapAction​(java.lang.String action)
        Unwraps a proxy action and returns the underlying action
      • isProxyAction

        public static boolean isProxyAction​(java.lang.String action)
        Returns true iff the given action is a proxy action
      • isProxyRequest

        public static boolean isProxyRequest​(TransportRequest request)
        Returns true iff the given request is a proxy request