Class 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
    • Constructor Detail

      • SomQmgrQueueManager

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

        public SomQmgrQueueManager​(SomQmgrQueueManager qmgr,
                                   java.lang.String somSessionPrefix)
    • Method Detail

      • 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,
                                       java.lang.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,
                                   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 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,
                                   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 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 java.lang.String getInfoString()
        Get an information string about the Queue Manager
        Returns:
        String of information about the Queue Manager for display
      • getHoldInfoString

        public java.lang.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 java.lang.Integer getPort()
        Get the TCP port on which is used for communication with this Queue Manager
        Returns:
        TCP port
      • setPort

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

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

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

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

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

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

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

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

        public void setUsername​(java.lang.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 java.lang.String getPassword()
        Get the password which we will use when connecting to this Queue Manager
        Returns:
        password
      • setPassword

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

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

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

        public void setFriendlyName​(java.lang.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
      • addrIn

        public java.lang.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 java.lang.String getErrorText()
        Get last error text
        Returns:
        error text
      • addrOut

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

        public java.lang.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 java.lang.Integer currChans()
                                    throws SomException
        Get the current number of running channels
        Returns:
        number of running channels
        Throws:
        SomException - on error
      • inAssoc

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

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

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

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

        public java.lang.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 java.lang.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 java.lang.Integer opsPerSecond()
                                       throws SomException
        Get average number of operations per second
        Returns:
        average number of operations per second
        Throws:
        SomException - on error
      • outAssoc

        public java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.String version()
                                 throws SomException
        Get Queue Manager version string
        Returns:
        version string
        Throws:
        SomException - on error
      • hostname

        public java.lang.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 java.lang.Integer chanRate()
                                   throws SomException
        Get average number of channels blocked
        Returns:
        channel block rate
        Throws:
        SomException - on error
      • dirname

        public java.lang.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 java.lang.Integer failedConvert()
                                        throws SomException
        Get number of failed conversion operations
        Returns:
        number of failed conversions
        Throws:
        SomException - on error
      • failedInAssoc

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

        public java.lang.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 java.lang.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 java.lang.Integer loopsDetected()
                                        throws SomException
        Get number of loops detected
        Returns:
        number of loops detected
        Throws:
        SomException - on error
      • oprateMax

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

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

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

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

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

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

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

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

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

        public java.lang.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,
                             java.util.Date start,
                             java.util.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 java.lang.Integer getCurrentTimeOffset()
        Returns:
        difference between localhost current time and qmgr current time in seconds
      • getCurrentTime

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

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

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

        public void setNoServices​(java.lang.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 java.lang.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​(java.lang.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 java.lang.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 java.lang.String getAcp127TestTapeTemplateDir()
        Get the ACP127 Test Tape template directory
        Returns:
        test tape template directory
      • setAcp127TestTapeTemplateDir

        public void setAcp127TestTapeTemplateDir​(java.lang.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 java.lang.Integer getACP127RepairPort()
        Get the ACP127 repair port
        Returns:
        the ACP127 repair port
      • loggingFreePercent

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

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

        public java.lang.Integer queueFreePercent()
                                           throws SomException
        Get percentage free space on queue filesystem
        Returns:
        percentage
        Throws:
        SomException - on error
      • 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)