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
,TagApi
public class ApiServiceImpl extends Object implements MessageDeliveryApi, InboxApi, DocumentApi, ArchiveApi, BatchApi, TagApi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface no.digipost.api.client.archive.ArchiveApi
ArchiveApi.ArchivingDocuments
-
-
Constructor Summary
Constructors Constructor Description ApiServiceImpl(DigipostClientConfig config, org.apache.http.impl.client.HttpClientBuilder httpClientBuilder, BrokerId brokerId, Signer signer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.http.client.methods.CloseableHttpResponse
addData(AddDataLink addDataLink, AdditionalData data)
Legger til ytterligere data til et dokument.void
addTag(Tag tag)
Archive
addUniqueUUIDToArchiveDocument(SenderId senderId, UUID uuid, UUID newuuid)
void
cancelBatch(Batch batch)
Batch
completeBatch(Batch batch)
Batch
createBatch(UUID batchUUID)
UserAccount
createOrActivateUserAccount(SenderId senderId, UserInformation user)
void
deleteArchiveDocumentByUUID(URI deleteArchiveDocumentUri)
void
deleteInboxDocument(InboxDocument inboxDocument)
Delets the given document from the serverArchive
getArchiveDocument(URI uri)
Archive
getArchiveDocumentByUUID(SenderId senderId, UUID uuid)
ArchiveDocumentContent
getArchiveDocumentContent(URI uri)
InputStream
getArchiveDocumentContentStream(URI uri)
Archive
getArchiveDocuments(URI uri)
Archives
getArchiveDocumentsByReferenceId(SenderId senderId, String referenceId)
Henter en liste av ArkivDokumenter med en gitt referanseIdArchives
getArchives(SenderId senderId)
Batch
getBatchInformation(UUID batchUUID)
InputStream
getDocumentContent(String path)
Retrieve the content of a document.DocumentEvents
getDocumentEvents(String organisation, String partId, SenderId senderId, ZonedDateTime from, ZonedDateTime to, int offset, int maxResults)
Henter hendelser knyttet til tidligere sendte brev.DocumentStatus
getDocumentStatus(Link linkToDocumentStatus)
Henter status på dokumeter som tidligere blitt sendt i Digipost, både via digital og print-kanal.DocumentStatus
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
getEncryptionCertificateForPrint()
Henter public krypteringsnøkkel i x509 format for forsendelser som skal sendes til print.org.apache.http.client.methods.CloseableHttpResponse
getEncryptionKey(URI location)
EntryPoint
getEntryPoint()
EntryPoint
getEntryPoint(SenderId senderId)
Inbox
getInbox(SenderId senderId, int offset, int limit)
Get documents from the inbox for the organisation represented by senderId.InputStream
getInboxDocumentContentStream(InboxDocument inboxDocument)
Get the content of a document as a stream.SenderInformation
getSenderInformation(String orgnr, String avsenderenhet)
Henter informasjon om en avsender.SenderInformation
getSenderInformation(MayHaveSender mayHaveSender)
Henter informasjon om en faktisk avsender av en melding, altså det mottaker ser som avsender.SenderInformation
getSenderInformation(SenderId senderId)
Henter informasjon om en avsender.Tags
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
removeTag(Tag tag)
ArchiveDocument
saveArchiveDocument(ArchiveDocument archiveDocument, URI uri)
Recipients
search(String searchString)
Autocomplete
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 multipartforsendelse
-
-
-
Constructor Detail
-
ApiServiceImpl
public ApiServiceImpl(DigipostClientConfig config, org.apache.http.impl.client.HttpClientBuilder httpClientBuilder, BrokerId brokerId, Signer signer)
-
-
Method Detail
-
getEntryPoint
public EntryPoint getEntryPoint(SenderId senderId)
-
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 interfaceMessageDeliveryApi
-
sendMultipartArchive
public org.apache.http.client.methods.CloseableHttpResponse sendMultipartArchive(org.apache.http.HttpEntity multipart)
- Specified by:
sendMultipartArchive
in interfaceArchiveApi
-
getArchiveDocument
public Archive getArchiveDocument(URI uri)
- Specified by:
getArchiveDocument
in interfaceArchiveApi
-
getArchiveDocumentContent
public ArchiveDocumentContent getArchiveDocumentContent(URI uri)
- Specified by:
getArchiveDocumentContent
in interfaceArchiveApi
-
getArchiveDocumentContentStream
public InputStream getArchiveDocumentContentStream(URI uri)
- 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
public org.apache.http.client.methods.CloseableHttpResponse getEncryptionKey(URI location)
- 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
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 interfaceDocumentApi
-
getDocumentStatus
public DocumentStatus getDocumentStatus(SenderId senderId, UUID uuid)
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
public InputStream getDocumentContent(String path)
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
public Recipients search(String searchString)
- Specified by:
search
in interfaceMessageDeliveryApi
-
searchSuggest
public Autocomplete searchSuggest(String searchString)
- Specified by:
searchSuggest
in interfaceMessageDeliveryApi
-
identifyRecipient
public org.apache.http.client.methods.CloseableHttpResponse identifyRecipient(Identification identification)
- Specified by:
identifyRecipient
in interfaceMessageDeliveryApi
-
getSenderInformation
public SenderInformation getSenderInformation(SenderId senderId)
Description copied from interface:MessageDeliveryApi
Henter informasjon om en avsender.- Specified by:
getSenderInformation
in interfaceMessageDeliveryApi
- Parameters:
senderId
- id-en til avsenderen.
-
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 interfaceMessageDeliveryApi
- Parameters:
orgnr
- organisasjonsnummeret til avsenderen.avsenderenhet
- underenhet for et organisasjonsnummer.
-
getSenderInformation
public SenderInformation getSenderInformation(MayHaveSender mayHaveSender)
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
public Archives getArchives(SenderId senderId)
- Specified by:
getArchives
in interfaceArchiveApi
-
getArchiveDocuments
public Archive getArchiveDocuments(URI uri)
- Specified by:
getArchiveDocuments
in interfaceArchiveApi
-
getArchiveDocumentsByReferenceId
public Archives getArchiveDocumentsByReferenceId(SenderId senderId, String referenceId)
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
public Archive getArchiveDocumentByUUID(SenderId senderId, UUID uuid)
- Specified by:
getArchiveDocumentByUUID
in interfaceArchiveApi
-
deleteArchiveDocumentByUUID
public void deleteArchiveDocumentByUUID(URI deleteArchiveDocumentUri)
- Specified by:
deleteArchiveDocumentByUUID
in interfaceArchiveApi
-
addUniqueUUIDToArchiveDocument
public Archive addUniqueUUIDToArchiveDocument(SenderId senderId, UUID uuid, UUID newuuid)
- Specified by:
addUniqueUUIDToArchiveDocument
in interfaceArchiveApi
-
saveArchiveDocument
public ArchiveDocument saveArchiveDocument(ArchiveDocument archiveDocument, URI uri)
- Specified by:
saveArchiveDocument
in interfaceArchiveApi
-
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 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
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 interfaceInboxApi
- 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 interfaceInboxApi
- Parameters:
inboxDocument
- The document to delete
-
createOrActivateUserAccount
public UserAccount createOrActivateUserAccount(SenderId senderId, UserInformation user)
- Specified by:
createOrActivateUserAccount
in interfaceMessageDeliveryApi
-
createBatch
public Batch createBatch(UUID batchUUID)
- Specified by:
createBatch
in interfaceBatchApi
-
getBatchInformation
public Batch getBatchInformation(UUID batchUUID)
- Specified by:
getBatchInformation
in interfaceBatchApi
-
completeBatch
public Batch completeBatch(Batch batch)
- Specified by:
completeBatch
in interfaceBatchApi
-
cancelBatch
public void cancelBatch(Batch batch)
- Specified by:
cancelBatch
in interfaceBatchApi
-
getTags
public Tags getTags(PersonalIdentificationNumber personalIdentificationNumber)
-
-