Package no.digipost.api.client.internal
Class ApiServiceImpl
java.lang.Object
no.digipost.api.client.internal.ApiServiceImpl
- All Implemented Interfaces:
ArchiveApi
,BatchApi
,MessageDeliveryApi
,DocumentApi
,InboxApi
,SharedDocumentsApi
,TagApi
public class ApiServiceImpl
extends Object
implements MessageDeliveryApi, InboxApi, DocumentApi, ArchiveApi, BatchApi, TagApi, SharedDocumentsApi
-
Nested Class Summary
Nested classes/interfaces inherited from interface no.digipost.api.client.archive.ArchiveApi
ArchiveApi.ArchivingDocuments
-
Constructor Summary
ConstructorsConstructorDescriptionApiServiceImpl
(DigipostClientConfig config, org.apache.http.impl.client.HttpClientBuilder httpClientBuilder, BrokerId brokerId, Signer signer) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.http.client.methods.CloseableHttpResponse
addData
(AddDataLink addDataLink, AdditionalData data) Legger til ytterligere data til et dokument.void
addUniqueUUIDToArchiveDocument
(SenderId senderId, UUID uuid, UUID newuuid) void
cancelBatch
(Batch batch) completeBatch
(Batch batch) createBatch
(UUID batchUUID) createOrActivateUserAccount
(SenderId senderId, UserInformation user) void
deleteArchiveDocumentByUUID
(URI deleteArchiveDocumentUri) void
deleteInboxDocument
(InboxDocument inboxDocument) Delets the given document from the servergetArchiveDocument
(URI uri) getArchiveDocumentByUUID
(SenderId senderId, UUID uuid) getArchiveDocuments
(URI uri) getArchiveDocumentsByReferenceId
(SenderId senderId, String referenceId) Henter en liste av ArkivDokumenter med en gitt referanseIdgetArchives
(SenderId senderId) getBatchInformation
(UUID batchUUID) getDocumentContent
(String path) Retrieve the content of a document.getDocumentEvents
(String organisation, String partId, SenderId senderId, ZonedDateTime from, ZonedDateTime to, int offset, int maxResults) Henter hendelser knyttet til tidligere sendte brev.getDocumentStatus
(Link linkToDocumentStatus) Henter status på dokumeter som tidligere blitt sendt i Digipost, både via digital og print-kanal.getDocumentStatus
(SenderId senderId, UUID uuid) Henter status på dokumeter som tidligere blitt sendt i Digipost, både via digital og print-kanal.org.apache.http.client.methods.CloseableHttpResponse
Henter public krypteringsnøkkel i x509 format for forsendelser som skal sendes til print.org.apache.http.client.methods.CloseableHttpResponse
getEncryptionKey
(URI location) getEntryPoint
(SenderId senderId) Get documents from the inbox for the organisation represented by senderId.getInboxDocumentContentStream
(InboxDocument inboxDocument) Get the content of a document as a stream.getSenderInformation
(String orgnr, String avsenderenhet) Henter informasjon om en avsender.getSenderInformation
(MayHaveSender mayHaveSender) Henter informasjon om en faktisk avsender av en melding, altså det mottaker ser som avsender.getSenderInformation
(SenderId senderId) Henter informasjon om en avsender.Gets the content of a specific document as a link to view on Digipost's domain.Gets the content of a specific document as a stream of bytes.getShareDocumentsRequestState
(SenderId senderId, UUID shareDocumentsRequestUuid) Gets the current state for an existing ShareDocumentsRequest.getTags
(PersonalIdentificationNumber personalIdentificationNumber) org.apache.http.client.methods.CloseableHttpResponse
identifyAndGetEncryptionKey
(Identification identification) Sjekker hvis spesifisert mottaker er Digipost-bruker.org.apache.http.client.methods.CloseableHttpResponse
identifyRecipient
(Identification identification) void
saveArchiveDocument
(ArchiveDocument archiveDocument, URI uri) searchSuggest
(String searchString) org.apache.http.client.methods.CloseableHttpResponse
sendMultipartArchive
(org.apache.http.HttpEntity multipart) org.apache.http.client.methods.CloseableHttpResponse
sendMultipartMessage
(org.apache.http.HttpEntity multipart) Oppretter og sender en multipartforsendelseorg.apache.http.client.methods.CloseableHttpResponse
stopSharing
(SenderId senderId, URI uri) Stops the sharing, after which you will no longer have access to the shared documents
-
Constructor Details
-
ApiServiceImpl
public ApiServiceImpl(DigipostClientConfig config, org.apache.http.impl.client.HttpClientBuilder httpClientBuilder, BrokerId brokerId, Signer signer)
-
-
Method Details
-
getEntryPoint
-
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 interfaceMessageDeliveryApi
-
sendMultipartArchive
public org.apache.http.client.methods.CloseableHttpResponse sendMultipartArchive(org.apache.http.HttpEntity multipart) - Specified by:
sendMultipartArchive
in interfaceArchiveApi
-
getArchiveDocument
- Specified by:
getArchiveDocument
in interfaceArchiveApi
-
getArchiveDocumentContent
- Specified by:
getArchiveDocumentContent
in interfaceArchiveApi
-
getArchiveDocumentContentStream
- Specified by:
getArchiveDocumentContentStream
in interfaceArchiveApi
-
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 interfaceMessageDeliveryApi
-
getEncryptionKey
- Specified by:
getEncryptionKey
in interfaceMessageDeliveryApi
-
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 interfaceMessageDeliveryApi
-
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 interfaceMessageDeliveryApi
-
getDocumentEvents
public DocumentEvents getDocumentEvents(String organisation, String partId, SenderId senderId, ZonedDateTime from, ZonedDateTime to, int offset, int maxResults) Description copied from interface:DocumentApi
Henter hendelser knyttet til tidligere sendte brev.- Specified by:
getDocumentEvents
in interfaceDocumentApi
- Parameters:
organisation
- OrganisasjonsnummerpartId
- Frivillig organisasjons-enhet, kan værenull
-
getDocumentStatus
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 interfaceDocumentApi
-
getDocumentStatus
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 interfaceDocumentApi
-
getDocumentContent
Description copied from interface:DocumentApi
Retrieve the content of a document.- Specified by:
getDocumentContent
in interfaceDocumentApi
- Parameters:
path
- the path to the document resource- Returns:
- the bytes of the document
-
search
- Specified by:
search
in interfaceMessageDeliveryApi
-
searchSuggest
- Specified by:
searchSuggest
in interfaceMessageDeliveryApi
-
identifyRecipient
public org.apache.http.client.methods.CloseableHttpResponse identifyRecipient(Identification identification) - Specified by:
identifyRecipient
in interfaceMessageDeliveryApi
-
getSenderInformation
Description copied from interface:MessageDeliveryApi
Henter informasjon om en avsender.- Specified by:
getSenderInformation
in interfaceMessageDeliveryApi
- Parameters:
senderId
- id-en til avsenderen.
-
getSenderInformation
Description copied from interface:MessageDeliveryApi
Henter informasjon om en avsender. Avsender må ha godtatt å identifiseres med organisasjonsnummer og ev. underenhet.- Specified by:
getSenderInformation
in interfaceMessageDeliveryApi
- Parameters:
orgnr
- organisasjonsnummeret til avsenderen.avsenderenhet
- underenhet for et organisasjonsnummer.
-
getSenderInformation
Description copied from interface:MessageDeliveryApi
Henter informasjon om en faktisk avsender av en melding, altså det mottaker ser som avsender.- Specified by:
getSenderInformation
in interfaceMessageDeliveryApi
- Parameters:
mayHaveSender
- melding som skal sendes.
-
getArchives
- Specified by:
getArchives
in interfaceArchiveApi
-
getArchiveDocuments
- Specified by:
getArchiveDocuments
in interfaceArchiveApi
-
getArchiveDocumentsByReferenceId
Description copied from interface:ArchiveApi
Henter en liste av ArkivDokumenter med en gitt referanseId- Specified by:
getArchiveDocumentsByReferenceId
in interfaceArchiveApi
- Returns:
- En liste av arkiver som igjen holder en liste av arkivdokumenter med den gitte referanseID-en.
-
getArchiveDocumentByUUID
- Specified by:
getArchiveDocumentByUUID
in interfaceArchiveApi
-
deleteArchiveDocumentByUUID
- Specified by:
deleteArchiveDocumentByUUID
in interfaceArchiveApi
-
addUniqueUUIDToArchiveDocument
- Specified by:
addUniqueUUIDToArchiveDocument
in interfaceArchiveApi
-
saveArchiveDocument
- Specified by:
saveArchiveDocument
in interfaceArchiveApi
-
getInbox
Description copied from interface:InboxApi
Get documents from the inbox for the organisation represented by senderId.- Specified by:
getInbox
in interfaceInboxApi
- Parameters:
senderId
- Either an organisation that you operate on behalf of or your brokerIdoffset
- Number of documents to skip. For paginationlimit
- Maximum number of documents to retrieve (max 1000)- Returns:
- Inbox element with the n=limit first documents
-
getInboxDocumentContentStream
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 interfaceInboxApi
- Parameters:
inboxDocument
- The document to get content for- Returns:
- Entire content of the document as a stream
-
deleteInboxDocument
Description copied from interface:InboxApi
Delets the given document from the server- Specified by:
deleteInboxDocument
in interfaceInboxApi
- Parameters:
inboxDocument
- The document to delete
-
createOrActivateUserAccount
- Specified by:
createOrActivateUserAccount
in interfaceMessageDeliveryApi
-
createBatch
- Specified by:
createBatch
in interfaceBatchApi
-
getBatchInformation
- Specified by:
getBatchInformation
in interfaceBatchApi
-
completeBatch
- Specified by:
completeBatch
in interfaceBatchApi
-
cancelBatch
- Specified by:
cancelBatch
in interfaceBatchApi
-
addTag
-
removeTag
-
getTags
-
stopSharing
Description copied from interface:SharedDocumentsApi
Stops the sharing, after which you will no longer have access to the shared documents- Specified by:
stopSharing
in interfaceSharedDocumentsApi
uri
- The URI of the StopSharing relation returned as part of the ShareDocumentsRequestState
-