Class SomQmgrMta

java.lang.Object
com.isode.som.qmgr.objects.SomQmgrObject
com.isode.som.qmgr.objects.SomQmgrMta
All Implemented Interfaces:
SomQmgrHandler, SomHandler

public class SomQmgrMta extends SomQmgrObject implements SomQmgrHandler
Class which models a Peer MTA object within M-Switch
Author:
tc
  • Constructor Details

    • SomQmgrMta

      public SomQmgrMta(SomSession session)
      Create a new MTA object
      Parameters:
      session - Session which the message is associated with, which cannot be null
    • SomQmgrMta

      public SomQmgrMta(SomSession session, String[] pairs)
      Create a new MTA object, populating it from the attribute pairs
      Parameters:
      session - Session which the message is associated with, which cannot be null
      pairs - Attribute pairs to use which cannot be null
  • Method Details

    • setSomVersion

      public void setSomVersion(Integer v)
      Set the SOM version associated with this MTA
      Parameters:
      v - the version of SOM protocol used to access this MTA
    • getMtaName

      public String getMtaName()
      Get the name of this MTA
      Returns:
      The String representation of this MTA or "Unknown".
    • parsePairs

      public void parsePairs(String[] pairs)
      Parse the Attribute pairs passed in
      Overrides:
      parsePairs in class SomQmgrObject
      Parameters:
      pairs - Array of attribute type:value strings which may not be null
    • addMessage

      public void addMessage(SomQmgrMessage object)
      Add a new message to the object
      Parameters:
      object - Message to add which cannot be null
    • getMessages

      public SomQmgrMessage[] getMessages()
      Get the messages subordinate to this MTA
      Returns:
      Array of messages
    • removeFromArray

      public void removeFromArray(ArrayList<SomQmgrMta> mtas)
      Remove this MTA from the array passed in
      Parameters:
      mtas - Array of MTAs from which this one should be remove, which cannot be null
    • getInboundMessages

      public SomQmgrInboundMessage[] getInboundMessages()
      Get the inbound messages subordinate to this MTA
      Returns:
      Array of inbound messages
    • getAssociations

      public SomQmgrAssociation[] getAssociations()
      Get the associations subordinate to this MTA
      Returns:
      Array of associations
    • getSchedules

      public SomQmgrSchedule[] getSchedules()
      Get the schedules subordinate to this MTA
      Returns:
      Array of schedules
    • 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, 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
    • 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 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 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
    • 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, SomQmgrQueueManager 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
    • getStatus

      public void getStatus(SomCommandListener listener) throws SomException
      Update the status of this MTA object by querying the Queue Manager
      Parameters:
      listener - Listener to notify when update complete, which may be null
      Throws:
      SomException - on error
    • refreshSubordinates

      public void refreshSubordinates(SomCommandListener listener) throws SomException
      Refresh the list of subordinate messages of this MTA
      Parameters:
      listener - Listener to notify when update complete, which may be null
      Throws:
      SomException - on error
    • refreshSubordinates

      public void refreshSubordinates(SomCommandListener listener, Integer sizelimit) throws SomException
      Refresh the list of subordinate messages of this MTA, with size limit
      Parameters:
      listener - Listener to notify when update complete, which may be null
      sizelimit - Limit on number of entries to return, which may not be null
      Throws:
      SomException - on error
    • buildInfoString

      public String buildInfoString()
      Generate an information string for this MTA
      Returns:
      info string
    • getSubordinateMessages

      public void getSubordinateMessages(SomCommandListener listener) throws SomException
      Get the subordinate messages of this MTA
      Parameters:
      listener - Listener to notify when update complete, which may be null
      Throws:
      SomException - on error
    • getSubordinateMessages

      public void getSubordinateMessages(SomCommandListener listener, Integer sizelimit) throws SomException
      Get the subordinate messages of this MTA
      Parameters:
      listener - Listener to notify when update complete, which may be null
      sizelimit - Limit on number of messages, which may not be null
      Throws:
      SomException - on error
    • clear

      public void clear(SomCommandListener listener) throws SomException
      Clear any delay on this MTA
      Parameters:
      listener - Listener to notify when operation is complete, which may be null
      Throws:
      SomException - on error
    • enable

      public void enable(SomCommandListener listener) throws SomException
      Enable this MTA, if disabled
      Parameters:
      listener - Listener to notify when operation is complete, which may be null
      Throws:
      SomException - on error
    • disable

      public void disable(SomCommandListener listener) throws SomException
      Disable this MTA
      Parameters:
      listener - Listener to notify when operation is complete, which may be null
      Throws:
      SomException - on error
    • delay

      public void delay(int mins, SomCommandListener listener) throws SomException
      Delay this MTA
      Parameters:
      mins - Number of minutes to delay by
      listener - Listener to notify when operation is complete, which may be null
      Throws:
      SomException - on error
    • downwardsforce

      public void downwardsforce(SomCommandListener listener) throws SomException
      Clear delays and enable this MTA and subordinate messages
      Parameters:
      listener - Listener to notify when operation is complete, which may be null
      Throws:
      SomException - on error
    • reprocess

      public void reprocess(SomCommandListener listener) throws SomException
      Reprocess all messages on this MTA
      Parameters:
      listener - Listener to notify when operation is complete, which may be null
      Throws:
      SomException - on error
    • delete

      public void delete(SomCommandListener listener) throws SomException
      Delete this permanent peer MTA
      Parameters:
      listener - Listener to notify when operation is complete, which may be null
      Throws:
      SomException - on error
    • connect

      public void connect(SomCommandListener listener) throws SomException
      Connect to this permanent peer MTA
      Parameters:
      listener - Listener to notify when operation is complete, which may be null
      Throws:
      SomException - on error
    • disconnect

      public void disconnect(SomCommandListener listener) throws SomException
      Disconnect from this permanent peer MTA
      Parameters:
      listener - Listener to notify when operation is complete, which may be null
      Throws:
      SomException - on error
    • enableInbound

      public void enableInbound(SomCommandListener listener) throws SomException
      Enable inbound connections to this peer MTA
      Parameters:
      listener - Listener to notify when operation is complete, which may be null
      Throws:
      SomException - on error
    • disableInbound

      public void disableInbound(SomCommandListener listener) throws SomException
      Disable inbound connections to this peer MTA
      Parameters:
      listener - Listener to notify when operation is complete, which may be null
      Throws:
      SomException - on error
    • active

      public String active() throws SomException
      Test whether this MTA is active or not
      Returns:
      true if MTA is active
      Throws:
      SomException - on error
    • activeNumber

      public Integer activeNumber() throws SomException
      Get number of active associations on this MTA
      Returns:
      Number of active associations
      Throws:
      SomException - on error
    • cachedUntil

      public String cachedUntil() throws SomException
      Get time until which this MTA is cached
      Returns:
      Time until which MTA is cached (UTC Time String)
      Throws:
      SomException - on error
    • channel

      public String channel() throws SomException
      Get channel name for this MTA
      Returns:
      Channel name
      Throws:
      SomException - on error
    • enabled

      public String enabled() throws SomException
      Get string indicating whether MTA is enabled
      Returns:
      String "True" if MTA enabled, else "False"
      Throws:
      SomException - on error
    • activeBool

      public boolean activeBool() throws SomException
      Test whether MTA active
      Returns:
      true if active
      Throws:
      SomException - on error
    • enabledBool

      public boolean enabledBool() throws SomException
      Test whether MTA enabled
      Returns:
      true if enabled
      Throws:
      SomException - on error
    • info

      public String info() throws SomException
      Get information string for Peer MTA
      Returns:
      Information string
      Throws:
      SomException - on error
    • lastAttempt

      public String lastAttempt() throws SomException
      Get time of last attempted connection
      Returns:
      Time of last attempted connection (UTC time string)
      Throws:
      SomException - on error
    • lastSuccess

      public String lastSuccess() throws SomException
      Get time of last successful connection
      Returns:
      Time of last successful connection (UTC time string)
      Throws:
      SomException - on error
    • mta

      public String mta() throws SomException
      Get MTA name
      Returns:
      MTA Name
      Throws:
      SomException - on error
    • numberMessages

      public Integer numberMessages() throws SomException
      Get number of messages queued
      Returns:
      Number of messages on MTA
      Throws:
      SomException - on error
    • numberReports

      public Integer numberReports() throws SomException
      Get number of reports queued
      Returns:
      Number of reports on MTA
      Throws:
      SomException - on error
    • oldestMessage

      public String oldestMessage() throws SomException
      Get age of oldest message
      Returns:
      Age of oldest message (UTC Time string)
      Throws:
      SomException - on error
    • volumeMessages

      public Integer volumeMessages() throws SomException
      Get volume of messages queued
      Returns:
      Volume of messages on MTA (bytes)
      Throws:
      SomException - on error
    • addressesIn

      public Integer addressesIn() throws SomException
      Get total number of inbound addresses handled
      Returns:
      Total number of inbound addresses
      Throws:
      SomException - on error
    • addressesOut

      public Integer addressesOut() throws SomException
      Get total number of outbound addresses handled
      Returns:
      Total number of outbound addresses
      Throws:
      SomException - on error
    • creationTime

      public String creationTime() throws SomException
      Get creation time of this MTA
      Returns:
      Creation time of MTA (UTC Time string)
      Throws:
      SomException - on error
    • description

      public String description() throws SomException
      Get MTA description
      Returns:
      MTA description
      Throws:
      SomException - on error
    • enabledInboundBool

      public boolean enabledInboundBool() throws SomException
      Check whether this MTA is enabled for inbound connections
      Returns:
      true if enabled for inbound connections
      Throws:
      SomException - on error
    • enabledInbound

      public String enabledInbound() throws SomException
      Check whether this MTA is enabled for inbound connections
      Returns:
      "True" if enabled for inbound connections
      Throws:
      SomException - on error
    • errorCount

      public Integer errorCount() throws SomException
      Get count of errors on this MTA
      Returns:
      error count
      Throws:
      SomException - on error
    • failedConversions

      public Integer failedConversions() throws SomException
      Get count of failed conversions on this MTA
      Returns:
      count of failed conversions
      Throws:
      SomException - on error
    • failedOutAssoc

      public Integer failedOutAssoc() throws SomException
      Get count of failed outbound associations on this MTA
      Returns:
      count of failed outbound associations
      Throws:
      SomException - on error
    • hierarchy

      public Integer hierarchy() throws SomException
      Get this MTA's hierarchy value
      Returns:
      hierarchy value
      Throws:
      SomException - on error
    • inAssoc

      public Integer inAssoc() throws SomException
      Get current number of inbound associations on this MTA
      Returns:
      current number of inbound associations
      Throws:
      SomException - on error
    • index

      public Integer index() throws SomException
      Get this MTA's index value
      Returns:
      index value
      Throws:
      SomException - on error
    • lastInboundTime

      public String lastInboundTime() throws SomException
      Get time of last inbound association on this MTA
      Returns:
      time of inbound associations (UTC Time string)
      Throws:
      SomException - on error
    • lastOutboundTime

      public String lastOutboundTime() throws SomException
      Get time of last outbound association on this MTA
      Returns:
      time of outbound associations (UTC Time string)
      Throws:
      SomException - on error
    • loopsDetected

      public Integer loopsDetected() throws SomException
      Get count of loops detected on this MTA
      Returns:
      count of loops detected
      Throws:
      SomException - on error
    • maxInboundConnections

      public Integer maxInboundConnections() throws SomException
      Get maximum permitted number of inbound connections
      Returns:
      maximum permitted inbound connections
      Throws:
      SomException - on error
    • maxOutboundConnections

      public Integer maxOutboundConnections() throws SomException
      Get maximum permitted number of outbound connections
      Returns:
      maximum permitted outbound connections
      Throws:
      SomException - on error
    • messagesIn

      public Integer messagesIn() throws SomException
      Get total number of inbound messages received
      Returns:
      total number of inbound messages received
      Throws:
      SomException - on error
    • messagesOut

      public Integer messagesOut() throws SomException
      Get total number of outbound messages sent
      Returns:
      total number of outbound messages sent
      Throws:
      SomException - on error
    • mtaConnectingBool

      public boolean mtaConnectingBool() throws SomException
      Test whether MTA is currently connecting
      Returns:
      true if connecting
      Throws:
      SomException - on error
    • mtaConnecting

      public String mtaConnecting() throws SomException
      Test whether MTA is currently connecting
      Returns:
      string "True" if connecting
      Throws:
      SomException - on error
    • oldestMessageId

      public String oldestMessageId() throws SomException
      Get Queue Id of oldest message
      Returns:
      queueid of oldest message
      Throws:
      SomException - on error
    • outboundAssociations

      public Integer outboundAssociations() throws SomException
      Get number of current outbound associations
      Returns:
      current number of outbound associations
      Throws:
      SomException - on error
    • protocol

      public String protocol() throws SomException
      Get protocol id for MTA
      Returns:
      String encoding of protocol id
      Throws:
      SomException - on error
    • receivedVolume

      public Integer receivedVolume() throws SomException
      Get total volume of received messages
      Returns:
      total volume of received messages
      Throws:
      SomException - on error
    • refuseStatus

      public String refuseStatus() throws SomException
      Get last outbound connection refusal status as x.y.z string
      Returns:
      Last connection refusal status
      Throws:
      SomException - on error
    • refuseText

      public String refuseText() throws SomException
      Get last outbound connection refusal reason text
      Returns:
      Last connection refusal reason text
      Throws:
      SomException - on error
    • refuseTime

      public String refuseTime() throws SomException
      Get last outbound connection refusal time
      Returns:
      Last connection refusal time (UTC Time String)
      Throws:
      SomException - on error
    • rejectTime

      public String rejectTime() throws SomException
      Get last inbound connection reject time
      Returns:
      Last connection reject time (UTC Time String)
      Throws:
      SomException - on error
    • rejectedAssoc

      public Integer rejectedAssoc() throws SomException
      Get number of rejected inbound connections
      Returns:
      Total number of rejected inbound connections
      Throws:
      SomException - on error
    • rejectedMessage

      public Integer rejectedMessage() throws SomException
      Get number of rejected inbound messages
      Returns:
      Total number of rejected inbound messages
      Throws:
      SomException - on error
    • rejectStatus

      public Integer rejectStatus() throws SomException
      Get last inbound connection rejection status as x.y.z string
      Returns:
      Last inbound connection rejection status
      Throws:
      SomException - on error
    • storedRecipients

      public Integer storedRecipients() throws SomException
      Get the number of stored recipients
      Returns:
      Number of stored recipients
      Throws:
      SomException - on error
    • successfulConversions

      public Integer successfulConversions() throws SomException
      Get the number of successful conversions (for a shaper channel MTA)
      Returns:
      Number of successful conversions
      Throws:
      SomException - on error
    • totalInAssoc

      public Integer totalInAssoc() throws SomException
      Get total number of inbound associations
      Returns:
      Total number of inbound associations
      Throws:
      SomException - on error
    • totalOutAssoc

      public Integer totalOutAssoc() throws SomException
      Get total number of outbound associations
      Returns:
      Total number of outbound associations
      Throws:
      SomException - on error
    • diverted

      public Boolean diverted() throws SomException
      Whether MTA has the 'divert' flag set or not
      Returns:
      Diverted or not
      Throws:
      SomException - on error
    • transmittedVolume

      public Integer transmittedVolume() throws SomException
      Get total volume of transmitted messages
      Returns:
      Total volume of transmitted messages (bytes)
      Throws:
      SomException - on error
    • rerouted

      public String rerouted() throws SomException
      Throws:
      SomException
    • deleteMessages

      public void deleteMessages(SomCommandListener listener) throws SomException
      Delete all the messages on this MTA
      Parameters:
      listener - Listener object which will be notified when complete which may be null
      Throws:
      SomException - on error
    • nondeliverMessages

      public void nondeliverMessages(String reason, SomCommandListener listener) throws SomException
      Nondeliver all the messages on this MTA
      Parameters:
      reason - String reason text which may not be null
      listener - Listener object which will be notified when complete which may be null
      Throws:
      SomException - on error
    • timeoutMessages

      public void timeoutMessages(SomCommandListener listener) throws SomException
      Time out all the messages on this MTA
      Parameters:
      listener - Listener object which will be notified when complete which may be null
      Throws:
      SomException - on error