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
  • Constructor Details

    • SomQmgrMessage

      public SomQmgrMessage(SomSession session, String cName, String mName)
      Create a new Message object
      Parameters:
      session - SOM session with which it is associated which must not be null
      cName - channel name which must not be null
      mName - mta name which may be null
    • SomQmgrMessage

      public SomQmgrMessage(SomSession session, String c, String m, 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 null
      c - channel name which must not be null
      m - mta name which may be null
      pairs - attribute pairs which may no be null
  • Method Details

    • parsePairs

      public void parsePairs(String[] pairs)
      Overrides:
      parsePairs in class SomQmgrObject
    • removeFromArray

      public void removeFromArray(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 String mta() throws SomException
      Get MTA name for this message object
      Returns:
      MTA name
      Throws:
      SomException - on error
    • getChannelName

      public String getChannelName() throws SomException
      Get name of channel on which this message is queued
      Returns:
      channel name
      Throws:
      SomException - on error
    • age

      public 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 String contenttype() throws SomException
      Get the content type of this message
      Returns:
      Content type in string representation
      Throws:
      SomException - on error
    • contentTypeDescription

      public static String contentTypeDescription(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 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(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 String deferredTime() throws SomException
      Get deferred delivery time for this message, if any
      Returns:
      Deferred delivery time
      Throws:
      SomException - on error
    • eits

      public String eits() throws SomException
      Get encoded information types for this message
      Returns:
      EITs as a string
      Throws:
      SomException - on error
    • errorCount

      public 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 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 String inChannel() throws SomException
      Get inbound channel for this message
      Returns:
      Inbound channel name
      Throws:
      SomException - on error
    • inMta

      public String inMta() throws SomException
      Get inbound MTA name for this message
      Returns:
      Inbound MTA name
      Throws:
      SomException - on error
    • mpduiden

      public String mpduiden() throws SomException
      Get MPDU Identifier for this message
      Returns:
      MPDU Id
      Throws:
      SomException - on error
    • numberWarningsSent

      public 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 String originator() throws SomException
      Get originator address for this message
      Returns:
      Originator address in string encoding
      Throws:
      SomException - on error
    • priority

      public Integer priority() throws SomException
      Get priority of this message
      Returns:
      Priority
      Throws:
      SomException - on error
    • queueid

      public String queueid() throws SomException
      Get Queue Identifier of this message (e.g. msg.12345-0)
      Returns:
      Queue ID
      Throws:
      SomException - on error
    • size

      public Integer size() throws SomException
      Get size of message in bytes
      Returns:
      size in bytes
      Throws:
      SomException - on error
    • uaContentId

      public String uaContentId() throws SomException
      Get UA Content Identifier for the message
      Returns:
      UA content id
      Throws:
      SomException - on error
    • warnInterval

      public Integer warnInterval() throws SomException
      Get warning interval for message
      Returns:
      warning interval (minutes)
      Throws:
      SomException - on error
    • queuePriority

      public Double queuePriority() throws SomException
      Get queue priority for message
      Returns:
      queue priority
      Throws:
      SomException - on error
      Since:
      R16.5
    • inetId

      public String inetId() throws SomException
      Get Internet message id
      Returns:
      Internet message id
      Throws:
      SomException - on error
    • latestDelivery

      public String latestDelivery() throws SomException
      Get latest delivery time
      Returns:
      Latest delivery time as UTC Time String
      Throws:
      SomException - on error
    • messageType

      public 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 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 String uniqueId() throws SomException
      Return the message's unique identifier
      Returns:
      unique identifier
      Throws:
      SomException - on error
    • mlistId

      public 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, 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 interface SomHandler
      Specified by:
      handleResponse in interface SomQmgrHandler
      Parameters:
      command - the SOM command
      status - operation status
      detail - 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 interface SomQmgrHandler
      Parameters:
      command - the SOM command
      status - operation status
      object - 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 interface SomQmgrHandler
      Parameters:
      command - the SOM command
      status - operation status
      object - 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 interface SomQmgrHandler
      Parameters:
      obj - the SOM command
      status - operation status
      msg - 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 interface SomQmgrHandler
      Parameters:
      command - the SOM command
      status - operation status
      object - a qmgr message object
    • handleBindResponse

      public void handleBindResponse(int status, String detail)
      Description copied from interface: SomHandler
      Handle the response to a Bind operation
      Specified by:
      handleBindResponse in interface SomHandler
      Parameters:
      status - operation status
      detail - error detail on failure
    • handleResponse

      public void handleResponse(SomCommand command, int status, 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 interface SomQmgrHandler
      Parameters:
      command - the SOM command
      status - operation status
      pairs - 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 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 for
      listener - 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, Double forceValue) throws SomException
      Force processing of this message.
      Parameters:
      listener - Listener object to be notified when operation completes, which may be null
      forceValue - 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(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 null
      listener - Listener object to be notified when operation complete, which may be null
      Throws:
      SomException - on error
    • nondeliver

      public void nondeliver(String reason, SomCommandListener listener) throws SomException
      Cause the message to be non delivered
      Parameters:
      reason - Non-delivery reason which may be null
      listener - 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