Class HttpTransportUtils

java.lang.Object
com.mulesoft.connectors.mcp.internal.util.HttpTransportUtils

public final class HttpTransportUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.mule.runtime.http.api.server.async.HttpResponseReadyCallback
    afterSent(org.mule.runtime.http.api.server.async.HttpResponseReadyCallback callback, Runnable runnable)
     
    asInboundRequestContext(io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage message, String sessionId, org.mule.runtime.http.api.domain.request.HttpRequestContext requestContext)
     
    createNewSessionRequest(MuleServerSession session, org.mule.runtime.http.api.domain.request.HttpRequestContext requestContext)
     
    static void
    discardAndClose(org.mule.runtime.http.api.domain.message.response.HttpResponse response)
     
    static String
    normalizePath(String path, String pathName)
    Normalizes the path making sure it starts with a '/'
    static io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage
    parseMessageFromBody(org.mule.runtime.http.api.domain.entity.HttpEntity entity)
     
    static io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage
    parseMessageFromBody(org.mule.runtime.http.api.domain.message.request.HttpRequest request)
     
    static io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage
    parseMessageFromBody(org.mule.runtime.http.api.domain.message.response.HttpResponse response)
     
    static void
    sendHttpInternalErrorResponse(Throwable t, io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage originalMessage, org.mule.runtime.http.api.server.async.HttpResponseReadyCallback responseCallback)
     
    static void
    sendHttpResponse(int statusCode, io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage message, org.mule.runtime.api.util.MultiMap<String,String> headers, org.mule.runtime.http.api.server.async.HttpResponseReadyCallback callback)
     
    static void
    sendHttpResponse(int statusCode, io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage message, org.mule.runtime.http.api.server.async.HttpResponseReadyCallback callback)
     
    static void
    sendHttpResponse(int statusCode, String body, org.mule.runtime.api.util.MultiMap<String,String> headers, org.mule.runtime.http.api.server.async.HttpResponseReadyCallback callback)
     
    static void
    sendHttpResponse(int statusCode, String body, org.mule.runtime.http.api.server.async.HttpResponseReadyCallback callback)
     
    static void
    sendHttpResponse(org.mule.runtime.http.api.domain.message.response.HttpResponse response, org.mule.runtime.http.api.server.async.HttpResponseReadyCallback callback)
     
    static void
    sendMessageEvent(org.mule.runtime.http.api.sse.server.SseClient client, io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage message)
     
    static void
    sendMessageEvent(org.mule.runtime.http.api.sse.server.SseClient client, String eventType, io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage message)
     
    static void
    sendMessageEvent(org.mule.runtime.http.api.sse.server.SseClient client, String eventType, String message)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • createNewSessionRequest

      public static InternalNewSessionRequest createNewSessionRequest(MuleServerSession session, org.mule.runtime.http.api.domain.request.HttpRequestContext requestContext)
    • asInboundRequestContext

      public static Optional<InboundRequestContext> asInboundRequestContext(io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage message, String sessionId, org.mule.runtime.http.api.domain.request.HttpRequestContext requestContext)
    • sendHttpResponse

      public static void sendHttpResponse(int statusCode, String body, org.mule.runtime.http.api.server.async.HttpResponseReadyCallback callback)
    • sendHttpResponse

      public static void sendHttpResponse(int statusCode, String body, org.mule.runtime.api.util.MultiMap<String,String> headers, org.mule.runtime.http.api.server.async.HttpResponseReadyCallback callback)
    • sendHttpResponse

      public static void sendHttpResponse(int statusCode, io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage message, org.mule.runtime.http.api.server.async.HttpResponseReadyCallback callback)
    • sendHttpResponse

      public static void sendHttpResponse(int statusCode, io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage message, org.mule.runtime.api.util.MultiMap<String,String> headers, org.mule.runtime.http.api.server.async.HttpResponseReadyCallback callback)
    • sendHttpResponse

      public static void sendHttpResponse(org.mule.runtime.http.api.domain.message.response.HttpResponse response, org.mule.runtime.http.api.server.async.HttpResponseReadyCallback callback)
    • sendHttpInternalErrorResponse

      public static void sendHttpInternalErrorResponse(Throwable t, io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage originalMessage, org.mule.runtime.http.api.server.async.HttpResponseReadyCallback responseCallback)
    • sendMessageEvent

      public static void sendMessageEvent(org.mule.runtime.http.api.sse.server.SseClient client, io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage message)
    • sendMessageEvent

      public static void sendMessageEvent(org.mule.runtime.http.api.sse.server.SseClient client, String eventType, io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage message)
    • sendMessageEvent

      public static void sendMessageEvent(org.mule.runtime.http.api.sse.server.SseClient client, String eventType, String message)
    • discardAndClose

      public static void discardAndClose(org.mule.runtime.http.api.domain.message.response.HttpResponse response)
    • afterSent

      public static org.mule.runtime.http.api.server.async.HttpResponseReadyCallback afterSent(org.mule.runtime.http.api.server.async.HttpResponseReadyCallback callback, Runnable runnable)
    • normalizePath

      public static String normalizePath(String path, String pathName)
      Normalizes the path making sure it starts with a '/'
      Parameters:
      path -
      pathName -
      Returns:
    • parseMessageFromBody

      public static io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage parseMessageFromBody(org.mule.runtime.http.api.domain.message.request.HttpRequest request) throws IOException
      Throws:
      IOException
    • parseMessageFromBody

      public static io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage parseMessageFromBody(org.mule.runtime.http.api.domain.message.response.HttpResponse response) throws IOException
      Throws:
      IOException
    • parseMessageFromBody

      public static io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage parseMessageFromBody(org.mule.runtime.http.api.domain.entity.HttpEntity entity) throws IOException
      Throws:
      IOException