Search in sources :

Example 1 with ISBDHandlerService

use of com.helger.phase4.springboot.service.ISBDHandlerService in project phase4 by phax.

the class CustomPeppolIncomingSBDHandlerSPI method handleIncomingSBD.

public void handleIncomingSBD(@Nonnull final IAS4IncomingMessageMetadata aMessageMetadata, @Nonnull final HttpHeaderMap aHeaders, @Nonnull final Ebms3UserMessage aUserMessage, @Nonnull final byte[] aSBDBytes, @Nonnull final StandardBusinessDocument aSBD, @Nonnull final PeppolSBDHDocument aPeppolSBD, @Nonnull final IAS4MessageState aState) throws Exception {
    // Get the service from the locator
    LOGGER.info("Retrieving the handler service.");
    final ISBDHandlerService service = SDBHandlerServiceLocator.getService(ESBDHHandlerServiceSelector.CUSTOM_PEPPOL_INCOMING);
    LOGGER.info("Successfully retrieved the handler service.");
    // Inject the parameters into the service
    LOGGER.info("Injecting parameters into the handler service.");
    service.setMessageMetadata(aMessageMetadata);
    service.setHttpHeaders(aHeaders);
    service.setUserMessage(aUserMessage);
    service.setStandardBusinessDocumentBytes(aSBDBytes);
    service.setStandardBusinessDocument(aSBD);
    service.setPeppolStandardBusinessDocumentHeader(aPeppolSBD);
    service.setMessageState(aState);
    // Handle the request, might raise an exception that needs to be dealt
    // carefully
    LOGGER.info("Handling request.");
    service.handle();
    LOGGER.info("Request handled with success.");
}
Also used : ISBDHandlerService(com.helger.phase4.springboot.service.ISBDHandlerService)

Aggregations

ISBDHandlerService (com.helger.phase4.springboot.service.ISBDHandlerService)1