Class SomPumiceMessageStore

java.lang.Object
com.isode.som.pumice.objects.SomPumiceObject
com.isode.som.pumice.objects.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 Details

    • som_version

      public Integer som_version
    • SOM_PUMICE_DISCONNECTED

      public static final int SOM_PUMICE_DISCONNECTED
      See Also:
    • SOM_PUMICE_CONNECTING

      public static final int SOM_PUMICE_CONNECTING
      See Also:
    • SOM_PUMICE_CONNECTED_ANON

      public static final int SOM_PUMICE_CONNECTED_ANON
      See Also:
    • SOM_PUMICE_CONNECTED_AUTH

      public static final int SOM_PUMICE_CONNECTED_AUTH
      See Also:
  • Constructor Details

    • SomPumiceMessageStore

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

    • 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(Integer mailboxSizeLimit, Integer messageSizeLimit, 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, 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: 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
    • handleResponse

      public void handleResponse(SomCommand command, int status, String[] pairs)
      Specified by:
      handleResponse in interface SomPumiceHandler
    • handleResponse

      public void handleResponse(SomCommand command, int status, SomPumiceMailbox object)
      Specified by:
      handleResponse in interface SomPumiceHandler
    • handleResponse

      public void handleResponse(SomCommand command, int status, SomPumiceConnection object)
      Specified by:
      handleResponse in interface SomPumiceHandler
    • handleResponse

      public void handleResponse(SomCommand command, int status, SomPumiceMessage object)
      Specified by:
      handleResponse in interface SomPumiceHandler
    • getInfoString

      public 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 String getHostName()
      Get the host name used to connect to the Message Store
      Returns:
      the host name
    • setHostName

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

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

      public void setUsername(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 String getPassword()
      Get the password to be used when connecting to the Message Store
      Returns:
      the password
    • setPassword

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

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

      public void setFriendlyName(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
    • connect

      public void connect() throws SomException
      Connect to the Message Store
      Throws:
      SomException - on error
    • 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, 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, 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, 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
    • importBackup

      public void importBackup(SomCommandListener listener, String source) throws SomException
      Throws:
      SomException
    • unblock

      public void unblock(SomCommandListener listener, 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, 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, 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
    • maxmsgs

      public void maxmsgs(SomCommandListener listener, Integer n) throws SomException
      Throws:
      SomException
    • 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 Integer somVersion() throws SomException
      Get SOM version of Message Store
      Returns:
      som version
      Throws:
      SomException - on error
    • version

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

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

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

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

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

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

      public 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 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 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 Integer volMessages() throws SomException
      Get volume of messages in Message Store
      Returns:
      volume of messages
      Throws:
      SomException - on error
    • volSubmittedMessages

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

      public 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 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 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 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 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 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 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 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 String blockedOperations() throws SomException
      Get list of blocked operations in the Message Store
      Returns:
      string indicating blocked operations
      Throws:
      SomException - on error
    • curBindOps

      public 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 Integer getCurrentTimeOffset()
      Get current Message Store time offset
      Returns:
      time offset in seconds
    • getCurrentTime

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