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
public class SomQmgrMessage extends SomQmgrObject implements SomQmgrHandler
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
Constructors Constructor Description SomQmgrMessage(SomSession session, java.lang.String cName, java.lang.String mName)
Create a new Message objectSomQmgrMessage(SomSession session, java.lang.String c, java.lang.String m, java.lang.String[] pairs)
Crate a new Message object and initialize it from the attribute pairs
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort(SomCommandListener listener)
Cause transfer of the message to be abortedjava.lang.String
age()
Get the age of this message as a UTC Time Stringjava.lang.String
buildInfoString()
Generate an information string for this messagevoid
clear(SomCommandListener listener)
Clear delays on this message.java.lang.String
contenttype()
Get the content type of this messagejava.lang.String
contentTypeDescription()
Get content type of this message as more user-friendly formstatic java.lang.String
contentTypeDescription(java.lang.String contentType)
Get a content type as a more user-friendly formboolean
contentTypeMilitary()
Test whether the content-type of this message is "military"static boolean
contentTypeMilitary(java.lang.String contentType)
Test whether a given content-type value is "military"java.lang.String
deferredTime()
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 messagejava.lang.String
eits()
Get encoded information types for this messagevoid
enable(SomCommandListener listener)
Enable processing of this message.java.lang.Integer
errorCount()
Get count of errors which have occurred for this messagejava.lang.String
expiryTime()
Get time at which this message will expirevoid
force(SomCommandListener listener, java.lang.Double forceValue)
Force processing of this message.java.lang.String
getChannelName()
Get name of channel on which this message is queuedSomQmgrRecipient[]
getRecipients()
Get the recipient objects which are subordinate to this messageint
getRecipientsCount()
Get a count of the recipients of this messagevoid
handleBindResponse(int status, java.lang.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, java.lang.String detail)
Handles the response to control commands which return an OK/error response plus an info stringvoid
handleResponse(SomCommand command, int status, java.lang.String[] pairs)
Handles the response to commands which return data about the current object - i.e.java.lang.String
inChannel()
Get inbound channel for this messagejava.lang.String
inetId()
Get Internet message idjava.lang.String
inMta()
Get inbound MTA name for this messagejava.lang.String
latestDelivery()
Get latest delivery timejava.lang.String
messageType()
Get the type of the message object in friendly formjava.lang.String
mlistId()
Return the mlist ID for this message.java.lang.String
mpduiden()
Get MPDU Identifier for this messagejava.lang.String
mta()
Get MTA name for this message objectvoid
nondeliver(java.lang.String reason, SomCommandListener listener)
Cause the message to be non deliveredjava.lang.Integer
numberWarningsSent()
Get the number of warnings which have been sent about this messahejava.lang.String
originator()
Get originator address for this messagevoid
parsePairs(java.lang.String[] pairs)
void
pause(SomCommandListener listener)
Cause transfer of the message to be pausedjava.lang.Integer
priority()
Get priority of this messagejava.lang.String
queueid()
Get Queue Identifier of this message (e.g.java.lang.Double
queuePriority()
Get queue priority for messagevoid
redirect(java.lang.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
removeFromArray(java.util.ArrayList<SomQmgrMessage> msgs)
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 resumedjava.lang.Integer
size()
Get size of message in bytesvoid
timeout(SomCommandListener listener)
Time this message out and cause it to be non-deliveredjava.lang.String
uaContentId()
Get UA Content Identifier for the messagejava.lang.String
uniqueId()
Return the message's unique identifierjava.lang.String
uniqueIdWithRecipNo()
Return a string containing the message's unique identifier and the first recipient numberjava.lang.Integer
warnInterval()
Get warning interval for message-
Methods 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 Detail
-
SomQmgrMessage
public SomQmgrMessage(SomSession session, java.lang.String cName, java.lang.String mName)
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
public SomQmgrMessage(SomSession session, java.lang.String c, java.lang.String m, java.lang.String[] pairs)
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 Detail
-
parsePairs
public void parsePairs(java.lang.String[] pairs)
- Overrides:
parsePairs
in classSomQmgrObject
-
removeFromArray
public void removeFromArray(java.util.ArrayList<SomQmgrMessage> msgs)
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
public SomQmgrRecipient[] getRecipients()
Get the recipient objects which are subordinate to this message- Returns:
- array of recipient objects
-
mta
public java.lang.String mta() throws SomException
Get MTA name for this message object- Returns:
- MTA name
- Throws:
SomException
- on error
-
getChannelName
public java.lang.String getChannelName() throws SomException
Get name of channel on which this message is queued- Returns:
- channel name
- Throws:
SomException
- on error
-
age
public java.lang.String age() throws SomException
Get the age of this message as a UTC Time String- Returns:
- Age of message
- Throws:
SomException
- on error
-
contenttype
public java.lang.String contenttype() throws SomException
Get the content type of this message- Returns:
- Content type in string representation
- Throws:
SomException
- on error
-
contentTypeDescription
public static java.lang.String contentTypeDescription(java.lang.String contentType)
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
public java.lang.String contentTypeDescription() throws SomException
Get content type of this message as more user-friendly form- Returns:
- content type in user-friendly form
- Throws:
SomException
- on error
-
contentTypeMilitary
public static boolean contentTypeMilitary(java.lang.String contentType)
Test whether a given content-type value is "military"- Parameters:
contentType
- content type to test which cannot be null- Returns:
- true if military
-
contentTypeMilitary
public boolean contentTypeMilitary() throws SomException
Test whether the content-type of this message is "military"- Returns:
- true if military
- Throws:
SomException
- on error
-
deferredTime
public java.lang.String deferredTime() throws SomException
Get deferred delivery time for this message, if any- Returns:
- Deferred delivery time
- Throws:
SomException
- on error
-
eits
public java.lang.String eits() throws SomException
Get encoded information types for this message- Returns:
- EITs as a string
- Throws:
SomException
- on error
-
errorCount
public java.lang.Integer errorCount() throws SomException
Get count of errors which have occurred for this message- Returns:
- Error code for this message
- Throws:
SomException
- on error
-
expiryTime
public java.lang.String expiryTime() throws SomException
Get time at which this message will expire- Returns:
- Expiry time (as UTC Time String)
- Throws:
SomException
- on error
-
inChannel
public java.lang.String inChannel() throws SomException
Get inbound channel for this message- Returns:
- Inbound channel name
- Throws:
SomException
- on error
-
inMta
public java.lang.String inMta() throws SomException
Get inbound MTA name for this message- Returns:
- Inbound MTA name
- Throws:
SomException
- on error
-
mpduiden
public java.lang.String mpduiden() throws SomException
Get MPDU Identifier for this message- Returns:
- MPDU Id
- Throws:
SomException
- on error
-
numberWarningsSent
public java.lang.Integer numberWarningsSent() throws SomException
Get the number of warnings which have been sent about this messahe- Returns:
- Number of warnings sent
- Throws:
SomException
- on error
-
originator
public java.lang.String originator() throws SomException
Get originator address for this message- Returns:
- Originator address in string encoding
- Throws:
SomException
- on error
-
priority
public java.lang.Integer priority() throws SomException
Get priority of this message- Returns:
- Priority
- Throws:
SomException
- on error
-
queueid
public java.lang.String queueid() throws SomException
Get Queue Identifier of this message (e.g. msg.12345-0)- Returns:
- Queue ID
- Throws:
SomException
- on error
-
size
public java.lang.Integer size() throws SomException
Get size of message in bytes- Returns:
- size in bytes
- Throws:
SomException
- on error
-
uaContentId
public java.lang.String uaContentId() throws SomException
Get UA Content Identifier for the message- Returns:
- UA content id
- Throws:
SomException
- on error
-
warnInterval
public java.lang.Integer warnInterval() throws SomException
Get warning interval for message- Returns:
- warning interval (minutes)
- Throws:
SomException
- on error
-
queuePriority
public java.lang.Double queuePriority() throws SomException
Get queue priority for message- Returns:
- queue priority
- Throws:
SomException
- on error- Since:
- R16.5
-
inetId
public java.lang.String inetId() throws SomException
Get Internet message id- Returns:
- Internet message id
- Throws:
SomException
- on error
-
latestDelivery
public java.lang.String latestDelivery() throws SomException
Get latest delivery time- Returns:
- Latest delivery time as UTC Time String
- Throws:
SomException
- on error
-
messageType
public java.lang.String messageType() throws SomException
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
public java.lang.String uniqueIdWithRecipNo() throws SomException
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
public java.lang.String uniqueId() throws SomException
Return the message's unique identifier- Returns:
- unique identifier
- Throws:
SomException
- on error
-
mlistId
public java.lang.String mlistId() throws SomException
Return the mlist ID for this message.- Returns:
- mlist ID.
- Throws:
SomException
- on error
-
handleResponse
public void handleResponse(SomCommand command, int status, java.lang.String detail)
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
public void handleResponse(SomCommand command, int status, SomQmgrQueueManager object)
-
handleResponse
public void handleResponse(SomCommand command, int status, SomQmgrChannel object)
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
public void handleResponse(SomCommand command, int status, SomQmgrMta object)
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
public void handleResponse(SomCommand obj, int status, SomMessage msg)
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
public void handleResponse(SomCommand command, int status, SomQmgrMessage object)
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
public void handleBindResponse(int status, java.lang.String detail)
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
public void handleResponse(SomCommand command, int status, java.lang.String[] pairs)
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
public void refresh(SomCommandListener listener) throws SomException
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
public java.lang.String buildInfoString()
Generate an information string for this message- Returns:
- Info string
-
clear
public void clear(SomCommandListener listener) throws SomException
Clear delays on this message.- Parameters:
listener
- Listener object to be notified when operation completes, which may be null- Throws:
SomException
- on error
-
enable
public void enable(SomCommandListener listener) throws SomException
Enable processing of this message.- Parameters:
listener
- Listener object to be notified when operation completes, which may be null- Throws:
SomException
- on error
-
disable
public void disable(SomCommandListener listener) throws SomException
Disable processing of this message.- Parameters:
listener
- Listener object to be notified when operation completes, which may be null- Throws:
SomException
- on error
-
delay
public void delay(int mins, SomCommandListener listener) throws SomException
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
public void downwardsforce(SomCommandListener listener) throws SomException
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
public void force(SomCommandListener listener, java.lang.Double forceValue) throws SomException
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
public void timeout(SomCommandListener listener) throws SomException
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
public void reprocess(SomCommandListener listener) throws SomException
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
public void delete(SomCommandListener listener) throws SomException
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
public void redirect(java.lang.String target, SomCommandListener listener) throws SomException
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
public void nondeliver(java.lang.String reason, SomCommandListener listener) throws SomException
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
public void reload(SomCommandListener listener) throws SomException
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
public void abort(SomCommandListener listener) throws SomException
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
public void pause(SomCommandListener listener) throws SomException
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
public void resume(SomCommandListener listener) throws SomException
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
-
-