Class CatalogRequestHttpDelegate

java.lang.Object
org.eclipse.edc.protocol.dsp.spi.dispatcher.DspHttpDispatcherDelegate<org.eclipse.edc.catalog.spi.CatalogRequestMessage,org.eclipse.edc.catalog.spi.Catalog>
org.eclipse.edc.protocol.dsp.catalog.dispatcher.delegate.CatalogRequestHttpDelegate

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

    Constructors
    Constructor
    Description
    CatalogRequestHttpDelegate(org.eclipse.edc.protocol.dsp.spi.serialization.JsonLdRemoteMessageSerializer serializer, com.fasterxml.jackson.databind.ObjectMapper mapper, org.eclipse.edc.transform.spi.TypeTransformerRegistry transformerRegistry, org.eclipse.edc.jsonld.spi.JsonLd jsonLdService)
     
  • 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,org.eclipse.edc.catalog.spi.Catalog>
    Parses the response to a catalog request.

    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

    • CatalogRequestHttpDelegate

      public CatalogRequestHttpDelegate(org.eclipse.edc.protocol.dsp.spi.serialization.JsonLdRemoteMessageSerializer serializer, com.fasterxml.jackson.databind.ObjectMapper mapper, org.eclipse.edc.transform.spi.TypeTransformerRegistry transformerRegistry, org.eclipse.edc.jsonld.spi.JsonLd jsonLdService)
  • 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,org.eclipse.edc.catalog.spi.Catalog>
    • 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,org.eclipse.edc.catalog.spi.Catalog>
      Parameters:
      message - the message
      Returns:
      the built okhttp request
    • parseResponse

      public Function<okhttp3.Response,org.eclipse.edc.catalog.spi.Catalog> parseResponse()
      Parses the response to a catalog request. The JSON-LD structure from the response body is expanded and then transformed to an EDC catalog.
      Specified by:
      parseResponse in class org.eclipse.edc.protocol.dsp.spi.dispatcher.DspHttpDispatcherDelegate<org.eclipse.edc.catalog.spi.CatalogRequestMessage,org.eclipse.edc.catalog.spi.Catalog>
      Returns:
      a function that transforms the response body to a catalog.