Package cl.obcom.desktopfx.core
Interface ServerMulticast
public interface ServerMulticast
Multicast message sent by the
Desktop
backend server.-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Returns the bytes of the attachment of this Server Multicast.Returns the MIME type of the attachement of this Server Multicast.getID()
Returns the identification of this Server Multicast.Returns the message of this Server Multicast.getName()
Returns the name of this Server Multicast.Returns the valid-from date/time this Server Multicast.Returns the valid-to date/time this Server Multicast.void
Sends all the files in given directory whose names match a glob pattern.void
sendResponse
(String message) Sends a partial or final response message with no attachment data.void
sendResponse
(String message, String attachmentType, byte[] attachment) Sends a partial or final response message with attachment data.
-
Method Details
-
getID
BigDecimal getID()Returns the identification of this Server Multicast.- Returns:
- the identification of this Server Multicast.
-
getName
String getName()Returns the name of this Server Multicast.- Returns:
- the name of this Server Multicast.
-
getValidFrom
LocalDateTime getValidFrom()Returns the valid-from date/time this Server Multicast.- Returns:
- the valid-from date/time this Server Multicast.
-
getValidTo
LocalDateTime getValidTo()Returns the valid-to date/time this Server Multicast.- Returns:
- the valid-to date/time this Server Multicast.
-
getMessage
String getMessage()Returns the message of this Server Multicast.- Returns:
- the message of this Server Multicast.
-
getAttachmentType
String getAttachmentType()Returns the MIME type of the attachement of this Server Multicast.- Returns:
- the MIME type or
null
if no MIME type available.
-
getAttachment
Returns the bytes of the attachment of this Server Multicast.- Returns:
- the bytes or
null
if no bytes available. - Throws:
Exception
- if an error occurs obtaining the bytes.
-
sendResponse
Sends a partial or final response message with no attachment data.- Parameters:
message
- the message of this partial or final response.- Throws:
NullPointerException
- ifmessage
isnull
.Exception
- if another error occurs.
-
sendResponse
Sends a partial or final response message with attachment data. The argumentsattachmentType
andattachment
can be bothnull
, but if one is provided (notnull
) then the other must also be provided.- Parameters:
message
- the message of this partial or final response.attachmentType
- the type of the attachment data (can be null).attachment
- the attachment data of this response (can be null).- Throws:
NullPointerException
- ifmessage
isnull
.IllegalArgumentException
- if attachment and type are invalid.Exception
- if another error occurs.
-
sendFiles
Sends all the files in given directory whose names match a glob pattern.- Parameters:
path
- the path to the directory where to look for files.glob
- the glob pattern used to select the files.mimeType
- the MIME type of the selected files (can be null).- Throws:
NullPointerException
- if an argument isnull
.IllegalArgumentException
- ifpath
is not a directory.IOException
- if an I/O error occurs.Exception
- if another error occurs.- See Also:
-