Class ApiServiceImpl

    • Constructor Detail

      • ApiServiceImpl

        public ApiServiceImpl​(DigipostClientConfig config,
                              org.apache.http.impl.client.HttpClientBuilder httpClientBuilder,
                              BrokerId brokerId,
                              Signer signer)
    • Method Detail

      • getEntryPoint

        public EntryPoint getEntryPoint()
      • sendMultipartMessage

        public org.apache.http.client.methods.CloseableHttpResponse sendMultipartMessage​(org.apache.http.HttpEntity multipart)
        Description copied from interface: MessageDeliveryApi
        Oppretter og sender en multipartforsendelse
        Specified by:
        sendMultipartMessage in interface MessageDeliveryApi
      • identifyAndGetEncryptionKey

        public org.apache.http.client.methods.CloseableHttpResponse identifyAndGetEncryptionKey​(Identification identification)
        Description copied from interface: MessageDeliveryApi
        Sjekker hvis spesifisert mottaker er Digipost-bruker. Returnerer då også publik del av krypteringsnøkkel for Digipost-bruker. Nøkkelen brukes for å kryptere dokument-innhold for dokumenter som skal prekrypteres.
        Specified by:
        identifyAndGetEncryptionKey in interface MessageDeliveryApi
      • getEncryptionCertificateForPrint

        public org.apache.http.client.methods.CloseableHttpResponse getEncryptionCertificateForPrint()
        Description copied from interface: MessageDeliveryApi
        Henter public krypteringsnøkkel i x509 format for forsendelser som skal sendes til print.
        Specified by:
        getEncryptionCertificateForPrint in interface MessageDeliveryApi
      • addData

        public org.apache.http.client.methods.CloseableHttpResponse addData​(AddDataLink addDataLink,
                                                                            AdditionalData data)
        Description copied from interface: MessageDeliveryApi
        Legger til ytterligere data til et dokument. Det er en forutsetning at dokumentet har datatype fra tidligere.
        Specified by:
        addData in interface MessageDeliveryApi
      • getDocumentStatus

        public DocumentStatus getDocumentStatus​(Link linkToDocumentStatus)
        Description copied from interface: DocumentApi
        Henter status på dokumeter som tidligere blitt sendt i Digipost, både via digital og print-kanal.
        Specified by:
        getDocumentStatus in interface DocumentApi
      • getDocumentContent

        public InputStream getDocumentContent​(String path)
        Description copied from interface: DocumentApi
        Retrieve the content of a document.
        Specified by:
        getDocumentContent in interface DocumentApi
        Parameters:
        path - the path to the document resource
        Returns:
        the bytes of the document
      • getSenderInformation

        public SenderInformation getSenderInformation​(String orgnr,
                                                      String avsenderenhet)
        Description copied from interface: MessageDeliveryApi
        Henter informasjon om en avsender. Avsender må ha godtatt å identifiseres med organisasjonsnummer og ev. underenhet.
        Specified by:
        getSenderInformation in interface MessageDeliveryApi
        Parameters:
        orgnr - organisasjonsnummeret til avsenderen.
        avsenderenhet - underenhet for et organisasjonsnummer.
      • getInbox

        public Inbox getInbox​(SenderId senderId,
                              int offset,
                              int limit)
        Description copied from interface: InboxApi
        Get documents from the inbox for the organisation represented by senderId.
        Specified by:
        getInbox in interface InboxApi
        Parameters:
        senderId - Either an organisation that you operate on behalf of or your brokerId
        offset - Number of documents to skip. For pagination
        limit - Maximum number of documents to retrieve (max 1000)
        Returns:
        Inbox element with the n=limit first documents
      • getInboxDocumentContentStream

        public InputStream getInboxDocumentContentStream​(InboxDocument inboxDocument)
        Description copied from interface: InboxApi
        Get the content of a document as a stream. The content is streamed from the server so remember to close the stream to prevent connection leaks.
        Specified by:
        getInboxDocumentContentStream in interface InboxApi
        Parameters:
        inboxDocument - The document to get content for
        Returns:
        Entire content of the document as a stream
      • deleteInboxDocument

        public void deleteInboxDocument​(InboxDocument inboxDocument)
        Description copied from interface: InboxApi
        Delets the given document from the server
        Specified by:
        deleteInboxDocument in interface InboxApi
        Parameters:
        inboxDocument - The document to delete