Package com.isode.som.qmgr.objects
Class SomQmgrMessage
java.lang.Object
com.isode.som.qmgr.objects.SomQmgrObject
com.isode.som.qmgr.objects.SomQmgrMessage
- All Implemented Interfaces:
SomQmgrHandler
,SomHandler
This class models a queued message within M-Switch
- Author:
- tc
-
Field Summary
Fields inherited from class com.isode.som.qmgr.objects.SomQmgrObject
errortext, somSession
-
Constructor Summary
ConstructorsConstructorDescriptionSomQmgrMessage
(SomSession session, String cName, String mName) Create a new Message objectSomQmgrMessage
(SomSession session, String c, String m, String[] pairs) Crate a new Message object and initialize it from the attribute pairs -
Method Summary
Modifier and TypeMethodDescriptionvoid
abort
(SomCommandListener listener) Cause transfer of the message to be abortedage()
Get the age of this message as a UTC Time StringGenerate an information string for this messagevoid
clear
(SomCommandListener listener) Clear delays on this message.Get the content type of this messageGet content type of this message as more user-friendly formstatic String
contentTypeDescription
(String contentType) Get a content type as a more user-friendly formboolean
Test whether the content-type of this message is "military"static boolean
contentTypeMilitary
(String contentType) Test whether a given content-type value is "military"Get deferred delivery time for this message, if anyvoid
delay
(int mins, SomCommandListener listener) Delay this message for some minutes.void
delete
(SomCommandListener listener) Cause the message to be deletedvoid
disable
(SomCommandListener listener) Disable processing of this message.void
downwardsforce
(SomCommandListener listener) Clear any delay and enable this messageeits()
Get encoded information types for this messagevoid
enable
(SomCommandListener listener) Enable processing of this message.Get count of errors which have occurred for this messageGet time at which this message will expirevoid
force
(SomCommandListener listener, Double forceValue) Force processing of this message.Get name of channel on which this message is queuedGet the recipient objects which are subordinate to this messageint
Get a count of the recipients of this messagevoid
handleBindResponse
(int status, String detail) Handle the response to a Bind operationvoid
handleResponse
(SomCommand obj, int status, SomMessage msg) Handles the response to commands which return a SomMessage object (i.e.void
handleResponse
(SomCommand command, int status, SomQmgrChannel object) Handles the response to commands which return a list of channel objectsvoid
handleResponse
(SomCommand command, int status, SomQmgrMessage object) Handles the response to commands which return a list of message objectsvoid
handleResponse
(SomCommand command, int status, SomQmgrMta object) Handles the response to commands which return a list of MTA objectsvoid
handleResponse
(SomCommand command, int status, SomQmgrQueueManager object) void
handleResponse
(SomCommand command, int status, String detail) Handles the response to control commands which return an OK/error response plus an info stringvoid
handleResponse
(SomCommand command, int status, String[] pairs) Handles the response to commands which return data about the current object - i.e.Get inbound channel for this messageinetId()
Get Internet message idinMta()
Get inbound MTA name for this messageGet latest delivery timeGet the type of the message object in friendly formmlistId()
Return the mlist ID for this message.mpduiden()
Get MPDU Identifier for this messagemta()
Get MTA name for this message objectvoid
nondeliver
(String reason, SomCommandListener listener) Cause the message to be non deliveredGet the number of warnings which have been sent about this messaheGet originator address for this messagevoid
parsePairs
(String[] pairs) void
pause
(SomCommandListener listener) Cause transfer of the message to be pausedpriority()
Get priority of this messagequeueid()
Get Queue Identifier of this message (e.g.Get queue priority for messagevoid
redirect
(String target, SomCommandListener listener) Cause the message to be redirected to a different recipientvoid
refresh
(SomCommandListener listener) Refresh this Message object by querying the Queue Managervoid
reload
(SomCommandListener listener) Cause the message to be reloadedvoid
Remove this message from the array passed invoid
reprocess
(SomCommandListener listener) Cause the message to be reprocessed by the Queue Managervoid
resume
(SomCommandListener listener) Cause transfer of the message to be resumedsize()
Get size of message in bytesvoid
timeout
(SomCommandListener listener) Time this message out and cause it to be non-deliveredGet UA Content Identifier for the messageuniqueId()
Return the message's unique identifierReturn a string containing the message's unique identifier and the first recipient numberGet warning interval for messageMethods inherited from class com.isode.som.qmgr.objects.SomQmgrObject
addAttribute, addAttribute, addBindListener, clearAttributes, getBooleanAttributeValue, getDoubleAttributeValue, getIntegerAttributeValue, getSession, getStringAttributeValue, notifyBindListeners, notifyListener, notifyListeners, print, print_str, removeBindListener, setSkipNotifications
-
Constructor Details
-
SomQmgrMessage
Create a new Message object- Parameters:
session
- SOM session with which it is associated which must not be nullcName
- channel name which must not be nullmName
- mta name which may be null
-
SomQmgrMessage
Crate a new Message object and initialize it from the attribute pairs- Parameters:
session
- SOM session with which it is associated which must not be nullc
- channel name which must not be nullm
- mta name which may be nullpairs
- attribute pairs which may no be null
-
-
Method Details
-
parsePairs
- Overrides:
parsePairs
in classSomQmgrObject
-
removeFromArray
Remove this message from the array passed in- Parameters:
msgs
- Array of messages from which this one should be removed, which must not be null
-
getRecipientsCount
public int getRecipientsCount()Get a count of the recipients of this message- Returns:
- recipient count
-
getRecipients
Get the recipient objects which are subordinate to this message- Returns:
- array of recipient objects
-
mta
Get MTA name for this message object- Returns:
- MTA name
- Throws:
SomException
- on error
-
getChannelName
Get name of channel on which this message is queued- Returns:
- channel name
- Throws:
SomException
- on error
-
age
Get the age of this message as a UTC Time String- Returns:
- Age of message
- Throws:
SomException
- on error
-
contenttype
Get the content type of this message- Returns:
- Content type in string representation
- Throws:
SomException
- on error
-
contentTypeDescription
Get a content type as a more user-friendly form- Parameters:
contentType
- content type in standard form which cannot be null- Returns:
- content type in user-friendly form
-
contentTypeDescription
Get content type of this message as more user-friendly form- Returns:
- content type in user-friendly form
- Throws:
SomException
- on error
-
contentTypeMilitary
Test whether a given content-type value is "military"- Parameters:
contentType
- content type to test which cannot be null- Returns:
- true if military
-
contentTypeMilitary
Test whether the content-type of this message is "military"- Returns:
- true if military
- Throws:
SomException
- on error
-
deferredTime
Get deferred delivery time for this message, if any- Returns:
- Deferred delivery time
- Throws:
SomException
- on error
-
eits
Get encoded information types for this message- Returns:
- EITs as a string
- Throws:
SomException
- on error
-
errorCount
Get count of errors which have occurred for this message- Returns:
- Error code for this message
- Throws:
SomException
- on error
-
expiryTime
Get time at which this message will expire- Returns:
- Expiry time (as UTC Time String)
- Throws:
SomException
- on error
-
inChannel
Get inbound channel for this message- Returns:
- Inbound channel name
- Throws:
SomException
- on error
-
inMta
Get inbound MTA name for this message- Returns:
- Inbound MTA name
- Throws:
SomException
- on error
-
mpduiden
Get MPDU Identifier for this message- Returns:
- MPDU Id
- Throws:
SomException
- on error
-
numberWarningsSent
Get the number of warnings which have been sent about this messahe- Returns:
- Number of warnings sent
- Throws:
SomException
- on error
-
originator
Get originator address for this message- Returns:
- Originator address in string encoding
- Throws:
SomException
- on error
-
priority
Get priority of this message- Returns:
- Priority
- Throws:
SomException
- on error
-
queueid
Get Queue Identifier of this message (e.g. msg.12345-0)- Returns:
- Queue ID
- Throws:
SomException
- on error
-
size
Get size of message in bytes- Returns:
- size in bytes
- Throws:
SomException
- on error
-
uaContentId
Get UA Content Identifier for the message- Returns:
- UA content id
- Throws:
SomException
- on error
-
warnInterval
Get warning interval for message- Returns:
- warning interval (minutes)
- Throws:
SomException
- on error
-
queuePriority
Get queue priority for message- Returns:
- queue priority
- Throws:
SomException
- on error- Since:
- R16.5
-
inetId
Get Internet message id- Returns:
- Internet message id
- Throws:
SomException
- on error
-
latestDelivery
Get latest delivery time- Returns:
- Latest delivery time as UTC Time String
- Throws:
SomException
- on error
-
messageType
Get the type of the message object in friendly form- Returns:
- String representing message object type e.g. "Message", "Report"
- Throws:
SomException
- on error
-
uniqueIdWithRecipNo
Return a string containing the message's unique identifier and the first recipient number- Returns:
- unique id + first recipient number
- Throws:
SomException
- on error
-
uniqueId
Return the message's unique identifier- Returns:
- unique identifier
- Throws:
SomException
- on error
-
mlistId
Return the mlist ID for this message.- Returns:
- mlist ID.
- Throws:
SomException
- on error
-
handleResponse
Description copied from interface:SomQmgrHandler
Handles the response to control commands which return an OK/error response plus an info string- Specified by:
handleResponse
in interfaceSomHandler
- Specified by:
handleResponse
in interfaceSomQmgrHandler
- Parameters:
command
- the SOM commandstatus
- operation statusdetail
- detail on error
-
handleResponse
-
handleResponse
Description copied from interface:SomQmgrHandler
Handles the response to commands which return a list of channel objects- Specified by:
handleResponse
in interfaceSomQmgrHandler
- Parameters:
command
- the SOM commandstatus
- operation statusobject
- a channel object
-
handleResponse
Description copied from interface:SomQmgrHandler
Handles the response to commands which return a list of MTA objects- Specified by:
handleResponse
in interfaceSomQmgrHandler
- Parameters:
command
- the SOM commandstatus
- operation statusobject
- a SOM Qmgr MTA object
-
handleResponse
Description copied from interface:SomQmgrHandler
Handles the response to commands which return a SomMessage object (i.e. read from the Queue or Archive).- Specified by:
handleResponse
in interfaceSomQmgrHandler
- Parameters:
obj
- the SOM commandstatus
- operation statusmsg
- a message object
-
handleResponse
Description copied from interface:SomQmgrHandler
Handles the response to commands which return a list of message objects- Specified by:
handleResponse
in interfaceSomQmgrHandler
- Parameters:
command
- the SOM commandstatus
- operation statusobject
- a qmgr message object
-
handleBindResponse
Description copied from interface:SomHandler
Handle the response to a Bind operation- Specified by:
handleBindResponse
in interfaceSomHandler
- Parameters:
status
- operation statusdetail
- error detail on failure
-
handleResponse
Description copied from interface:SomQmgrHandler
Handles the response to commands which return data about the current object - i.e. we are refreshing an existing object.- Specified by:
handleResponse
in interfaceSomQmgrHandler
- Parameters:
command
- the SOM commandstatus
- operation statuspairs
- data pairs
-
refresh
Refresh this Message object by querying the Queue Manager- Parameters:
listener
- Listener object to be notified when refresh completes, which may be null- Throws:
SomException
- on error
-
buildInfoString
Generate an information string for this message- Returns:
- Info string
-
clear
Clear delays on this message.- Parameters:
listener
- Listener object to be notified when operation completes, which may be null- Throws:
SomException
- on error
-
enable
Enable processing of this message.- Parameters:
listener
- Listener object to be notified when operation completes, which may be null- Throws:
SomException
- on error
-
disable
Disable processing of this message.- Parameters:
listener
- Listener object to be notified when operation completes, which may be null- Throws:
SomException
- on error
-
delay
Delay this message for some minutes.- Parameters:
mins
- number of minutes to delay the message forlistener
- Listener object to be notified when operation completes, which may be null- Throws:
SomException
- on error
-
downwardsforce
Clear any delay and enable this message- Parameters:
listener
- Listener object to be notified when operation completes, which may be null- Throws:
SomException
- on error
-
force
Force processing of this message.- Parameters:
listener
- Listener object to be notified when operation completes, which may be nullforceValue
- the priority to force at- Throws:
SomException
- on error
-
timeout
Time this message out and cause it to be non-delivered- Parameters:
listener
- Listener object to be notified when operation completes, which may be null- Throws:
SomException
- on error
-
reprocess
Cause the message to be reprocessed by the Queue Manager- Parameters:
listener
- Listener object to be notified when operation completes, which may be null- Throws:
SomException
- on error
-
delete
Cause the message to be deleted- Parameters:
listener
- Listener object to be notified when operation complete, which may be null- Throws:
SomException
- on error
-
redirect
Cause the message to be redirected to a different recipient- Parameters:
target
- Recipient address in string encoding, which may not be nulllistener
- Listener object to be notified when operation complete, which may be null- Throws:
SomException
- on error
-
nondeliver
Cause the message to be non delivered- Parameters:
reason
- Non-delivery reason which may be nulllistener
- Listener object to be notified when operation complete, which may be null- Throws:
SomException
- on error
-
reload
Cause the message to be reloaded- Parameters:
listener
- Listener object to be notified when operation complete, which may be null- Throws:
SomException
- on error
-
abort
Cause transfer of the message to be aborted- Parameters:
listener
- Listener object to be notified when operation complete, which may be null- Throws:
SomException
- on error
-
pause
Cause transfer of the message to be paused- Parameters:
listener
- Listener object to be notified when operation complete, which may be null- Throws:
SomException
- on error
-
resume
Cause transfer of the message to be resumed- Parameters:
listener
- Listener object to be notified when operation complete, which may be null- Throws:
SomException
- on error
-