Class MessageDelivery
- java.lang.Object
-
- no.digipost.api.client.representations.Representation
-
- no.digipost.api.client.representations.MessageDelivery
-
- All Implemented Interfaces:
MayHaveSender
public class MessageDelivery extends Representation implements MayHaveSender
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Document>attachmentsprotected ChanneldeliveryMethodprotected ZonedDateTimedeliveryTimeprotected StringmessageIdprotected DocumentprimaryDocumentprotected longsenderIdprotected MessageStatusstatus-
Fields inherited from class no.digipost.api.client.representations.Representation
links
-
Fields inherited from interface no.digipost.api.client.representations.MayHaveSender
NO_SENDER
-
-
Constructor Summary
Constructors Constructor Description MessageDelivery()MessageDelivery(String messageId, Channel channel, MessageStatus status, ZonedDateTime deliveryTime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream<Document>getAllDocuments()List<Document>getAttachments()ChannelgetChannel()ZonedDateTimegetDeliveryTime()DocumentgetDocument(UUID uuid)LinkgetEncryptionKeyLink()protected List<Link>getLinks()StringgetMessageId()DocumentgetPrimaryDocument()LinkgetSelfLink()Optional<SenderId>getSenderId()Always returns the resolved sender-id of the message, i.e.Optional<SenderOrganization>getSenderOrganization()LinkgetSendLink()MessageStatusgetStatus()booleanisAlreadyDeliveredToDigipost()booleanisSameMessageAs(Message message)protected voidsetLinks(List<Link> links)booleanwillBeDeliveredInDigipost()-
Methods inherited from class no.digipost.api.client.representations.Representation
addLink, getLinkByRelationName
-
-
-
-
Field Detail
-
messageId
protected String messageId
-
deliveryMethod
protected Channel deliveryMethod
-
senderId
protected long senderId
-
status
protected MessageStatus status
-
deliveryTime
protected ZonedDateTime deliveryTime
-
primaryDocument
protected Document primaryDocument
-
-
Constructor Detail
-
MessageDelivery
public MessageDelivery()
-
MessageDelivery
public MessageDelivery(String messageId, Channel channel, MessageStatus status, ZonedDateTime deliveryTime)
-
-
Method Detail
-
getMessageId
public String getMessageId()
-
isSameMessageAs
public boolean isSameMessageAs(Message message)
-
getStatus
public MessageStatus getStatus()
-
getEncryptionKeyLink
public Link getEncryptionKeyLink()
-
getSendLink
public Link getSendLink()
-
willBeDeliveredInDigipost
public boolean willBeDeliveredInDigipost()
-
isAlreadyDeliveredToDigipost
public boolean isAlreadyDeliveredToDigipost()
-
getSelfLink
public Link getSelfLink()
-
getChannel
public Channel getChannel()
-
getDeliveryTime
public ZonedDateTime getDeliveryTime()
-
getPrimaryDocument
public Document getPrimaryDocument()
-
getAllDocuments
public Stream<Document> getAllDocuments()
- Returns:
- an ordered Stream containing every
Documentin this delivery. The primary document will be the first element of the stream, with the attachments following.
-
getSenderId
public Optional<SenderId> getSenderId()
Always returns the resolved sender-id of the message, i.e. what the receiver of the message sees as the sender of the message. If the originatingMessagehas specified nosender-idnorsender-organization, it will be set to the broker-id which was specified in the X-Digipost-UserId header of the initiating request.- Specified by:
getSenderIdin interfaceMayHaveSender- Returns:
- always the sender-id, never
null.
-
getSenderOrganization
public Optional<SenderOrganization> getSenderOrganization()
- Specified by:
getSenderOrganizationin interfaceMayHaveSender- Returns:
- always
Optional.empty() - See Also:
getSenderId()
-
-