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
ConstructorsConstructorDescriptionCatalogRequestHttpRawDelegate(org.eclipse.edc.protocol.dsp.spi.serialization.JsonLdRemoteMessageSerializer serializer) -
Method Summary
Modifier and TypeMethodDescriptionokhttp3.RequestbuildRequest(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
-
Constructor Details
-
CatalogRequestHttpRawDelegate
public CatalogRequestHttpRawDelegate(org.eclipse.edc.protocol.dsp.spi.serialization.JsonLdRemoteMessageSerializer serializer)
-
-
Method Details
-
getMessageType
- Specified by:
getMessageTypein classorg.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:
buildRequestin classorg.eclipse.edc.protocol.dsp.spi.dispatcher.DspHttpDispatcherDelegate<org.eclipse.edc.catalog.spi.CatalogRequestMessage,byte[]> - Parameters:
message- the message- Returns:
- the built okhttp request
-
parseResponse
Parses the response to a byte[]. It cannot return aInputStreambecause the response gets closed by theEdcHttpClient- Specified by:
parseResponsein classorg.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.
-