Package com.webmethods.jms.protocol
Class AdminProtocolHandler
- java.lang.Object
-
- com.webmethods.jms.protocol.ProtocolHandler
-
- com.webmethods.jms.protocol.AsciiProtocolHandler
-
- com.webmethods.jms.protocol.AdminProtocolHandler
-
- All Implemented Interfaces:
Protocol
public class AdminProtocolHandler extends AsciiProtocolHandler
An abstract base class for Broker sessions which represent a Broker client.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.webmethods.jms.protocol.AsciiProtocolHandler
AsciiProtocolHandler.AsciiReply, AsciiProtocolHandler.AsciiRequest
-
-
Field Summary
Fields Modifier and Type Field Description static int
RECOVER_GLOBAL
Recover all transactions.static int
RECOVER_RESTRICTED
Recover only client owned transactions.static int
TRANSACTION_COMMIT
Commit transaction.static int
TRANSACTION_ROLLBACK
Abort transaction.-
Fields inherited from class com.webmethods.jms.protocol.AsciiProtocolHandler
_currentVersion, EVENT_TYPE_PLACEHOLDER, SUPPORTED_VERSIONS, VERSION_1015, VERSION_105, VERSION_60, VERSION_61, VERSION_62, VERSION_63, VERSION_64, VERSION_65, VERSION_66, VERSION_71, VERSION_80, VERSION_82, VERSION_90
-
Fields inherited from class com.webmethods.jms.protocol.ProtocolHandler
_buffer, _bufferEol, _bufferPos, _clientGroup, _clientID, _clientLicenseID, _confirmDelivery, _connection, _isLoggable, _lastResponseFromBroker, _link, _marshalIn, _marshalInUserData, _marshalOut, _marshalOutUserData, _messageFactory, _url, ADMIN_APPLICATION, CLIENT_TYPE_ADMIN, CLIENT_TYPE_CONNECTION, CLIENT_TYPE_DURABLE_SUBSCRIBER, CLIENT_TYPE_PROPERTY, CLIENT_TYPE_QUEUE, CLIENT_TYPE_SUBSCRIBER, CONNECTION_APPLICATION, DURABLE_SUBSCRIBER_APPLICATION, MESSAGE_TYPE_PROPERTY, MESSAGE_TYPE_QUEUE, MESSAGE_TYPE_TEMPORARY_QUEUE, MESSAGE_TYPE_TEMPORARY_TOPIC, MESSAGE_TYPE_TOPIC, MIN_BUFFER_SIZE, QUEUE_APPLICATION, SUBSCRIBER_APPLICATION
-
-
Constructor Summary
Constructors Constructor Description AdminProtocolHandler(SSLInfo sslinfo)
Create a new link to the Broker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearClientQueue(int sessionID, java.lang.String name)
boolean
clientExists(int sessionID, java.lang.String name)
Does a client exist on the JMS Broker.void
closeClient(int sessionID, java.lang.String name)
Destroy a client.void
createBroker(java.lang.String name, java.lang.String description, boolean makeDefault)
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)
Create a client.void
createClientGroup(int sessionID, java.lang.String name, int storage)
Create a client group in the JMS Broker's territory.void
createEventDefinition(int sessionID, java.lang.String name, java.lang.String description, int storage, int ttl, int validation)
Create an event definition in the JMS Broker's territory.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)
Create a queue on the JMS Broker.void
createTerritory(int sessionID, java.lang.String name)
void
deleteClientGroup(int sessionID, java.lang.String name)
Delete a client group in the JMS Broker's territory.void
deleteEventDefinition(int sessionID, java.lang.String name)
Delete an event definition in the JMS Broker's territory.void
destroyBroker(int sessionID)
void
destroyClient(int sessionID, java.lang.String name)
Destroy a client.boolean
eventDefinitionExists(int sessionID, java.lang.String name)
Does an event definition exist in the JMS Broker's territory.java.lang.String[]
getBrokers()
java.lang.String[]
getClientGroupCanPubList(int sessionID, java.lang.String name)
Get the can-pub list for a client group.java.lang.String[]
getClientGroupCanSubList(int sessionID, java.lang.String name)
Get the can-sub list for a client group.java.lang.String[]
getClientGroups(int sessionID, java.lang.String canSub, java.lang.String canPub)
Get the list of client groups in the JMS Broker's territory.java.lang.String[]
getClientIDs(int sessionID, java.lang.String clientGroup, java.lang.String eventType)
Get the list of clients.WmMessageImpl
getClientInfoset(int sessionID, java.lang.String clientName)
java.lang.String[]
getClientSubscriptions(int sessionID, java.lang.String name)
Get the list of event types subscribed to by this client.java.lang.String
getDefaultBroker()
WmMessageImpl
getEventTypeInfoset(int sessionID, java.lang.String topic, java.lang.String infosetName)
java.lang.String[]
getEventTypes(int sessionID, java.lang.String scope)
int
getPrepareTimeout(int sessionID)
Get the default prepare timeout.int
getPrepareTimeoutAction(int sessionID)
Get the prepare timeout action.int
getRecoverMode(int sessionID)
Gets the global recover mode of the JMS Broker.java.lang.String
getTerritory(int sessionID)
Get the territoryjava.lang.String[]
getTerritoryBrokerFullNames(int sessionID)
java.lang.String[]
getTerritoryBrokers(int sessionID)
int
getTransactionTimeout(int sessionID)
Get the default transaction timeout.java.lang.String
getVersion()
int
initializeConnection()
Initialize the server session.void
joinTerritory(int sessionID, java.lang.String host, java.lang.String name)
void
leaveTerritory(int sessionID)
boolean
queueExists(int sessionID, java.lang.String name)
Does a queue exist on the JMS Broker.void
setClientGroupCanPubList(int sessionID, java.lang.String name, java.lang.String[] topics)
Set the can-pub list for a client group.void
setClientGroupCanSubList(int sessionID, java.lang.String name, java.lang.String[] topics)
Set the can-sub list for a client group.void
setDefaultBroker(java.lang.String name)
void
setEventTypeInfo(int sessionID, java.lang.String eventType, java.lang.String messageType)
Set document type infoset.void
setInfo(int sessionID, java.lang.String clientID, java.lang.String clientType)
Set client infoset.void
setPrepareTimeout(int sessionID, int seconds)
Set the default prepare timeout.void
setPrepareTimeoutAction(int sessionID, int action)
Set the prepare timeout action.void
setRecoverMode(int sessionID, int mode)
Sets the global recover mode of the JMS Broker to either restricted (the default) or global.void
setTransactionTimeout(int sessionID, int seconds)
Set the default transaction timeout.void
subscribeClient(int sessionID, java.lang.String clientName, java.lang.String eventType, java.lang.String filter)
-
Methods inherited from class com.webmethods.jms.protocol.AsciiProtocolHandler
acknowledge, acknowledge, acknowledgeThrough, beginBrowse, browse, cancelReceive, canPublish, canSubscribe, clearQueue, commit, commit, destroy, disconnect, dispatch, endBrowse, endTransaction, forget, getAccessLabel, getBrokerName, getPublishProcessState, getQueueLength, getReconnectReply, getUniqueID, initializeConnection, initializeConnection, initializeSession, negativeAcknowledge, negativeAcknowledge, parseNameList, prepare, prepare, publish, publish, publish, publish, receive, recover, rollback, rollback, sendKeepAlive, sendKeepAliveResponse, setBrowseFilter, setFilter, setInfo, setTransactionID, setTransactionTimeout, startTransaction, startTransaction, startTransaction, subscribe, subscriptions, unsubscribe
-
Methods inherited from class com.webmethods.jms.protocol.ProtocolHandler
acquireSendRequestEventsLock, connect, createMessage, disconnect, dispatchReply, getBrokerURL, getClientID, getEncryptionLevel, getPosixFromLocale, getServerCertificate, handleError, isDisconnected, isTransactionCompleted, markForClosure, marshal, nextRequestID, processClientLicense, read, reconnect, releaseSendRequestEventsLock, sendWithCb, sendWithNoReply, sendWithNoReply, sendWithNoReply, sendWithReply, sendWithReply, sendWithReply, setBrokerInactive, setBrokerURL, setTransactionCompleted
-
-
-
-
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
-
getTerritory
public java.lang.String getTerritory(int sessionID) throws javax.jms.JMSException
Description copied from class:AsciiProtocolHandler
Get the territory- Specified by:
getTerritory
in interfaceProtocol
- Overrides:
getTerritory
in classAsciiProtocolHandler
- Returns:
- The name of the territory
- 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 IDclientGroup
- the client's client groupapplication
- the client's applicationsharedState
-for shared state sharedStateOrdering
-WmDestination.SHARED_STATE_ORDERING_NONE
orWmDestination.SHARED_STATE_ORDERING_PUBLISHER
userDN
- the user distinguished nameissuerDN
- 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 nametopics
- 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 nametopics
- 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
-
-