Interface DomibusConnectorClientRestAPI

  • All Known Implementing Classes:
    DomibusConnectorClientRestAPIImpl

    @RequestMapping("/restservice")
    public interface DomibusConnectorClientRestAPI
    This interface is a public interface for the domibusConnectorClient-Application to be approached from outside. It is used by the domibusConnectorClient-UI to connect to and exchange data with the application.
    Author:
    riederb
    • Field Detail

      • RESTSERVICE_PATH

        static final String RESTSERVICE_PATH
        This static String is the relative path where this REST service can be reached.
        See Also:
        Constant Field Values
    • Method Detail

      • getAllMessages

        @GetMapping("/getAllMessages")
        DomibusConnectorClientMessageList getAllMessages()
        Method to receive all messages stored in the database of the domibusConnectorClient-Application.
        Returns:
        An object holding a List of message objects.
      • getMessageById

        @GetMapping("/getMessageById")
        DomibusConnectorClientMessage getMessageById​(@RequestParam
                                                     Long id)
                                              throws MessageNotFoundException
        Method to receive a certain message stored in the domibusConnectorClient-Application database.
        Parameters:
        id - - the database id (technical key) of the message. Usually not used to display message data.
        Returns:
        The message object if id is present.
        Throws:
        MessageNotFoundException - if the message with the given id is not present.
      • getMessageByBackendMessageId

        @GetMapping("/getMessageByBackendMessageId")
        DomibusConnectorClientMessage getMessageByBackendMessageId​(@RequestParam
                                                                   String backendMessageId)
                                                            throws MessageNotFoundException
        Method to receive a certain message stored in the domibusConnectorClient-Application database.
        Parameters:
        backendMessageId - - the backend message id of the message.
        Returns:
        The message object if the backend message id is present.
        Throws:
        MessageNotFoundException - if the message with the given the backend message id is not present.
      • getMessageByEbmsMessageId

        @GetMapping("/getMessageByEbmsMessageId")
        DomibusConnectorClientMessage getMessageByEbmsMessageId​(@RequestParam
                                                                String ebmsMessageId)
                                                         throws MessageNotFoundException
        Method to receive a certain message stored in the domibusConnectorClient-Application database.
        Parameters:
        ebmsMessageId - - the ebmsMessageId of the message.
        Returns:
        The message object if the ebmsMessageId is present.
        Throws:
        MessageNotFoundException - if the message with the given ebmsMessageId is not present.
      • getMessagesByConversationId

        @GetMapping("/getMessagesByConversationId")
        DomibusConnectorClientMessageList getMessagesByConversationId​(@RequestParam
                                                                      String conversationId)
                                                               throws MessageNotFoundException
        Method to receive all messages from the conversation with the given id.
        Parameters:
        conversationId - - the conversationId of the conversation
        Returns:
        An object holding a List of message objects.
        Throws:
        MessageNotFoundException - if no message with the given conversationId is present.
      • getMessagesByPeriod

        @GetMapping("/getMessagesByPeriod")
        DomibusConnectorClientMessageList getMessagesByPeriod​(@RequestParam @DateTimeFormat(pattern="dd.MM.yyyy")
                                                              Date from,
                                                              @RequestParam @DateTimeFormat(pattern="dd.MM.yyyy")
                                                              Date to)
                                                       throws MessageNotFoundException
        Method to receive all messages within the given period.
        Parameters:
        from - - start date of the period
        to - - end date of the period
        Returns:
        An object holding a List of message objects.
        Throws:
        MessageNotFoundException - if no message in the given period is present.
      • loadFileContentFromStorage

        @GetMapping("/loadFileContentFromStorage")
        byte[] loadFileContentFromStorage​(@RequestParam
                                          String storageLocation,
                                          @RequestParam
                                          String fileName)
                                   throws ParameterException
        With this method a certain file from the configured storage can be loaded as bytes.
        Parameters:
        storageLocation - - The full path to the storage location where the file is stored.
        fileName - - The name of the file as it is stored within the storage.
        Returns:
        the bytes of the file if present.
        Throws:
        ParameterException - if the file cannot be found.
      • saveMessage

        @PostMapping(value="/saveMessage",
                     consumes="application/json",
                     produces="application/json")
        DomibusConnectorClientMessage saveMessage​(@RequestBody
                                                  DomibusConnectorClientMessage message)
                                           throws ParameterException,
                                                  StorageException
        With this method a message can either be created (if not done yet), or updated. This is for the data contained within the message object. It does not save message attachments such as files.
        Parameters:
        message - - The message object with the new data contained.
        Returns:
        The message object after the update happened. If the message is new it is enriched by the database id.
        Throws:
        ParameterException - if the message object was not filled properly.
        StorageException - if the message could not be stored in the storage.
      • uploadMessageFile

        @PostMapping(value="/uploadMessageFile",
                     consumes="application/json",
                     produces="application/json")
        Boolean uploadMessageFile​(@RequestBody
                                  DomibusConnectorClientMessageFile messageFile)
                           throws ParameterException,
                                  StorageException
        Method to add a new file to the message. The message needs to be saved already in the database.
        Parameters:
        messageFile - - The object holding all necessary information and the bytes of the file to be stored.
        Returns:
        A Boolean representing if the operation was successful.
        Throws:
        ParameterException - if the messageFile parameter was not sufficiently filled.
        StorageException - if there was an exception at storage level.
      • deleteMessageById

        @PostMapping(value="/deleteMessageById",
                     consumes="application/json",
                     produces="application/json")
        Boolean deleteMessageById​(@RequestBody
                                  Long id)
                           throws ParameterException,
                                  StorageException
        Deletes a message. The message is deleted from the database of the domibusConnectorClient-Application. Also in the storage the message is deleted.
        Parameters:
        id - - The database id (technical key) of the message to be deleted.
        Returns:
        A Boolean representing if the operation was successful.
        Throws:
        ParameterException - if the given id is not present.
        StorageException - if the stored storage location cannot be found or the stored message cannot be deleted.
      • submitStoredClientMessage

        @PostMapping(value="/submitStoredClientMessage",
                     consumes="application/json",
                     produces="application/json")
        Boolean submitStoredClientMessage​(@RequestBody
                                          DomibusConnectorClientMessage message)
                                   throws ParameterException,
                                          StorageException,
                                          MessageSubmissionException
        Method to submit an already stored and prepared message to the connector. To be successful the message needs to be prepared entirely. This method relies on the storage. So, the message to be submitted, is loaded entirely from the storage.
        Parameters:
        message - - The message object of the message to be submitted to the domibusConnector.
        Returns:
        A Boolean representing if the operation was successful.
        Throws:
        ParameterException - if the message cannot be found.
        StorageException - if the stored storage location cannot be found or the stored message cannot be loaded from storage.
        MessageSubmissionException - if an error occurred submitting the message.
      • deleteMessageFile

        @PostMapping(value="/deleteMessageFile",
                     consumes="application/json",
                     produces="application/json")
        Boolean deleteMessageFile​(@RequestBody
                                  DomibusConnectorClientMessageFile messageFile)
                           throws ParameterException,
                                  StorageException
        Deletes a file from a message. The file is deleted from the storage of the message.
        Parameters:
        messageFile - - The object holding all necessary information of the file to be deleted.
        Returns:
        A Boolean representing if the operation was successful.
        Throws:
        ParameterException - if the given file is not present.
        StorageException - if the stored storage location cannot be found or the stored file cannot be deleted.