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>
attachments
protected Channel
deliveryMethod
protected ZonedDateTime
deliveryTime
protected String
messageId
protected Document
primaryDocument
protected long
senderId
protected MessageStatus
status
-
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()
Channel
getChannel()
ZonedDateTime
getDeliveryTime()
Document
getDocument(UUID uuid)
Link
getEncryptionKeyLink()
protected List<Link>
getLinks()
String
getMessageId()
Document
getPrimaryDocument()
Link
getSelfLink()
Optional<SenderId>
getSenderId()
Always returns the resolved sender-id of the message, i.e.Optional<SenderOrganization>
getSenderOrganization()
Link
getSendLink()
MessageStatus
getStatus()
boolean
isAlreadyDeliveredToDigipost()
boolean
isSameMessageAs(Message message)
protected void
setLinks(List<Link> links)
boolean
willBeDeliveredInDigipost()
-
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
Document
in 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 originatingMessage
has specified nosender-id
norsender-organization
, it will be set to the broker-id which was specified in the X-Digipost-UserId header of the initiating request.- Specified by:
getSenderId
in interfaceMayHaveSender
- Returns:
- always the sender-id, never
null
.
-
getSenderOrganization
public Optional<SenderOrganization> getSenderOrganization()
- Specified by:
getSenderOrganization
in interfaceMayHaveSender
- Returns:
- always
Optional.empty()
- See Also:
getSenderId()
-
-