Class MultipartContractRejectionSender

  • All Implemented Interfaces:
    org.eclipse.dataspaceconnector.ids.core.message.IdsMessageSender<org.eclipse.dataspaceconnector.spi.types.domain.contract.negotiation.ContractRejection,​MultipartMessageProcessedResponse>

    public class MultipartContractRejectionSender
    extends java.lang.Object
    IdsMultipartSender implementation for contract rejections. Sends IDS ContractRequestMessages and expects an IDS RequestInProcessMessage as the response.
    • Constructor Summary

      Constructors 
      Constructor Description
      MultipartContractRejectionSender​(@NotNull java.lang.String connectorId, @NotNull okhttp3.OkHttpClient httpClient, @NotNull com.fasterxml.jackson.databind.ObjectMapper objectMapper, @NotNull org.eclipse.dataspaceconnector.spi.monitor.Monitor monitor, @NotNull org.eclipse.dataspaceconnector.spi.iam.IdentityService identityService, @NotNull org.eclipse.dataspaceconnector.ids.spi.transform.IdsTransformerRegistry transformerRegistry)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected de.fraunhofer.iais.eis.Message buildMessageHeader​(org.eclipse.dataspaceconnector.spi.types.domain.contract.negotiation.ContractRejection rejection, de.fraunhofer.iais.eis.DynamicAttributeToken token)
      Builds the IDS multipart header for the request.
      protected java.lang.String buildMessagePayload​(org.eclipse.dataspaceconnector.spi.types.domain.contract.negotiation.ContractRejection rejection)
      Builds the IDS multipart payload for the request.
      protected @NotNull java.net.URI getConnectorId()  
      protected @NotNull com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()  
      protected MultipartMessageProcessedResponse getResponseContent​(org.eclipse.dataspaceconnector.ids.api.multipart.dispatcher.sender.IdsMultipartParts parts)
      Reads and parses the IDS multipart response.
      protected @NotNull org.eclipse.dataspaceconnector.ids.spi.transform.IdsTransformerRegistry getTransformerRegistry()  
      java.lang.Class<org.eclipse.dataspaceconnector.spi.types.domain.contract.negotiation.ContractRejection> messageType()  
      protected java.lang.String retrieveRemoteConnectorAddress​(org.eclipse.dataspaceconnector.spi.types.domain.contract.negotiation.ContractRejection rejection)
      Returns the address of the recipient connector, which is the destination for the multipart message.
      java.util.concurrent.CompletableFuture<R> send​(M request, org.eclipse.dataspaceconnector.spi.message.MessageContext context)
      Builds and sends the IDS multipart request.
      • Methods inherited from class java.lang.Object

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

      • MultipartContractRejectionSender

        public MultipartContractRejectionSender​(@NotNull
                                                @NotNull java.lang.String connectorId,
                                                @NotNull
                                                @NotNull okhttp3.OkHttpClient httpClient,
                                                @NotNull
                                                @NotNull com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                                @NotNull
                                                @NotNull org.eclipse.dataspaceconnector.spi.monitor.Monitor monitor,
                                                @NotNull
                                                @NotNull org.eclipse.dataspaceconnector.spi.iam.IdentityService identityService,
                                                @NotNull
                                                @NotNull org.eclipse.dataspaceconnector.ids.spi.transform.IdsTransformerRegistry transformerRegistry)
    • Method Detail

      • messageType

        public java.lang.Class<org.eclipse.dataspaceconnector.spi.types.domain.contract.negotiation.ContractRejection> messageType()
      • retrieveRemoteConnectorAddress

        protected java.lang.String retrieveRemoteConnectorAddress​(org.eclipse.dataspaceconnector.spi.types.domain.contract.negotiation.ContractRejection rejection)
        Returns the address of the recipient connector, which is the destination for the multipart message.
        Parameters:
        rejection - the request.
        Returns:
        the recipient connector's address.
      • buildMessageHeader

        protected de.fraunhofer.iais.eis.Message buildMessageHeader​(org.eclipse.dataspaceconnector.spi.types.domain.contract.negotiation.ContractRejection rejection,
                                                                    de.fraunhofer.iais.eis.DynamicAttributeToken token)
                                                             throws java.lang.Exception
        Builds the IDS multipart header for the request.
        Parameters:
        rejection - the request.
        token - the dynamic attribute token.
        Returns:
        the message header.
        Throws:
        java.lang.Exception - if building the message header fails.
      • buildMessagePayload

        protected java.lang.String buildMessagePayload​(org.eclipse.dataspaceconnector.spi.types.domain.contract.negotiation.ContractRejection rejection)
                                                throws java.lang.Exception
        Builds the IDS multipart payload for the request.
        Parameters:
        rejection - the request.
        Returns:
        the message payload.
        Throws:
        java.lang.Exception - if building the message payload fails.
      • getResponseContent

        protected MultipartMessageProcessedResponse getResponseContent​(org.eclipse.dataspaceconnector.ids.api.multipart.dispatcher.sender.IdsMultipartParts parts)
                                                                throws java.lang.Exception
        Reads and parses the IDS multipart response.
        Parameters:
        parts - container object for response header and payload InputStreams.
        Returns:
        an instance of the sub class's return type.
        Throws:
        java.lang.Exception - if parsing the response fails.
      • send

        public java.util.concurrent.CompletableFuture<R> send​(M request,
                                                              org.eclipse.dataspaceconnector.spi.message.MessageContext context)
        Builds and sends the IDS multipart request. Reads header and payload as InputStream from the multipart response.
        Specified by:
        send in interface org.eclipse.dataspaceconnector.ids.core.message.IdsMessageSender<M extends org.eclipse.dataspaceconnector.spi.types.domain.message.RemoteMessage,​R>
        Parameters:
        request - the request.
        context - the message context.
        Returns:
        the response as CompletableFuture.
      • getTransformerRegistry

        @NotNull
        protected @NotNull org.eclipse.dataspaceconnector.ids.spi.transform.IdsTransformerRegistry getTransformerRegistry()
      • getObjectMapper

        @NotNull
        protected @NotNull com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      • getConnectorId

        @NotNull
        protected @NotNull java.net.URI getConnectorId()