Class SomQmgrQueueManager

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

public class SomQmgrQueueManager extends SomQmgrObject implements SomQmgrHandler
This class models an M-Switch Queue Manager, and is the top level object from which the channels are accessed.
Author:
tc
  • Field Details

  • Constructor Details

    • SomQmgrQueueManager

      public SomQmgrQueueManager()
      Create a new Queue Manager object with default settings
    • SomQmgrQueueManager

      public SomQmgrQueueManager(SomQmgrQueueManager qmgr, String somSessionPrefix)
  • Method Details

    • getChannels

      public SomQmgrChannel[] getChannels()
      Obtain the set of channels on this M-Switch instance
      Returns:
      Array of channels
    • getHeldMessages

      public SomQmgrMessage[] getHeldMessages()
      Get a set of messages which are in the "held" state
      Returns:
      Array of "held" messages
    • getChannel

      public SomQmgrChannel getChannel(com.isode.dsapi.DN channelDN) throws SomException
      Returns a SomQmgrChannel object of a specific channel, based on the channel DN. May return null, if none found.
      Parameters:
      channelDN - DN representation of a specific channel.
      Returns:
      SomQmgrChannel object for the given channelDN. Or returns null.
      Throws:
      SomException - if there is no string representation for an existing channel's name.
    • isConnectionExpected

      public boolean isConnectionExpected()
      Test whether we are expecting to connect to this Queue Manager
      Returns:
      true if connection expected
    • getState

      public int getState()
      Get current connection state of Queue Manager
      Returns:
      Connection state
    • 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 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, 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 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
    • 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
    • getInfoString

      public String getInfoString()
      Get an information string about the Queue Manager
      Returns:
      String of information about the Queue Manager for display
    • getHoldInfoString

      public String getHoldInfoString()
      Get a string containing information about the number of "held" messages
      Returns:
      information on held messages
    • getStatus

      public void getStatus(SomCommandListener listener) throws SomException
      Refresh the status of the Queue Manager object
      Parameters:
      listener - Object to notify when update complete, which may be null
      Throws:
      SomException - on error
    • getSubordinates

      public void getSubordinates(SomCommandListener listener) throws SomException
      Obtains the subordinate objects of this Queue Manager
      Parameters:
      listener - Object to notify when update complete, which may be null
      Throws:
      SomException - on error
    • getSubordinateChannels

      public void getSubordinateChannels(SomCommandListener listener) throws SomException
      Obtains the subordinate channels of this Queue Manager
      Parameters:
      listener - Object to notify when update complete, which may be null
      Throws:
      SomException - on error
    • searchForHeldMessages

      public void searchForHeldMessages(SomCommandListener listener) throws SomException
      Asks the Queue Manager to get a list of messages in state "held"
      Parameters:
      listener - object to notify when command completes
      Throws:
      SomException - on error
    • reprocess

      public void reprocess(SomCommandListener listener) throws SomException
      Perform a Reprocess operation on all Channels.
      Parameters:
      listener - Listener to notify when operation is complete, which may be null
      Throws:
      SomException - on error
    • performCkadr

      public void performCkadr(SomCommandListener listener, SomQmgrHandler handler, SomQmgrCKADROptions options) throws SomException
      Asks the Queue Manager to check an address
      Parameters:
      listener - Object to notify when update complete, which may be null
      handler - Object which will handle result of operation, which may not be null
      options - Arguments to ckadr operation
      Throws:
      SomException - on error
    • getPort

      public Integer getPort()
      Get the TCP port on which is used for communication with this Queue Manager
      Returns:
      TCP port
    • setPort

      public void setPort(Integer p)
      Set the TCP port on which is used for communication with this Queue Manager
      Parameters:
      p - Port to use
    • getACP127CMPort

      public Integer getACP127CMPort()
      Get the TCP port on which is used for communication with ACP127 channels
      Returns:
      TCP port
    • setACP127CMPort

      public void setACP127CMPort(Integer p)
      Set the TCP port on which is used for communication with ACP127 channels
      Parameters:
      p - Port to use
    • getACPOTAMPort

      public Integer getACPOTAMPort()
      Get the TCP port on which is used for communication with OTAM servers
      Returns:
      TCP port
    • setACPOTAMPort

      public void setACPOTAMPort(Integer p)
      Set the TCP port on which is used for communication with OTAM servers
      Parameters:
      p - Port to use
    • getHostName

      public String getHostName()
      Get the hostname for this Queue Manager
      Returns:
      Hostname
    • setHostName

      public void setHostName(String n)
      Set the hostname for this Queue Manager
      Parameters:
      n - Hostname to use
    • getUsername

      public String getUsername()
      Get the username which we will use when connecting to this Queue Manager
      Returns:
      username
    • setUsername

      public void setUsername(String n)
      Set the username which we will use when connecting to this Queue Manager
      Parameters:
      n - Username for connection (may be a SASL id) which may not be null
    • getPassword

      public String getPassword()
      Get the password which we will use when connecting to this Queue Manager
      Returns:
      password
    • setPassword

      public void setPassword(String pwd)
      Set the password which we will use when connecting to this Queue Manager
      Parameters:
      pwd - Password which may be null
    • getFriendlyName

      public String getFriendlyName()
      Get the configured Friendly Name for this Queue Manager
      Returns:
      friendly name
    • getUniqueName

      public String getUniqueName()
      Get a unique display Name for this Queue Manager
      Returns:
      unique name
    • setFriendlyName

      public void setFriendlyName(String fname)
      Set the Friendly Name for this Queue Manager
      Parameters:
      fname - friendly name which may not be null
    • setConnectionTimeout

      public static void setConnectionTimeout(int value)
      Set the connection timeout used for all SOM sessions created via this object
      Parameters:
      value - the timeout value
    • setUseTls

      public void setUseTls(boolean use)
      Set the flag which indicates whether TLS should be used for this connection
      Parameters:
      use - true to use TLS
    • getUseTls

      public boolean getUseTls()
      Get the value of the flag which indicates whether TLS should be used
      Returns:
      true if TLS in use
    • connect

      public void connect() throws SomException
      Connect to the Queue Manager, using the connection information already configured
      Throws:
      SomException - on error
    • connectACP127CM

      public void connectACP127CM() throws SomException
      Connect to the ACP127 channel
      Throws:
      SomException - on error
    • connectACPOTAM

      public void connectACPOTAM() throws SomException
      Connect to the OTAM server
      Throws:
      SomException - on error
    • disconnect

      public void disconnect() throws SomException
      Disconnect from this Queue Manager (or ACP127 channel or OTAM server), assuming that we are already connected
      Throws:
      SomException - on error
    • incrementMaxChannels

      public void incrementMaxChannels(SomCommandListener listener) throws SomException
      Increment the allowable maximum number of channels (by one)
      Parameters:
      listener - Object to be notified when operation complete, which may be null
      Throws:
      SomException - on error
    • decrementMaxChannels

      public void decrementMaxChannels(SomCommandListener listener) throws SomException
      Decrement the allowable maximum number of channels (by one)
      Parameters:
      listener - Object to be notified when operation complete, which may be null
      Throws:
      SomException - on error
    • enableSubmission

      public void enableSubmission(SomCommandListener listener) throws SomException
      Enable submission into the Queue Manager
      Parameters:
      listener - Object to be notified when operation complete, which may be null
      Throws:
      SomException - on error
    • disableSubmission

      public void disableSubmission(SomCommandListener listener) throws SomException
      Disable submission into the Queue Manager
      Parameters:
      listener - Object to be notified when operation complete, which may be null
      Throws:
      SomException - on error
    • enableAllChannels

      public void enableAllChannels(SomCommandListener listener) throws SomException
      Enable all the channels of this Queue Manager
      Parameters:
      listener - Object to be notified when operation complete, which may be null
      Throws:
      SomException - on error
    • disableAllChannels

      public void disableAllChannels(SomCommandListener listener) throws SomException
      Disable all the channels of this Queue Manager
      Parameters:
      listener - Object to be notified when operation complete, which may be null
      Throws:
      SomException - on error
    • rereadQueue

      public void rereadQueue(SomCommandListener listener) throws SomException
      Tell the Queue Manager to re-read its message queue
      Parameters:
      listener - Object to be notified when operation complete, which may be null
      Throws:
      SomException - on error
    • restart

      public void restart(SomCommandListener listener) throws SomException
      Tell the Queue Manager to restart. Note that this will not work on Windows - the command is ignored by the Queue Manager
      Parameters:
      listener - Object to be notified when operation complete, which may be null
      Throws:
      SomException - on error
    • shutdown

      public void shutdown(SomCommandListener listener) throws SomException
      Tell the Queue Manager to shut down
      Parameters:
      listener - Object to be notified when operation complete, which may be null
      Throws:
      SomException - on error
    • reloadConfiguration

      public void reloadConfiguration(SomCommandListener listener) throws SomException
      Tell the Queue Manager to reload its configuration from the DSA.
      Parameters:
      listener - Object to be notified when operation complete, which may be null
      Throws:
      SomException - on error
    • auditString

      public void auditString(String type, String key, String value, SomCommandListener listener) throws SomException
      Throws:
      SomException
    • addrIn

      public Integer addrIn() throws SomException
      Get the number of inbound addresses which have been received
      Returns:
      number of inbound addresses
      Throws:
      SomException - on error
    • getErrorText

      public String getErrorText()
      Get last error text
      Returns:
      error text
    • addrOut

      public Integer addrOut() throws SomException
      Get the number of outbound addresses processed
      Returns:
      number of addresses
      Throws:
      SomException - on error
    • boottime

      public String boottime() throws SomException
      Get the time at which the Queue Manager was started
      Returns:
      start time (UTC Time string)
      Throws:
      SomException - on error
    • currChans

      public Integer currChans() throws SomException
      Get the current number of running channels
      Returns:
      number of running channels
      Throws:
      SomException - on error
    • inAssoc

      public Integer inAssoc() throws SomException
      Get number of inbound associations
      Returns:
      Number of inbound associations
      Throws:
      SomException - on error
    • maxChans

      public Integer maxChans() throws SomException
      Get maximum number of channels
      Returns:
      max channels
      Throws:
      SomException - on error
    • messagesIn

      public Integer messagesIn() throws SomException
      Get number of inbound messages which have been processed.
      Returns:
      number of inbound messages
      Throws:
      SomException - on error
    • messagesOut

      public Integer messagesOut() throws SomException
      Get number of outbound messages which have been processed.
      Returns:
      number of outbound messages
      Throws:
      SomException - on error
    • msgsInPerSec

      public Integer msgsInPerSec() throws SomException
      Get average number of inbound messages per second
      Returns:
      average number of inbound messages per second
      Throws:
      SomException - on error
    • msgsOutPerSec

      public Integer msgsOutPerSec() throws SomException
      Get average number of outbound messages per second
      Returns:
      average number of outbound messages per second
      Throws:
      SomException - on error
    • opsPerSecond

      public Integer opsPerSecond() throws SomException
      Get average number of operations per second
      Returns:
      average number of operations per second
      Throws:
      SomException - on error
    • outAssoc

      public Integer outAssoc() throws SomException
      Get total number of outbound associations which have been made.
      Returns:
      number of outbound associations
      Throws:
      SomException - on error
    • reporttime

      public String reporttime() throws SomException
      Returns the time (local to the Queue Manager) at which the status check was performed. This allows the user of the SOM client API to detect differences between the clock settings on the client and Queue Manager systems (if any).
      Returns:
      Queue Manager local time (UTC time string)
      Throws:
      SomException - on error
    • runnableChans

      public Integer runnableChans() throws SomException
      Get the number of runnable channels on this Queue Manager
      Returns:
      number of runnable channels
      Throws:
      SomException - on error
    • totalDrs

      public Integer totalDrs() throws SomException
      Get the total number of DRs in the Queue
      Returns:
      total number of DRs in Queue
      Throws:
      SomException - on error
    • totalInAssoc

      public Integer totalInAssoc() throws SomException
      Get the current number of inbound associations to the Queue Manager
      Returns:
      current number of inbound associations
      Throws:
      SomException - on error
    • totalMsgs

      public Integer totalMsgs() throws SomException
      Get the current number of messages in the Queue
      Returns:
      current number of messages in the queue
      Throws:
      SomException - on error
    • heldMsgs

      public Integer heldMsgs() throws SomException
      Get the current number of messages in the Queue
      Returns:
      current number of messages in the queue
      Throws:
      SomException - on error
    • totalOutAssoc

      public Integer totalOutAssoc() throws SomException
      Get the current number of outbound associations from the Queue Manager
      Returns:
      current number of outbound associations
      Throws:
      SomException - on error
    • totalVolume

      public Integer totalVolume() throws SomException
      Get the current volume of messages in the queue
      Returns:
      volume of message in the queue
      Throws:
      SomException - on error
    • version

      public String version() throws SomException
      Get Queue Manager version string
      Returns:
      version string
      Throws:
      SomException - on error
    • hostname

      public String hostname() throws SomException
      Get hostname of system on which the Queue Manager is running
      Returns:
      hostname of Queue Manager system
      Throws:
      SomException - on error
    • chanRate

      public Integer chanRate() throws SomException
      Get average number of channels blocked
      Returns:
      channel block rate
      Throws:
      SomException - on error
    • dirname

      public String dirname() throws SomException
      Get Queue Manager DN (if directory-based configuration is in use)
      Returns:
      Queue Manager DN
      Throws:
      SomException - on error
    • failedConvert

      public Integer failedConvert() throws SomException
      Get number of failed conversion operations
      Returns:
      number of failed conversions
      Throws:
      SomException - on error
    • failedInAssoc

      public Integer failedInAssoc() throws SomException
      Get number of failed inbound connections
      Returns:
      number of failed inbound connections
      Throws:
      SomException - on error
    • lastInboundTime

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

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

      public Integer loopsDetected() throws SomException
      Get number of loops detected
      Returns:
      number of loops detected
      Throws:
      SomException - on error
    • oprateMax

      public Integer oprateMax() throws SomException
      Get maximum operation rate
      Returns:
      max operation rate
      Throws:
      SomException - on error
    • oprateReserve

      public Integer oprateReserve() throws SomException
      Get reserve operation rate
      Returns:
      reserve operation rate
      Throws:
      SomException - on error
    • receivedVolume

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

      public Integer rejectedAssoc() throws SomException
      Get total number of rejected associations
      Returns:
      total number of rejected associations
      Throws:
      SomException - on error
    • somVersion

      public Integer somVersion() throws SomException
      Get SOM version for the Queue Manager
      Returns:
      SOM version
      Throws:
      SomException - on error
    • status

      public Integer status() throws SomException
      Get Queue Manager status code
      Returns:
      status code
      Throws:
      SomException - on error
    • statusString

      public String statusString() throws SomException
      Get Queue Manager status as string
      Returns:
      status string
      Throws:
      SomException - on error
    • osType

      public String osType() throws SomException
      Get operating system type string for Queue Manager system
      Returns:
      OS type string
      Throws:
      SomException - on error
    • storedRecipients

      public Integer storedRecipients() throws SomException
      Get number of recipient addresses in queue
      Returns:
      number of recipient address in queue
      Throws:
      SomException - on error
    • transmittedVolume

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

      public void minimise(int priority, Date start, Date stop, SomCommandListener listener) throws SomException
      Start a MINIMISE operation
      Parameters:
      priority - minimum priority for MINIMISE
      start - start time (UTC time string) which may be null
      stop - stop time (UTC time string) which may be null
      listener - object to be notified when operation complete which may be null
      Throws:
      SomException - on error
    • getCurrentTimeOffset

      public Integer getCurrentTimeOffset()
      Returns:
      difference between localhost current time and qmgr current time in seconds
    • getCurrentTime

      public Date getCurrentTime()
      Returns:
      current time of the qmgr
    • getHostAliases

      public Vector<String> getHostAliases()
      Get the aliases we have registed for this Queue Manager's hostname
      Returns:
      Vector of alias names
    • setHostAliases

      public void setHostAliases(List<String> hostAliases)
      Set the aliases for this host
      Parameters:
      hostAliases - which may be null
    • setNoServices

      public void setNoServices(Boolean val)
      Configure this Queue Manager as one for which we will not attempt to manage services
      Parameters:
      val - true if we do not want to manage services
    • getNoServices

      public Boolean getNoServices()
      Get indication of whether we want to manage services for this Queue Manager
      Returns:
      true if we do not want to manage services
    • setSaslMechanism

      public void setSaslMechanism(String mech)
      Configure the name of the SASL mechanism which we want to use for authentication
      Parameters:
      mech - mechanism name which may be null
    • getSaslMechanism

      public String getSaslMechanism()
      Get the name of the SASL mechanism
      Returns:
      SASL mechanism name
    • setUseACP127OTAMPort

      public void setUseACP127OTAMPort(boolean value)
      Configure this Queue Manager object to use the OTAM port
      Parameters:
      value - true if this object should use the OTAM port
    • setUseACP127CMPort

      public void setUseACP127CMPort(boolean value)
      Configure this Queue Manager object to use the ACP127 channel port
      Parameters:
      value - true if this object should use the ACP127 channel port
    • getUseACP127OTAMPort

      public boolean getUseACP127OTAMPort()
      Find out if this Queue Manager object is using the OTAM port
      Returns:
      true if this object is using the OTAM port
    • getUseACP127CMPort

      public boolean getUseACP127CMPort()
      Find out if this Queue Manager object is using the ACP127 channel port
      Returns:
      true if this object is using the ACP127 channel port
    • getAcp127TestTapeTemplateDir

      public String getAcp127TestTapeTemplateDir()
      Get the ACP127 Test Tape template directory
      Returns:
      test tape template directory
    • setAcp127TestTapeTemplateDir

      public void setAcp127TestTapeTemplateDir(String acp127TestTapeTemplateDir)
      Set the ACP127 Test Tape template directory
      Parameters:
      acp127TestTapeTemplateDir - test tape template directory
    • getUseACP127RepairPort

      public boolean getUseACP127RepairPort()
      Find out if this Queue Manager object is using the ACP127 repair port
      Returns:
      true if this object is using the ACP127 repair port
    • getACP127RepairPort

      public Integer getACP127RepairPort()
      Get the ACP127 repair port
      Returns:
      the ACP127 repair port
    • loggingFreePercent

      public Integer loggingFreePercent() throws SomException
      Get percentage free space on logging filesystem
      Returns:
      percentage
      Throws:
      SomException - on error
    • archiveFreePercent

      public Integer archiveFreePercent() throws SomException
      Get percentage free space on archive filesystem
      Returns:
      percentage
      Throws:
      SomException - on error
    • queueFreePercent

      public Integer queueFreePercent() throws SomException
      Get percentage free space on queue filesystem
      Returns:
      percentage
      Throws:
      SomException - on error
    • lastOperation

      public String lastOperation() throws SomException
      Throws:
      SomException
    • lastOperationTime

      public String lastOperationTime() throws SomException
      Throws:
      SomException
    • getConfigDN

      public com.isode.dsapi.DN getConfigDN()
    • setConfigDN

      public void setConfigDN(com.isode.dsapi.DN configDN)
    • isRemoteMTA

      public boolean isRemoteMTA()
    • setRemoteMTA

      public void setRemoteMTA(boolean val)
    • getProductMaxVer

      public String getProductMaxVer() throws SomException
      Throws:
      SomException
    • getProductExpiryDate

      public String getProductExpiryDate() throws SomException
      Throws:
      SomException
    • getProductName

      public String getProductName() throws SomException
      Throws:
      SomException
    • getProductFamily

      public String getProductFamily() throws SomException
      Throws:
      SomException
    • getProductSubfeatures

      public String getProductSubfeatures() throws SomException
      Throws:
      SomException
    • getProductBanner

      public String getProductBanner() throws SomException
      Throws:
      SomException