@API(status=STABLE) public class MessageService extends java.lang.Object implements OboMessageService, OboService<OboMessageService>
Constructor and Description |
---|
MessageService(MessagesApi messagesApi,
MessageApi messageApi,
MessageSuppressionApi messageSuppressionApi,
StreamsApi streamsApi,
PodApi podApi,
AttachmentsApi attachmentsApi,
DefaultApi defaultApi,
AuthSession authSession,
com.symphony.bdk.template.api.TemplateEngine templateEngine,
RetryWithRecoveryBuilder<?> retryBuilder) |
MessageService(MessagesApi messagesApi,
MessageApi messageApi,
MessageSuppressionApi messageSuppressionApi,
StreamsApi streamsApi,
PodApi podApi,
AttachmentsApi attachmentsApi,
DefaultApi defaultApi,
com.symphony.bdk.template.api.TemplateEngine templateEngine,
RetryWithRecoveryBuilder<?> retryBuilder) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getAttachment(java.lang.String streamId,
java.lang.String messageId,
java.lang.String attachmentId)
Downloads the attachment body by the stream ID, message ID and attachment ID.
|
java.util.List<java.lang.String> |
getAttachmentTypes()
Retrieves a list of supported file extensions for attachments.
|
V4Message |
getMessage(java.lang.String messageId)
Retrieves the details of a message given its message ID.
|
MessageMetadataResponse |
getMessageRelationships(java.lang.String messageId)
Gets the message metadata relationship.
|
MessageStatus |
getMessageStatus(java.lang.String messageId)
Get the status of a particular message, i.e the list of users who the message was sent to, delivered to
and the list of users who read the message.
|
java.util.List<V4ImportResponse> |
importMessages(java.util.List<V4ImportedMessage> messages)
Imports a list of messages to Symphony
|
java.util.List<StreamAttachmentItem> |
listAttachments(java.lang.String streamId,
java.time.Instant since,
java.time.Instant to,
java.lang.Integer limit,
AttachmentSort sort)
List attachments in a particular stream.
|
MessageReceiptDetailResponse |
listMessageReceipts(java.lang.String messageId)
Fetches receipts details from a specific message.
|
java.util.List<V4Message> |
listMessages(java.lang.String streamId,
java.time.Instant since)
Get messages from an existing stream with default limit equals 50.
|
java.util.List<V4Message> |
listMessages(java.lang.String streamId,
java.time.Instant since,
PaginationAttribute pagination)
Get messages from an existing stream.
|
java.util.List<V4Message> |
listMessages(V4Stream stream,
java.time.Instant since)
Get messages from an existing stream with default limit equals 50.
|
java.util.List<V4Message> |
listMessages(V4Stream stream,
java.time.Instant since,
PaginationAttribute pagination)
Get messages from an existing stream.
|
OboMessageService |
obo(AuthSession oboSession)
Returns a new service instance with OBO-enabled endpoints from a given OBO session.
|
V4MessageBlastResponse |
send(java.util.List<java.lang.String> streamIds,
Message message)
Sends a message to multiple existing streams.
|
V4Message |
send(java.lang.String streamId,
Message message)
Sends a message to the stream ID passed in parameter.
|
V4Message |
send(java.lang.String streamId,
java.lang.String message)
Sends a message to the stream ID passed in parameter.
|
V4Message |
send(V4Stream stream,
Message message)
Sends a message to the stream ID passed in parameter.
|
V4Message |
send(V4Stream stream,
java.lang.String message)
Sends a message to the stream ID of the passed
V4Stream object. |
MessageSuppressionResponse |
suppressMessage(java.lang.String messageId)
Suppresses a message, preventing its contents from being displayed to users.
|
com.symphony.bdk.template.api.TemplateEngine |
templates()
Returns the
TemplateEngine that can be used to load templates from classpath or file system. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkAuthSession
public MessageService(MessagesApi messagesApi, MessageApi messageApi, MessageSuppressionApi messageSuppressionApi, StreamsApi streamsApi, PodApi podApi, AttachmentsApi attachmentsApi, DefaultApi defaultApi, AuthSession authSession, com.symphony.bdk.template.api.TemplateEngine templateEngine, RetryWithRecoveryBuilder<?> retryBuilder)
public MessageService(MessagesApi messagesApi, MessageApi messageApi, MessageSuppressionApi messageSuppressionApi, StreamsApi streamsApi, PodApi podApi, AttachmentsApi attachmentsApi, DefaultApi defaultApi, com.symphony.bdk.template.api.TemplateEngine templateEngine, RetryWithRecoveryBuilder<?> retryBuilder)
public OboMessageService obo(AuthSession oboSession)
OboService
obo
in interface OboService<OboMessageService>
oboSession
- the OBO sessionpublic com.symphony.bdk.template.api.TemplateEngine templates()
TemplateEngine
that can be used to load templates from classpath or file system.templates
in interface OboMessageService
public java.util.List<V4Message> listMessages(@Nonnull V4Stream stream, @Nonnull java.time.Instant since, @Nonnull PaginationAttribute pagination)
stream
- the stream where to look for messagessince
- instant of the earliest possible date of the first message returned.pagination
- The skip and limit for pagination.public java.util.List<V4Message> listMessages(@Nonnull V4Stream stream, @Nonnull java.time.Instant since)
stream
- the stream where to look for messagessince
- instant of the earliest possible date of the first message returned.public java.util.List<V4Message> listMessages(@Nonnull java.lang.String streamId, @Nonnull java.time.Instant since, @Nonnull PaginationAttribute pagination)
streamId
- the streamID where to look for messagessince
- instant of the earliest possible date of the first message returned.pagination
- The skip and limit for pagination.public java.util.List<V4Message> listMessages(@Nonnull java.lang.String streamId, @Nonnull java.time.Instant since)
streamId
- the streamID where to look for messagessince
- instant of the earliest possible date of the first message returned.public V4Message send(@Nonnull V4Stream stream, @Nonnull java.lang.String message)
V4Stream
object.send
in interface OboMessageService
stream
- the stream to send the message tomessage
- the MessageML content. Note: <messageML></messageML>
is automatically appended if not set.V4Message
object containing the details of the sent messagepublic V4Message send(@Nonnull java.lang.String streamId, @Nonnull java.lang.String message)
send
in interface OboMessageService
streamId
- the ID of the stream to send the message tomessage
- the MessageML content. Note: <messageML></messageML>
is automatically appended if not set.V4Message
object containing the details of the sent messagepublic V4Message send(@Nonnull V4Stream stream, @Nonnull Message message)
send
in interface OboMessageService
stream
- the stream to send the message tomessage
- the message to send to the streamV4Message
object containing the details of the sent messagepublic V4Message send(@Nonnull java.lang.String streamId, @Nonnull Message message)
send
in interface OboMessageService
streamId
- the ID of the stream to send the message tomessage
- the message to send to the streamV4Message
object containing the details of the sent messagepublic V4MessageBlastResponse send(@Nonnull java.util.List<java.lang.String> streamIds, @Nonnull Message message)
streamIds
- the list of stream IDs to send the message tomessage
- the message to be sentV4MessageBlastResponse
object containing the details of the sent messagespublic byte[] getAttachment(@Nonnull java.lang.String streamId, @Nonnull java.lang.String messageId, @Nonnull java.lang.String attachmentId)
streamId
- the stream ID where to look for the attachmentmessageId
- the ID of the message containing the attachmentattachmentId
- the ID of the attachmentpublic java.util.List<V4ImportResponse> importMessages(@Nonnull java.util.List<V4ImportedMessage> messages)
messages
- the list of messages to be importedpublic MessageSuppressionResponse suppressMessage(@Nonnull java.lang.String messageId)
messageId
- the ID of the message to suppress.MessageSuppressionResponse
instance containing information about the message suppression.public MessageStatus getMessageStatus(@Nonnull java.lang.String messageId)
messageId
- the ID of the message to be checkedMessageStatus
instancepublic java.util.List<java.lang.String> getAttachmentTypes()
public V4Message getMessage(@Nonnull java.lang.String messageId)
messageId
- the ID of the message to be retrievedV4Message
containing the message's details, null if the message was not foundpublic java.util.List<StreamAttachmentItem> listAttachments(@Nonnull java.lang.String streamId, @Nullable java.time.Instant since, @Nullable java.time.Instant to, @Nullable java.lang.Integer limit, @Nullable AttachmentSort sort)
streamId
- the stream ID where to look for the attachmentssince
- optional instant of the first required attachment.to
- optional instant of the last required attachment.limit
- maximum number of attachments to return. This optional value defaults to 50 and should be between 0 and 100.sort
- Attachment date sort direction : ASC or DESC (default to ASC)public MessageReceiptDetailResponse listMessageReceipts(@Nonnull java.lang.String messageId)
messageId
- the ID of the message to get receipt details from.MessageReceiptDetailResponse
object holding all receipt information.public MessageMetadataResponse getMessageRelationships(@Nonnull java.lang.String messageId)
messageId
- the ID of the message to get relationships from.MessageMetadataResponse
object holding information about the current message relationships
(parent, replies, forwards and form replies).