Package no.digipost.api.client.internal
Class ApiServiceImpl
- java.lang.Object
-
- no.digipost.api.client.internal.ApiServiceImpl
-
- All Implemented Interfaces:
ArchiveApi,MessageDeliveryApi,DocumentApi,InboxApi
public class ApiServiceImpl extends Object implements MessageDeliveryApi, InboxApi, DocumentApi, ArchiveApi
-
-
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.CloseableHttpResponseaddData(AddDataLink addDataLink, AdditionalData data)Legger til ytterligere data til et dokument.ArchiveaddUniqueUUIDToArchiveDocument(SenderId senderId, UUID uuid, UUID newuuid)UserAccountcreateOrActivateUserAccount(SenderId senderId, UserInformation user)voiddeleteArchiveDocumentByUUID(ArchiveDocument archiveDocument)voiddeleteInboxDocument(InboxDocument inboxDocument)Delets the given document from the serverArchivegetArchiveDocument(URI uri)ArchivegetArchiveDocumentByUUID(SenderId senderId, UUID uuid)ArchiveDocumentContentgetArchiveDocumentContent(URI uri)InputStreamgetArchiveDocumentContentStream(URI uri)ArchivegetArchiveDocuments(URI uri)ArchivesgetArchiveDocumentsByReferenceId(SenderId senderId, String referenceId)Henter en liste av ArkivDokumenter med en gitt referanseIdArchivesgetArchives(SenderId senderId)InputStreamgetDocumentContent(String path)Retrieve the content of a document.DocumentEventsgetDocumentEvents(String organisation, String partId, ZonedDateTime from, ZonedDateTime to, int offset, int maxResults)Henter hendelser knyttet til tidligere sendte brev.DocumentStatusgetDocumentStatus(Link linkToDocumentStatus)Henter status på dokumeter som tidligere blitt sendt i Digipost, både via digital og print-kanal.DocumentStatusgetDocumentStatus(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.CloseableHttpResponsegetEncryptionCertificateForPrint()Henter public krypteringsnøkkel i x509 format for forsendelser som skal sendes til print.org.apache.http.client.methods.CloseableHttpResponsegetEncryptionKey(URI location)EntryPointgetEntryPoint()EntryPointgetEntryPoint(SenderId senderId)InboxgetInbox(SenderId senderId, int offset, int limit)Get documents from the inbox for the organisation represented by senderId.InputStreamgetInboxDocumentContentStream(InboxDocument inboxDocument)Get the content of a document as a stream.SenderInformationgetSenderInformation(String orgnr, String avsenderenhet)Henter informasjon om en avsender.SenderInformationgetSenderInformation(MayHaveSender mayHaveSender)Henter informasjon om en faktisk avsender av en melding, altså det mottaker ser som avsender.SenderInformationgetSenderInformation(SenderId senderId)Henter informasjon om en avsender.org.apache.http.client.methods.CloseableHttpResponseidentifyAndGetEncryptionKey(Identification identification)Sjekker hvis spesifisert mottaker er Digipost-bruker.org.apache.http.client.methods.CloseableHttpResponseidentifyRecipient(Identification identification)Recipientssearch(String searchString)AutocompletesearchSuggest(String searchString)org.apache.http.client.methods.CloseableHttpResponsesendMultipartArchive(org.apache.http.HttpEntity multipart)org.apache.http.client.methods.CloseableHttpResponsesendMultipartMessage(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:MessageDeliveryApiOppretter og sender en multipartforsendelse- Specified by:
sendMultipartMessagein interfaceMessageDeliveryApi
-
sendMultipartArchive
public org.apache.http.client.methods.CloseableHttpResponse sendMultipartArchive(org.apache.http.HttpEntity multipart)
- Specified by:
sendMultipartArchivein interfaceArchiveApi
-
getArchiveDocument
public Archive getArchiveDocument(URI uri)
- Specified by:
getArchiveDocumentin interfaceArchiveApi
-
getArchiveDocumentContent
public ArchiveDocumentContent getArchiveDocumentContent(URI uri)
- Specified by:
getArchiveDocumentContentin interfaceArchiveApi
-
getArchiveDocumentContentStream
public InputStream getArchiveDocumentContentStream(URI uri)
- Specified by:
getArchiveDocumentContentStreamin interfaceArchiveApi
-
identifyAndGetEncryptionKey
public org.apache.http.client.methods.CloseableHttpResponse identifyAndGetEncryptionKey(Identification identification)
Description copied from interface:MessageDeliveryApiSjekker 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:
identifyAndGetEncryptionKeyin interfaceMessageDeliveryApi
-
getEncryptionKey
public org.apache.http.client.methods.CloseableHttpResponse getEncryptionKey(URI location)
- Specified by:
getEncryptionKeyin interfaceMessageDeliveryApi
-
getEncryptionCertificateForPrint
public org.apache.http.client.methods.CloseableHttpResponse getEncryptionCertificateForPrint()
Description copied from interface:MessageDeliveryApiHenter public krypteringsnøkkel i x509 format for forsendelser som skal sendes til print.- Specified by:
getEncryptionCertificateForPrintin interfaceMessageDeliveryApi
-
addData
public org.apache.http.client.methods.CloseableHttpResponse addData(AddDataLink addDataLink, AdditionalData data)
Description copied from interface:MessageDeliveryApiLegger til ytterligere data til et dokument. Det er en forutsetning at dokumentet har datatype fra tidligere.- Specified by:
addDatain interfaceMessageDeliveryApi
-
getDocumentEvents
public DocumentEvents getDocumentEvents(String organisation, String partId, ZonedDateTime from, ZonedDateTime to, int offset, int maxResults)
Description copied from interface:DocumentApiHenter hendelser knyttet til tidligere sendte brev.- Specified by:
getDocumentEventsin interfaceDocumentApi- Parameters:
organisation- OrganisasjonsnummerpartId- Frivillig organisasjons-enhet, kan værenull
-
getDocumentStatus
public DocumentStatus getDocumentStatus(Link linkToDocumentStatus)
Description copied from interface:DocumentApiHenter status på dokumeter som tidligere blitt sendt i Digipost, både via digital og print-kanal.- Specified by:
getDocumentStatusin interfaceDocumentApi
-
getDocumentStatus
public DocumentStatus getDocumentStatus(SenderId senderId, UUID uuid)
Description copied from interface:DocumentApiHenter status på dokumeter som tidligere blitt sendt i Digipost, både via digital og print-kanal.- Specified by:
getDocumentStatusin interfaceDocumentApi
-
getDocumentContent
public InputStream getDocumentContent(String path)
Description copied from interface:DocumentApiRetrieve the content of a document.- Specified by:
getDocumentContentin interfaceDocumentApi- Parameters:
path- the path to the document resource- Returns:
- the bytes of the document
-
search
public Recipients search(String searchString)
- Specified by:
searchin interfaceMessageDeliveryApi
-
searchSuggest
public Autocomplete searchSuggest(String searchString)
- Specified by:
searchSuggestin interfaceMessageDeliveryApi
-
identifyRecipient
public org.apache.http.client.methods.CloseableHttpResponse identifyRecipient(Identification identification)
- Specified by:
identifyRecipientin interfaceMessageDeliveryApi
-
getSenderInformation
public SenderInformation getSenderInformation(SenderId senderId)
Description copied from interface:MessageDeliveryApiHenter informasjon om en avsender.- Specified by:
getSenderInformationin interfaceMessageDeliveryApi- Parameters:
senderId- id-en til avsenderen.
-
getSenderInformation
public SenderInformation getSenderInformation(String orgnr, String avsenderenhet)
Description copied from interface:MessageDeliveryApiHenter informasjon om en avsender. Avsender må ha godtatt å identifiseres med organisasjonsnummer og ev. underenhet.- Specified by:
getSenderInformationin interfaceMessageDeliveryApi- Parameters:
orgnr- organisasjonsnummeret til avsenderen.avsenderenhet- underenhet for et organisasjonsnummer.
-
getSenderInformation
public SenderInformation getSenderInformation(MayHaveSender mayHaveSender)
Description copied from interface:MessageDeliveryApiHenter informasjon om en faktisk avsender av en melding, altså det mottaker ser som avsender.- Specified by:
getSenderInformationin interfaceMessageDeliveryApi- Parameters:
mayHaveSender- melding som skal sendes.
-
getArchives
public Archives getArchives(SenderId senderId)
- Specified by:
getArchivesin interfaceArchiveApi
-
getArchiveDocuments
public Archive getArchiveDocuments(URI uri)
- Specified by:
getArchiveDocumentsin interfaceArchiveApi
-
getArchiveDocumentsByReferenceId
public Archives getArchiveDocumentsByReferenceId(SenderId senderId, String referenceId)
Description copied from interface:ArchiveApiHenter en liste av ArkivDokumenter med en gitt referanseId- Specified by:
getArchiveDocumentsByReferenceIdin 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:
getArchiveDocumentByUUIDin interfaceArchiveApi
-
deleteArchiveDocumentByUUID
public void deleteArchiveDocumentByUUID(ArchiveDocument archiveDocument)
- Specified by:
deleteArchiveDocumentByUUIDin interfaceArchiveApi
-
addUniqueUUIDToArchiveDocument
public Archive addUniqueUUIDToArchiveDocument(SenderId senderId, UUID uuid, UUID newuuid)
- Specified by:
addUniqueUUIDToArchiveDocumentin interfaceArchiveApi
-
getInbox
public Inbox getInbox(SenderId senderId, int offset, int limit)
Description copied from interface:InboxApiGet documents from the inbox for the organisation represented by senderId.- Specified by:
getInboxin 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:InboxApiGet 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:
getInboxDocumentContentStreamin 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:InboxApiDelets the given document from the server- Specified by:
deleteInboxDocumentin interfaceInboxApi- Parameters:
inboxDocument- The document to delete
-
createOrActivateUserAccount
public UserAccount createOrActivateUserAccount(SenderId senderId, UserInformation user)
- Specified by:
createOrActivateUserAccountin interfaceMessageDeliveryApi
-
-