Class AdminProtocolHandler

  • All Implemented Interfaces:
    Protocol

    public class AdminProtocolHandler
    extends AsciiProtocolHandler
    An abstract base class for Broker sessions which represent a Broker client.
    • Field Detail

      • RECOVER_GLOBAL

        public static final int RECOVER_GLOBAL
        Recover all transactions.
        See Also:
        Constant Field Values
      • RECOVER_RESTRICTED

        public static final int RECOVER_RESTRICTED
        Recover only client owned transactions.
        See Also:
        Constant Field Values
      • TRANSACTION_COMMIT

        public static final int TRANSACTION_COMMIT
        Commit transaction.
        See Also:
        Constant Field Values
      • TRANSACTION_ROLLBACK

        public static final int TRANSACTION_ROLLBACK
        Abort transaction.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AdminProtocolHandler

        public AdminProtocolHandler​(SSLInfo sslinfo)
                             throws javax.jms.JMSException
        Create a new link to the Broker.
        Throws:
        javax.jms.JMSException
    • Method Detail

      • getVersion

        public java.lang.String getVersion()
                                    throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • getBrokers

        public java.lang.String[] getBrokers()
                                      throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • createBroker

        public void createBroker​(java.lang.String name,
                                 java.lang.String description,
                                 boolean makeDefault)
                          throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • destroyBroker

        public void destroyBroker​(int sessionID)
                           throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • setDefaultBroker

        public void setDefaultBroker​(java.lang.String name)
                              throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • getDefaultBroker

        public java.lang.String getDefaultBroker()
                                          throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • getTerritoryBrokers

        public java.lang.String[] getTerritoryBrokers​(int sessionID)
                                               throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • getTerritoryBrokerFullNames

        public java.lang.String[] getTerritoryBrokerFullNames​(int sessionID)
                                                       throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • leaveTerritory

        public void leaveTerritory​(int sessionID)
                            throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • createTerritory

        public void createTerritory​(int sessionID,
                                    java.lang.String name)
                             throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • joinTerritory

        public void joinTerritory​(int sessionID,
                                  java.lang.String host,
                                  java.lang.String name)
                           throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • setInfo

        public void setInfo​(int sessionID,
                            java.lang.String clientID,
                            java.lang.String clientType)
                     throws javax.jms.JMSException
        Set client infoset.
        Throws:
        javax.jms.JMSException
      • setEventTypeInfo

        public void setEventTypeInfo​(int sessionID,
                                     java.lang.String eventType,
                                     java.lang.String messageType)
                              throws javax.jms.JMSException
        Set document type infoset.
        Throws:
        javax.jms.JMSException
      • createQueue

        public void createQueue​(int sessionID,
                                java.lang.String brokerClientID,
                                java.lang.String clientGroup,
                                java.lang.String application,
                                boolean sharedState,
                                int sharedStateOrdering,
                                java.lang.String userDN,
                                java.lang.String issuerDN)
                         throws javax.jms.JMSException
        Create a queue on the JMS Broker.
        Parameters:
        brokerClientID - the client's ID
        clientGroup - the client's client group
        application - the client's application
        sharedState - for shared state
        sharedStateOrdering - WmDestination.SHARED_STATE_ORDERING_NONE or WmDestination.SHARED_STATE_ORDERING_PUBLISHER
        userDN - the user distinguished name
        issuerDN - the issuer distinguished name
        Throws:
        javax.jms.JMSException - if the client could not be created
      • getClientGroups

        public java.lang.String[] getClientGroups​(int sessionID,
                                                  java.lang.String canSub,
                                                  java.lang.String canPub)
                                           throws javax.jms.JMSException
        Get the list of client groups in the JMS Broker's territory.
        Returns:
        the list of client group names
        Throws:
        javax.jms.JMSException - if the client group could not be created
      • createClientGroup

        public void createClientGroup​(int sessionID,
                                      java.lang.String name,
                                      int storage)
                               throws javax.jms.JMSException
        Create a client group in the JMS Broker's territory.
        Parameters:
        name - the client group name to create
        Throws:
        javax.jms.JMSException - if the client group could not be created
      • deleteClientGroup

        public void deleteClientGroup​(int sessionID,
                                      java.lang.String name)
                               throws javax.jms.JMSException
        Delete a client group in the JMS Broker's territory.
        Parameters:
        name - the client group name to delete
        Throws:
        javax.jms.JMSException - if the client group could not be deleted
      • getClientGroupCanPubList

        public java.lang.String[] getClientGroupCanPubList​(int sessionID,
                                                           java.lang.String name)
                                                    throws javax.jms.JMSException
        Get the can-pub list for a client group.
        Parameters:
        name - the client group name
        Returns:
        the can-pub list of topics
        Throws:
        javax.jms.JMSException - if the can-pub list can not be retrieved
      • setClientGroupCanPubList

        public void setClientGroupCanPubList​(int sessionID,
                                             java.lang.String name,
                                             java.lang.String[] topics)
                                      throws javax.jms.JMSException
        Set the can-pub list for a client group.
        Parameters:
        name - the client group name
        topics - the can-pub list of topics
        Throws:
        javax.jms.JMSException - if the can-pub list can not be set
      • getClientGroupCanSubList

        public java.lang.String[] getClientGroupCanSubList​(int sessionID,
                                                           java.lang.String name)
                                                    throws javax.jms.JMSException
        Get the can-sub list for a client group.
        Parameters:
        name - the client group name
        Returns:
        the can-sub list of topics
        Throws:
        javax.jms.JMSException - if the can-sub list can not be retrieved
      • setClientGroupCanSubList

        public void setClientGroupCanSubList​(int sessionID,
                                             java.lang.String name,
                                             java.lang.String[] topics)
                                      throws javax.jms.JMSException
        Set the can-sub list for a client group.
        Parameters:
        name - the client group name
        topics - the can-sub list of topics
        Throws:
        javax.jms.JMSException - if the can-sub list can not be set
      • getClientIDs

        public java.lang.String[] getClientIDs​(int sessionID,
                                               java.lang.String clientGroup,
                                               java.lang.String eventType)
                                        throws javax.jms.JMSException
        Get the list of clients.
        Returns:
        the list of clients
        Throws:
        javax.jms.JMSException - if the client list can not be retrieved
      • createClient

        public void createClient​(int sessionID,
                                 java.lang.String clientName,
                                 java.lang.String clientGroup,
                                 java.lang.String application,
                                 java.lang.String userDN,
                                 java.lang.String issuerDN,
                                 boolean sharedState,
                                 int sharedStateOrdering,
                                 boolean ackVolatile,
                                 boolean redeliveryCount,
                                 int lifecycle,
                                 int storage,
                                 boolean priority)
                          throws javax.jms.JMSException
        Create a client.
        Throws:
        javax.jms.JMSException
      • destroyClient

        public void destroyClient​(int sessionID,
                                  java.lang.String name)
                           throws javax.jms.JMSException
        Destroy a client.
        Parameters:
        name - the name of the client to destroy
        Throws:
        javax.jms.JMSException - if the client can not be destroyed
      • subscribeClient

        public void subscribeClient​(int sessionID,
                                    java.lang.String clientName,
                                    java.lang.String eventType,
                                    java.lang.String filter)
                             throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • clearClientQueue

        public void clearClientQueue​(int sessionID,
                                     java.lang.String name)
                              throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • closeClient

        public void closeClient​(int sessionID,
                                java.lang.String name)
                         throws javax.jms.JMSException
        Destroy a client.
        Parameters:
        name - the name of the client queue to clear
        Throws:
        javax.jms.JMSException - if the client queue cannot be cleared
      • createEventDefinition

        public void createEventDefinition​(int sessionID,
                                          java.lang.String name,
                                          java.lang.String description,
                                          int storage,
                                          int ttl,
                                          int validation)
                                   throws javax.jms.JMSException
        Create an event definition in the JMS Broker's territory.
        Parameters:
        name - the event definition name to create
        Throws:
        javax.jms.JMSException - if the event definition could not be created
      • deleteEventDefinition

        public void deleteEventDefinition​(int sessionID,
                                          java.lang.String name)
                                   throws javax.jms.JMSException
        Delete an event definition in the JMS Broker's territory.
        Parameters:
        name - the event definition name to delete
        Throws:
        javax.jms.JMSException - if the event definition could not be deleted
      • getEventTypes

        public java.lang.String[] getEventTypes​(int sessionID,
                                                java.lang.String scope)
                                         throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • getEventTypeInfoset

        public WmMessageImpl getEventTypeInfoset​(int sessionID,
                                                 java.lang.String topic,
                                                 java.lang.String infosetName)
                                          throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • eventDefinitionExists

        public boolean eventDefinitionExists​(int sessionID,
                                             java.lang.String name)
                                      throws javax.jms.JMSException
        Does an event definition exist in the JMS Broker's territory.
        Parameters:
        name - the event definition name to check
        Throws:
        javax.jms.JMSException - if an error occurs in the broker
      • queueExists

        public boolean queueExists​(int sessionID,
                                   java.lang.String name)
                            throws javax.jms.JMSException
        Does a queue exist on the JMS Broker.
        Parameters:
        name - the queue name to check
        Throws:
        javax.jms.JMSException - if an error occurs in the broker
      • clientExists

        public boolean clientExists​(int sessionID,
                                    java.lang.String name)
                             throws javax.jms.JMSException
        Does a client exist on the JMS Broker.
        Parameters:
        name - the client name to check
        Throws:
        javax.jms.JMSException - if an error occurs in the broker
      • getClientInfoset

        public WmMessageImpl getClientInfoset​(int sessionID,
                                              java.lang.String clientName)
                                       throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • getClientSubscriptions

        public java.lang.String[] getClientSubscriptions​(int sessionID,
                                                         java.lang.String name)
                                                  throws javax.jms.JMSException
        Get the list of event types subscribed to by this client.
        Parameters:
        name - the client name to check
        Throws:
        javax.jms.JMSException - if an error occurs in the broker
      • setRecoverMode

        public void setRecoverMode​(int sessionID,
                                   int mode)
                            throws javax.jms.JMSException
        Sets the global recover mode of the JMS Broker to either restricted (the default) or global. Restricted mode only allows a client to recover transactions to which it participated. Global mode allows a client to recover all recoverable transactions.
        Parameters:
        mode - The recover mode to set, either RECOVER_GLOBAL or RECOVER_RESTRICTED.
        Throws:
        javax.jms.JMSException - if the recover mode could not be set
      • getRecoverMode

        public int getRecoverMode​(int sessionID)
                           throws javax.jms.JMSException
        Gets the global recover mode of the JMS Broker.
        Throws:
        javax.jms.JMSException
      • setPrepareTimeoutAction

        public void setPrepareTimeoutAction​(int sessionID,
                                            int action)
                                     throws javax.jms.JMSException
        Set the prepare timeout action. This is the action the Broker transaction manager will take when a prepared transaction times out.
        Parameters:
        action - Either BrokerAdminClient.TRANSACTION_ROLLBACK or BrokerAdminClient.TRANSACTION_COMMIT.
        Throws:
        javax.jms.JMSException
      • getPrepareTimeoutAction

        public int getPrepareTimeoutAction​(int sessionID)
                                    throws javax.jms.JMSException
        Get the prepare timeout action. This is the action the Broker transaction manager will take when a prepared transaction times out.
        Returns:
        The prepare timeout action.
        Throws:
        javax.jms.JMSException
      • setPrepareTimeout

        public void setPrepareTimeout​(int sessionID,
                                      int seconds)
                               throws javax.jms.JMSException
        Set the default prepare timeout. This is the default timeout period between when a transaction is prepared and before it is committed.
        Parameters:
        seconds - The prepare timeout to set.
        Throws:
        javax.jms.JMSException
      • getPrepareTimeout

        public int getPrepareTimeout​(int sessionID)
                              throws javax.jms.JMSException
        Get the default prepare timeout. This is the default timeout period between when a transaction is prepared and before it is committed.
        Returns:
        The default prepare timeout in seconds.
        Throws:
        javax.jms.JMSException
      • setTransactionTimeout

        public void setTransactionTimeout​(int sessionID,
                                          int seconds)
                                   throws javax.jms.JMSException
        Set the default transaction timeout.
        Parameters:
        seconds - The default transaction timeout to set.
        Throws:
        javax.jms.JMSException
      • getTransactionTimeout

        public int getTransactionTimeout​(int sessionID)
                                  throws javax.jms.JMSException
        Get the default transaction timeout.
        Returns:
        The default transaction timeout in seconds.
        Throws:
        javax.jms.JMSException
      • initializeConnection

        public int initializeConnection()
                                 throws javax.jms.JMSException
        Initialize the server session.
        Throws:
        javax.jms.JMSException - if the session cannot be initialized