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 voidabort(SomCommandListener listener)Cause transfer of the message to be abortedjava.lang.Stringage()Get the age of this message as a UTC Time Stringjava.lang.StringbuildInfoString()Generate an information string for this messagevoidclear(SomCommandListener listener)Clear delays on this message.java.lang.Stringcontenttype()Get the content type of this messagejava.lang.StringcontentTypeDescription()Get content type of this message as more user-friendly formstatic java.lang.StringcontentTypeDescription(java.lang.String contentType)Get a content type as a more user-friendly formbooleancontentTypeMilitary()Test whether the content-type of this message is "military"static booleancontentTypeMilitary(java.lang.String contentType)Test whether a given content-type value is "military"java.lang.StringdeferredTime()Get deferred delivery time for this message, if anyvoiddelay(int mins, SomCommandListener listener)Delay this message for some minutes.voiddelete(SomCommandListener listener)Cause the message to be deletedvoiddisable(SomCommandListener listener)Disable processing of this message.voiddownwardsforce(SomCommandListener listener)Clear any delay and enable this messagejava.lang.Stringeits()Get encoded information types for this messagevoidenable(SomCommandListener listener)Enable processing of this message.java.lang.IntegererrorCount()Get count of errors which have occurred for this messagejava.lang.StringexpiryTime()Get time at which this message will expirevoidforce(SomCommandListener listener, java.lang.Double forceValue)Force processing of this message.java.lang.StringgetChannelName()Get name of channel on which this message is queuedSomQmgrRecipient[]getRecipients()Get the recipient objects which are subordinate to this messageintgetRecipientsCount()Get a count of the recipients of this messagevoidhandleBindResponse(int status, java.lang.String detail)Handle the response to a Bind operationvoidhandleResponse(SomCommand obj, int status, SomMessage msg)Handles the response to commands which return a SomMessage object (i.e.voidhandleResponse(SomCommand command, int status, SomQmgrChannel object)Handles the response to commands which return a list of channel objectsvoidhandleResponse(SomCommand command, int status, SomQmgrMessage object)Handles the response to commands which return a list of message objectsvoidhandleResponse(SomCommand command, int status, SomQmgrMta object)Handles the response to commands which return a list of MTA objectsvoidhandleResponse(SomCommand command, int status, SomQmgrQueueManager object)voidhandleResponse(SomCommand command, int status, java.lang.String detail)Handles the response to control commands which return an OK/error response plus an info stringvoidhandleResponse(SomCommand command, int status, java.lang.String[] pairs)Handles the response to commands which return data about the current object - i.e.java.lang.StringinChannel()Get inbound channel for this messagejava.lang.StringinetId()Get Internet message idjava.lang.StringinMta()Get inbound MTA name for this messagejava.lang.StringlatestDelivery()Get latest delivery timejava.lang.StringmessageType()Get the type of the message object in friendly formjava.lang.StringmlistId()Return the mlist ID for this message.java.lang.Stringmpduiden()Get MPDU Identifier for this messagejava.lang.Stringmta()Get MTA name for this message objectvoidnondeliver(java.lang.String reason, SomCommandListener listener)Cause the message to be non deliveredjava.lang.IntegernumberWarningsSent()Get the number of warnings which have been sent about this messahejava.lang.Stringoriginator()Get originator address for this messagevoidparsePairs(java.lang.String[] pairs)voidpause(SomCommandListener listener)Cause transfer of the message to be pausedjava.lang.Integerpriority()Get priority of this messagejava.lang.Stringqueueid()Get Queue Identifier of this message (e.g.java.lang.DoublequeuePriority()Get queue priority for messagevoidredirect(java.lang.String target, SomCommandListener listener)Cause the message to be redirected to a different recipientvoidrefresh(SomCommandListener listener)Refresh this Message object by querying the Queue Managervoidreload(SomCommandListener listener)Cause the message to be reloadedvoidremoveFromArray(java.util.ArrayList<SomQmgrMessage> msgs)Remove this message from the array passed invoidreprocess(SomCommandListener listener)Cause the message to be reprocessed by the Queue Managervoidresume(SomCommandListener listener)Cause transfer of the message to be resumedjava.lang.Integersize()Get size of message in bytesvoidtimeout(SomCommandListener listener)Time this message out and cause it to be non-deliveredjava.lang.StringuaContentId()Get UA Content Identifier for the messagejava.lang.StringuniqueId()Return the message's unique identifierjava.lang.StringuniqueIdWithRecipNo()Return a string containing the message's unique identifier and the first recipient numberjava.lang.IntegerwarnInterval()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:
parsePairsin 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 SomExceptionGet MTA name for this message object- Returns:
- MTA name
- Throws:
SomException- on error
-
getChannelName
public java.lang.String getChannelName() throws SomExceptionGet name of channel on which this message is queued- Returns:
- channel name
- Throws:
SomException- on error
-
age
public java.lang.String age() throws SomExceptionGet 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 SomExceptionGet 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 SomExceptionGet 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 SomExceptionTest whether the content-type of this message is "military"- Returns:
- true if military
- Throws:
SomException- on error
-
deferredTime
public java.lang.String deferredTime() throws SomExceptionGet deferred delivery time for this message, if any- Returns:
- Deferred delivery time
- Throws:
SomException- on error
-
eits
public java.lang.String eits() throws SomExceptionGet encoded information types for this message- Returns:
- EITs as a string
- Throws:
SomException- on error
-
errorCount
public java.lang.Integer errorCount() throws SomExceptionGet 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 SomExceptionGet 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 SomExceptionGet inbound channel for this message- Returns:
- Inbound channel name
- Throws:
SomException- on error
-
inMta
public java.lang.String inMta() throws SomExceptionGet inbound MTA name for this message- Returns:
- Inbound MTA name
- Throws:
SomException- on error
-
mpduiden
public java.lang.String mpduiden() throws SomExceptionGet MPDU Identifier for this message- Returns:
- MPDU Id
- Throws:
SomException- on error
-
numberWarningsSent
public java.lang.Integer numberWarningsSent() throws SomExceptionGet 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 SomExceptionGet originator address for this message- Returns:
- Originator address in string encoding
- Throws:
SomException- on error
-
priority
public java.lang.Integer priority() throws SomExceptionGet priority of this message- Returns:
- Priority
- Throws:
SomException- on error
-
queueid
public java.lang.String queueid() throws SomExceptionGet Queue Identifier of this message (e.g. msg.12345-0)- Returns:
- Queue ID
- Throws:
SomException- on error
-
size
public java.lang.Integer size() throws SomExceptionGet size of message in bytes- Returns:
- size in bytes
- Throws:
SomException- on error
-
uaContentId
public java.lang.String uaContentId() throws SomExceptionGet UA Content Identifier for the message- Returns:
- UA content id
- Throws:
SomException- on error
-
warnInterval
public java.lang.Integer warnInterval() throws SomExceptionGet warning interval for message- Returns:
- warning interval (minutes)
- Throws:
SomException- on error
-
queuePriority
public java.lang.Double queuePriority() throws SomExceptionGet queue priority for message- Returns:
- queue priority
- Throws:
SomException- on error- Since:
- R16.5
-
inetId
public java.lang.String inetId() throws SomExceptionGet Internet message id- Returns:
- Internet message id
- Throws:
SomException- on error
-
latestDelivery
public java.lang.String latestDelivery() throws SomExceptionGet latest delivery time- Returns:
- Latest delivery time as UTC Time String
- Throws:
SomException- on error
-
messageType
public java.lang.String messageType() throws SomExceptionGet 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 SomExceptionReturn 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 SomExceptionReturn the message's unique identifier- Returns:
- unique identifier
- Throws:
SomException- on error
-
mlistId
public java.lang.String mlistId() throws SomExceptionReturn 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:SomQmgrHandlerHandles the response to control commands which return an OK/error response plus an info string- Specified by:
handleResponsein interfaceSomHandler- Specified by:
handleResponsein 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:SomQmgrHandlerHandles the response to commands which return a list of channel objects- Specified by:
handleResponsein 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:SomQmgrHandlerHandles the response to commands which return a list of MTA objects- Specified by:
handleResponsein 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:SomQmgrHandlerHandles the response to commands which return a SomMessage object (i.e. read from the Queue or Archive).- Specified by:
handleResponsein 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:SomQmgrHandlerHandles the response to commands which return a list of message objects- Specified by:
handleResponsein 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:SomHandlerHandle the response to a Bind operation- Specified by:
handleBindResponsein 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:SomQmgrHandlerHandles the response to commands which return data about the current object - i.e. we are refreshing an existing object.- Specified by:
handleResponsein 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 SomExceptionDelay 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 SomExceptionCause 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 SomExceptionCause 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
-
-