Class SomPumiceMessageStore

  • All Implemented Interfaces:
    SomPumiceHandler, SomHandler

    public class SomPumiceMessageStore
    extends SomPumiceObject
    implements SomPumiceHandler
    Class which models an Isode X.400 Message Store server, including the mailboxes which it supports and any P7/P3 connections into and out of the server.
    Author:
    tc
    • Field Detail

      • som_version

        public java.lang.Integer som_version
      • SOM_PUMICE_DISCONNECTED

        public static final int SOM_PUMICE_DISCONNECTED
        See Also:
        Constant Field Values
      • SOM_PUMICE_CONNECTED_ANON

        public static final int SOM_PUMICE_CONNECTED_ANON
        See Also:
        Constant Field Values
      • SOM_PUMICE_CONNECTED_AUTH

        public static final int SOM_PUMICE_CONNECTED_AUTH
        See Also:
        Constant Field Values
    • Constructor Detail

      • SomPumiceMessageStore

        public SomPumiceMessageStore()
        Create a new empty Message Store object, with some default settings
    • Method Detail

      • 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
      • setSizeLimits

        public void setSizeLimits​(java.lang.Integer mailboxSizeLimit,
                                  java.lang.Integer messageSizeLimit,
                                  java.lang.Integer connectionSizeLimit)
        Configure the sizelimits which we will use when requesting information about the number of mailboxes, connections and message from the MS.
        Parameters:
        mailboxSizeLimit - limit on the number of mailboxes on which to report
        messageSizeLimit - limit on the number of messages on which to report
        connectionSizeLimit - limit on the number of connections on which to report
      • getMailboxes

        public SomPumiceMailbox[] getMailboxes()
        Get the set of mailboxes which have been read from the Message Store server
        Returns:
        Array of SomPumiceMailbox objects
      • getConnections

        public SomPumiceConnection[] getConnections()
        Get the set of connections which have been read from the Message Store server
        Returns:
        Array of SomPumiceConnection objects
      • isConnectionExpected

        public boolean isConnectionExpected()
        Check whether we are in the middle of connecting to the Store server
        Returns:
        boolean if expecting to connect
      • getState

        public int getState()
        Return current state of connection
        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: SomHandler
        Generic command response handler
        Specified by:
        handleResponse in interface SomHandler
        Specified by:
        handleResponse in interface SomPumiceHandler
        Parameters:
        command - the command to which the response applies
        status - status from command
        detail - error detail
      • getInfoString

        public java.lang.String getInfoString()
        Get a string summarizing the connection state of the server stats on message counts
        Returns:
        Information string
      • getStatus

        public void getStatus​(SomCommandListener listener)
                       throws SomException
        Issue a SOM command requesting the status of this object. The response data will be used to update the object, and the listener will be informed.
        Parameters:
        listener - Object to notify once status has been updated
        Throws:
        SomException - on error
      • getSubordinateMailboxes

        public void getSubordinateMailboxes​(SomCommandListener listener)
                                     throws SomException
        Issue a SOM command requesting the list of mailboxes subordinate to this Store. The response data will be used to update the Store object's internal list, and the listener will be informed.
        Parameters:
        listener - Object to notify once list of mailboxes has been updated
        Throws:
        SomException - on error
      • getSubordinateConnections

        public void getSubordinateConnections​(SomCommandListener listener)
                                       throws SomException
        Issue a SOM command requesting the list of connections to this Store. The response data will be used to update the Store object's internal list, and the listener will be informed.
        Parameters:
        listener - Object to notify once list of connections has been updated
        Throws:
        SomException - on error
      • getPort

        public int getPort()
        Get the port used to connect to the Message Store
        Returns:
        the port used
      • setPort

        public void setPort​(int p)
        Set the port used to connect to the Message Store
        Parameters:
        p - the port to be used
      • getHostName

        public java.lang.String getHostName()
        Get the host name used to connect to the Message Store
        Returns:
        the host name
      • setHostName

        public void setHostName​(java.lang.String n)
        Set the host name used to connect to the Message Store
        Parameters:
        n - the host name to use
      • getUsername

        public java.lang.String getUsername()
        Get the user name (SASL id) used when connecting to the Message Store
        Returns:
        user name
      • setUsername

        public void setUsername​(java.lang.String n)
        Set the user name (SASL id) to be used when connecting to the Message Store
        Parameters:
        n - the user name to use
      • getPassword

        public java.lang.String getPassword()
        Get the password to be used when connecting to the Message Store
        Returns:
        the password
      • setPassword

        public void setPassword​(java.lang.String n)
        Set the password to use when connecting to the Message Store
        Parameters:
        n - the password to use
      • getFriendlyName

        public java.lang.String getFriendlyName()
        Get the friendly name for this Message Store
        Returns:
        the friendly name
      • setFriendlyName

        public void setFriendlyName​(java.lang.String f)
        Set the friendly name for this Message Store
        Parameters:
        f - the friendly name to use
      • 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
      • disconnect

        public void disconnect()
                        throws SomException
        Disconnect from the Message Store (if we are connected)
        Throws:
        SomException - on error
      • monitor

        public void monitor​(SomCommandListener listener,
                            java.lang.Boolean enable)
                     throws SomException
        Switch on or off Store monitoring.
        Parameters:
        listener - Listener object which will be updated with new data
        enable - Control whether we are turning monitoring on or off
        Throws:
        SomException - on error
      • shutdown

        public void shutdown​(SomCommandListener listener)
                      throws SomException
        Tell the Message Store to shut down
        Parameters:
        listener - which will be informed when the operation is complete
        Throws:
        SomException - on error
      • abort

        public void abort​(SomCommandListener listener)
                   throws SomException
        Tell the Message Store to abort
        Parameters:
        listener - which will be informed when the operation is complete
        Throws:
        SomException - on error
      • restart

        public void restart​(SomCommandListener listener)
                     throws SomException
        Tell the Message Store to restart
        Parameters:
        listener - which will be informed when the operation is complete
        Throws:
        SomException - on error
      • logout

        public void logout​(SomCommandListener listener,
                           java.lang.String mailbox)
                    throws SomException
        Tell the Message Store to log out a user
        Parameters:
        listener - which will be informed when the operation is complete
        mailbox - The mailbox to log out, or the string "ALL"
        Throws:
        SomException - on error
      • block

        public void block​(SomCommandListener listener,
                          java.lang.String op)
                   throws SomException
        Tell the Message Store to block an operation
        Parameters:
        listener - which will be informed when the operation is complete
        op - the operation to block
        Throws:
        SomException - on error
      • unblock

        public void unblock​(SomCommandListener listener,
                            java.lang.String op)
                     throws SomException
        Tell the Message Store to unlock an operation
        Parameters:
        listener - which will be informed when the operation is complete
        op - the operation to unblock
        Throws:
        SomException - on error
      • maxconns

        public void maxconns​(SomCommandListener listener,
                             java.lang.Integer n)
                      throws SomException
        Set the maximum number of connections which the Message Store will accept
        Parameters:
        listener - which will be informed when the operation is complete
        n - the maximum number of connections to accept
        Throws:
        SomException - on error
      • maxvol

        public void maxvol​(SomCommandListener listener,
                           java.lang.Integer v)
                    throws SomException
        Set the maximum volume of messages which the Message Store will accept
        Parameters:
        listener - which will be informed when the operation is complete
        v - the maximum volume
        Throws:
        SomException - on error
      • rebuild

        public void rebuild​(SomCommandListener listener)
                     throws SomException
        Tell the Message Store rebuild its mailbox list
        Parameters:
        listener - which will be informed when the operation is complete
        Throws:
        SomException - on error
      • resynchronize

        public void resynchronize​(SomCommandListener listener)
                           throws SomException
        Tell the Message Store to resynchronize its indexes
        Parameters:
        listener - which will be informed when the operation is complete
        Throws:
        SomException - on error
      • rebuildStats

        public void rebuildStats​(SomCommandListener listener)
                          throws SomException
        Tell the Message Store to rebuild its internal statistics
        Parameters:
        listener - which will be informed when the operation is complete
        Throws:
        SomException - on error
      • reload

        public void reload​(SomCommandListener listener)
                    throws SomException
        Tell the Message Store to reload its configuration
        Parameters:
        listener - which will be informed when the operation is complete
        Throws:
        SomException - on error
      • somVersion

        public java.lang.Integer somVersion()
                                     throws SomException
        Get SOM version of Message Store
        Returns:
        som version
        Throws:
        SomException - on error
      • version

        public java.lang.String version()
                                 throws SomException
        Get version string for Message Store
        Returns:
        store version string
        Throws:
        SomException - on error
      • uptime

        public java.lang.String uptime()
                                throws SomException
        Get uptime as string for Message Store
        Returns:
        uptime string
        Throws:
        SomException - on error
      • numMailboxes

        public java.lang.Integer numMailboxes()
                                       throws SomException
        Get number of mailboxes in Message Store
        Returns:
        number of mailboxes
        Throws:
        SomException - on error
      • numMessages

        public java.lang.Integer numMessages()
                                      throws SomException
        Get number of messages in Message Store
        Returns:
        number of messages
        Throws:
        SomException - on error
      • numReports

        public java.lang.Integer numReports()
                                     throws SomException
        Get number of reports in Message Store
        Returns:
        number of reports
        Throws:
        SomException - on error
      • numSubmitted

        public java.lang.Integer numSubmitted()
                                       throws SomException
        Get number of submitted messages in Message Store
        Returns:
        number of submitted messages
        Throws:
        SomException - on error
      • unreadLow

        public java.lang.Integer unreadLow()
                                    throws SomException
        Get number of unread low priority messages in Message Store
        Returns:
        number of unread low priority messages
        Throws:
        SomException - on error
      • unreadMedium

        public java.lang.Integer unreadMedium()
                                       throws SomException
        Get number of unread medium priority messages in Message Store
        Returns:
        number of unread medium priority messages
        Throws:
        SomException - on error
      • unreadHigh

        public java.lang.Integer unreadHigh()
                                     throws SomException
        Get number of unread high priority messages in Message Store
        Returns:
        number of unread high priority messages
        Throws:
        SomException - on error
      • volMessages

        public java.lang.Integer volMessages()
                                      throws SomException
        Get volume of messages in Message Store
        Returns:
        volume of messages
        Throws:
        SomException - on error
      • volSubmittedMessages

        public java.lang.Integer volSubmittedMessages()
                                               throws SomException
        Get volume of submitted messages in Message Store
        Returns:
        volume of submitted messages
        Throws:
        SomException - on error
      • maxNumMessages

        public java.lang.Integer maxNumMessages()
                                         throws SomException
        Get configured maximum number of messages in Message Store
        Returns:
        maximum number of messages allowed
        Throws:
        SomException - on error
      • maxVolMessages

        public java.lang.Integer maxVolMessages()
                                         throws SomException
        Get configured maximum volume of messages in Message Store
        Returns:
        maximum volume of messages allowed
        Throws:
        SomException - on error
      • numP7Associations

        public java.lang.Integer numP7Associations()
                                            throws SomException
        Get current number of P7 associations to the Message Store
        Returns:
        number of P7 associations
        Throws:
        SomException - on error
      • numP3Associations

        public java.lang.Integer numP3Associations()
                                            throws SomException
        Get current number of P3 associations to/from the Message Store
        Returns:
        number of P3 associations
        Throws:
        SomException - on error
      • numMgmtAssociations

        public java.lang.Integer numMgmtAssociations()
                                              throws SomException
        Get current number of management associations to the Message Store
        Returns:
        number of management associations
        Throws:
        SomException - on error
      • maxP7Associations

        public java.lang.Integer maxP7Associations()
                                            throws SomException
        Get configured maximum number of P7 associations allowed in Message Store
        Returns:
        number of P7 associations allowed
        Throws:
        SomException - on error
      • maxP3Associations

        public java.lang.Integer maxP3Associations()
                                            throws SomException
        Get configured maximum number of P3 associations allowed in Message Store
        Returns:
        number of P3 associations allowed
        Throws:
        SomException - on error
      • queuedDapSearchOps

        public java.lang.Integer queuedDapSearchOps()
                                             throws SomException
        Get number of DAP search operations queued in the Message Store
        Returns:
        number of queued DAP search operations
        Throws:
        SomException - on error
      • blockedOperations

        public java.lang.String blockedOperations()
                                           throws SomException
        Get list of blocked operations in the Message Store
        Returns:
        string indicating blocked operations
        Throws:
        SomException - on error
      • curBindOps

        public java.lang.Integer curBindOps()
                                     throws SomException
        Get number of current outstanding Bind operations in the Message Store
        Returns:
        number of bind operations
        Throws:
        SomException - on error
      • curCancelDeferredDeliveryOps

        public java.lang.Integer curCancelDeferredDeliveryOps()
                                                       throws SomException
        Get number of current outstanding cancel deferred delivery operations in the Message Store
        Returns:
        number of outstanding cancel deferred delivery operations
        Throws:
        SomException - on error
      • curChangeCredentialsOps

        public java.lang.Integer curChangeCredentialsOps()
                                                  throws SomException
        Get number of current change credentials operations in the Message Store
        Returns:
        number of outstanding change credentials operations
        Throws:
        SomException - on error
      • curDeleteOps

        public java.lang.Integer curDeleteOps()
                                       throws SomException
        Get number of current outstanding delete operations in the Message Store
        Returns:
        number of outstanding delete operations
        Throws:
        SomException - on error
      • curDeliverMessageOps

        public java.lang.Integer curDeliverMessageOps()
                                               throws SomException
        Get number of current outstanding message delivery operations in the Message Store
        Returns:
        number of outstanding message delivery operations
        Throws:
        SomException - on error
      • curDeliverReportOps

        public java.lang.Integer curDeliverReportOps()
                                              throws SomException
        Get number of current outstanding report delivery operations in the Message Store
        Returns:
        number of outstanding report delivery operations
        Throws:
        SomException - on error
      • curDeliveryControlOps

        public java.lang.Integer curDeliveryControlOps()
                                                throws SomException
        Get number of current outstanding delivery control operations in the Message Store
        Returns:
        number of outstanding delivery control operations
        Throws:
        SomException - on error
      • curFetchOps

        public java.lang.Integer curFetchOps()
                                      throws SomException
        Get number of current outstanding fetch operations in the Message Store
        Returns:
        number of outstanding fetch operations
        Throws:
        SomException - on error
      • curListOps

        public java.lang.Integer curListOps()
                                     throws SomException
        Get number of current outstanding list operations in the Message Store
        Returns:
        number of outstanding list operations
        Throws:
        SomException - on error
      • curRegisterMsOps

        public java.lang.Integer curRegisterMsOps()
                                           throws SomException
        Get number of current outstanding registerMS operations in the Message Store
        Returns:
        number of outstanding registerMS operations
        Throws:
        SomException - on error
      • curRegisterOps

        public java.lang.Integer curRegisterOps()
                                         throws SomException
        Get number of current outstanding register operations in the Message Store
        Returns:
        number of outstanding register operations
        Throws:
        SomException - on error
      • curSubmitMessageOps

        public java.lang.Integer curSubmitMessageOps()
                                              throws SomException
        Get number of current outstanding message submission operations in the Message Store
        Returns:
        number of outstanding message submission operations
        Throws:
        SomException - on error
      • curSubmitProbeOps

        public java.lang.Integer curSubmitProbeOps()
                                            throws SomException
        Get number of current outstanding probe submission operations in the Message Store
        Returns:
        number of outstanding probe submission operations
        Throws:
        SomException - on error
      • curSummarizeOps

        public java.lang.Integer curSummarizeOps()
                                          throws SomException
        Get number of current outstanding summarize operations in the Message Store
        Returns:
        number of outstanding summarize operations
        Throws:
        SomException - on error
      • curUnbindOps

        public java.lang.Integer curUnbindOps()
                                       throws SomException
        Get number of current outstanding unbind operations in the Message Store
        Returns:
        number of outstanding unbind operations
        Throws:
        SomException - on error
      • getCurrentTimeOffset

        public java.lang.Integer getCurrentTimeOffset()
        Get current Message Store time offset
        Returns:
        time offset in seconds
      • getCurrentTime

        public java.util.Date getCurrentTime()
        Get current time
        Returns:
        current time
      • 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