Class CatalogRequestHttpRawDelegate

java.lang.Object
org.eclipse.edc.protocol.dsp.spi.dispatcher.DspHttpDispatcherDelegate<org.eclipse.edc.catalog.spi.CatalogRequestMessage,byte[]>
org.eclipse.edc.protocol.dsp.catalog.dispatcher.delegate.CatalogRequestHttpRawDelegate

public class CatalogRequestHttpRawDelegate extends org.eclipse.edc.protocol.dsp.spi.dispatcher.DspHttpDispatcherDelegate<org.eclipse.edc.catalog.spi.CatalogRequestMessage,byte[]>
Delegate for dispatching catalog requests as defined in the dataspace protocol specification
  • Constructor Summary

    Constructors
    Constructor
    Description
    CatalogRequestHttpRawDelegate(org.eclipse.edc.protocol.dsp.spi.serialization.JsonLdRemoteMessageSerializer serializer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    okhttp3.Request
    buildRequest(org.eclipse.edc.catalog.spi.CatalogRequestMessage message)
    Sends a catalog request.
    Class<org.eclipse.edc.catalog.spi.CatalogRequestMessage>
     
    Function<okhttp3.Response,byte[]>
    Parses the response to a byte[].

    Methods inherited from class org.eclipse.edc.protocol.dsp.spi.dispatcher.DspHttpDispatcherDelegate

    buildRequest, handleResponse

    Methods inherited from class java.lang.Object

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

    • CatalogRequestHttpRawDelegate

      public CatalogRequestHttpRawDelegate(org.eclipse.edc.protocol.dsp.spi.serialization.JsonLdRemoteMessageSerializer serializer)
  • Method Details

    • getMessageType

      public Class<org.eclipse.edc.catalog.spi.CatalogRequestMessage> getMessageType()
      Specified by:
      getMessageType in class org.eclipse.edc.protocol.dsp.spi.dispatcher.DspHttpDispatcherDelegate<org.eclipse.edc.catalog.spi.CatalogRequestMessage,byte[]>
    • buildRequest

      public okhttp3.Request buildRequest(org.eclipse.edc.catalog.spi.CatalogRequestMessage message)
      Sends a catalog request. The request body is constructed as defined in the dataspace protocol implementation. The request is sent to the remote component using the path from the specification.
      Specified by:
      buildRequest in class org.eclipse.edc.protocol.dsp.spi.dispatcher.DspHttpDispatcherDelegate<org.eclipse.edc.catalog.spi.CatalogRequestMessage,byte[]>
      Parameters:
      message - the message
      Returns:
      the built okhttp request
    • parseResponse

      public Function<okhttp3.Response,byte[]> parseResponse()
      Parses the response to a byte[]. It cannot return a InputStream because the response gets closed by the EdcHttpClient
      Specified by:
      parseResponse in class org.eclipse.edc.protocol.dsp.spi.dispatcher.DspHttpDispatcherDelegate<org.eclipse.edc.catalog.spi.CatalogRequestMessage,byte[]>
      Returns:
      a function that transforms the response body to a JsonObject.