Package com.webmethods.jms.protocol
Interface Protocol
-
- All Known Implementing Classes:
AdminProtocolHandler
,AsciiProtocolHandler
,BinaryProtocolHandler
,ProtocolHandler
public interface Protocol
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
acknowledge(int sessionID, long transactionID, long sequenceNumber)
Acknowledge the given message sequence number.void
acknowledge(int sessionID, long transactionID, long[] sequenceNumbers)
Acknowledge the given list of message sequence numbers.void
acknowledgeThrough(int sessionID, long transactionID, long sequenceNumber, boolean confirm)
Acknowledge received messages through this sequence number.int
beginBrowse(int sessionID, java.lang.String clientID)
Begin browse operations.WmMessageImpl
browse(int sessionID, java.lang.String clientID, int browseID)
Browse the next message.void
cancelReceive(int sessionID, int pendingRequestID)
Cancel a request to receive messages from the Broker.void
canPublish(int sessionID, java.lang.String name)
Checks if there are adequate permissions to publish.void
canSubscribe(int sessionID, java.lang.String name)
Checks if there are adequate permissions to subscribe.void
clearQueue(int sessionID)
Clear the queue.void
commit(int sessionID, long transactionID)
Commit a transaction.void
commit(int sessionID, java.lang.String xaTransactionID)
Commit a transaction.void
destroy(int sessionID)
Destroy the underlying Broker client.void
disconnect(int sessionID)
Disconnect the underlying Broker client.void
endBrowse(int sessionID, java.lang.String clientID, int browseID)
End browse operations.void
endTransaction(int sessionID, long transactionID, boolean success)
End a transaction.void
forget(int sessionID, java.lang.String xaTransactionID)
Forget a transaction.short[]
getAccessLabel(int sessionID)
java.lang.String
getBrokerName(int sessionID)
Get the name of the broker.int
getPublishProcessState(int sessionID)
long
getQueueLength(int sessionID)
Get the queue length.java.lang.String
getTerritory(int sessionID)
Get the name of the territory.java.lang.String
getUniqueID(int sessionID)
Get a unique identifier from the Broker.int
initializeConnection(java.lang.String clientName, java.lang.String clientGroup, java.lang.String application, boolean sharedState, boolean reconnect)
Initialize a connection to the Broker.int
initializeConnection(java.lang.String clientName, java.lang.String clientGroup, java.lang.String application, boolean sharedState, boolean reconnect, java.lang.String userName, java.lang.String password)
Initialize a connection to the Broker.int
initializeSession(java.lang.String clientName, boolean queue, boolean priorityOrdering, java.lang.String clientGroup, java.lang.String application, boolean guaranteed, boolean ackNonPersistent, boolean sharedState, int sharedStateOrdering, boolean reconnect, boolean acceptExisting)
Initialize a session to the Broker.void
negativeAcknowledge(int sessionID, long transactionID, long sequenceNumber)
Negative acknowledge the message sequence number.void
negativeAcknowledge(int sessionID, long transactionID, long[] sequenceNumbers)
Negative acknowledge the given list of message sequence numbers.void
prepare(int sessionID, long xaTransactionID)
Prepare a transaction.void
prepare(int sessionID, java.lang.String xaTransactionID)
Prepare a transaction.void
publish(int sessionID, long transactionID, WmMessageImpl[] messages, int deliveryMode, boolean deliver)
Publish multiple messages.void
publish(int sessionID, long transactionID, WmMessageImpl[] messages, int deliveryMode, boolean deliver, boolean confirmDelivery)
Publish multiple messages.void
publish(int sessionID, long transactionID, WmMessageImpl message, int deliveryMode, boolean deliver)
Publish a message.void
publish(int sessionID, long transactionID, WmMessageImpl message, int deliveryMode, boolean deliver, boolean confirmDelivery)
Publish a message.Notification
receive(int sessionID, long transactionID, int max, long ack, boolean synchronous, ReplyCb cb)
Send a request to receive messages from the Broker.java.lang.String[]
recover(int sessionID, int flags, long lastRetrivedTxId)
Recover the prepared transactions.void
rollback(int sessionID, long transactionID)
Rollback a transaction.void
rollback(int sessionID, java.lang.String xaTransactionID)
Rollback a transaction.void
sendKeepAlive(int sessionID)
Send a keep-alive to the Broker.void
sendKeepAliveResponse()
Send a keep-alive reply to a Broker keep-alive request.void
setBrowseFilter(int sessionID, java.lang.String clientID, int browseID, java.lang.String filter)
Set the browse filter.void
setFilter(int sessionID, java.lang.String filter)
Set the session's filter.void
setInfo(int sessionID, java.lang.String clientType)
Set the client's infoset.void
setTransactionID(int sessionID, long transactionID, java.lang.String xaTransactionID)
Set the transaction ID to an external ID.void
setTransactionTimeout(int sessionID, long transactionID, int timeout)
Set the timeout of the transaction specified by transactionIDlong
startTransaction(int sessionID)
Start a transaction.long
startTransaction(int sessionID, int timeout)
Start a transaction.long
startTransaction(int sessionID, java.lang.String xaTransactionID, int timeout, boolean join)
Start a transaction.void
subscribe(int sessionID, java.lang.String name, java.lang.String filter, int subID)
Send a subscription request.Subscription[]
subscriptions(int sessionID)
Get the current subscriptions.void
unsubscribe(int sessionID, java.lang.String name, java.lang.String filter)
Send an unsubscribe request.
-
-
-
Method Detail
-
initializeConnection
int initializeConnection(java.lang.String clientName, java.lang.String clientGroup, java.lang.String application, boolean sharedState, boolean reconnect) throws javax.jms.JMSException
Initialize a connection to the Broker.- Throws:
javax.jms.JMSException
-
initializeConnection
int initializeConnection(java.lang.String clientName, java.lang.String clientGroup, java.lang.String application, boolean sharedState, boolean reconnect, java.lang.String userName, java.lang.String password) throws javax.jms.JMSException
Initialize a connection to the Broker.- Throws:
javax.jms.JMSException
-
initializeSession
int initializeSession(java.lang.String clientName, boolean queue, boolean priorityOrdering, java.lang.String clientGroup, java.lang.String application, boolean guaranteed, boolean ackNonPersistent, boolean sharedState, int sharedStateOrdering, boolean reconnect, boolean acceptExisting) throws javax.jms.JMSException
Initialize a session to the Broker.- Throws:
javax.jms.JMSException
-
getUniqueID
java.lang.String getUniqueID(int sessionID) throws javax.jms.JMSException
Get a unique identifier from the Broker.- Returns:
- a unique identifier
- Throws:
javax.jms.JMSException
-
startTransaction
long startTransaction(int sessionID) throws javax.jms.JMSException
Start a transaction.- Returns:
- the transaction ID
- Throws:
javax.jms.JMSException
- if a transaction cannot be started
-
startTransaction
long startTransaction(int sessionID, int timeout) throws javax.jms.JMSException
Start a transaction.- Returns:
- the transaction ID
- Throws:
javax.jms.JMSException
- if a transaction cannot be started
-
startTransaction
long startTransaction(int sessionID, java.lang.String xaTransactionID, int timeout, boolean join) throws javax.jms.JMSException
Start a transaction.- Parameters:
xaTransactionID
- the XA transaction IDtimeout
- the transaction timeoutjoin
-true
to join an existing transaction- Returns:
- the transaction ID
- Throws:
javax.jms.JMSException
- if a transaction cannot be started
-
setTransactionID
void setTransactionID(int sessionID, long transactionID, java.lang.String xaTransactionID) throws javax.jms.JMSException
Set the transaction ID to an external ID.- Parameters:
transactionID
- the transaction IDxaTransactionID
- the XA transaction ID- Throws:
javax.jms.JMSException
- if a transaction cannot be started
-
setTransactionTimeout
void setTransactionTimeout(int sessionID, long transactionID, int timeout) throws javax.jms.JMSException
Set the timeout of the transaction specified by transactionID- Parameters:
sessionID
- the session IDtransactionID
- the transaction IDtimeout
- new timeout value in seconds- Throws:
javax.jms.JMSException
- if a new timeout cannot be set on a transaction
-
endTransaction
void endTransaction(int sessionID, long transactionID, boolean success) throws javax.jms.JMSException
End a transaction.- Parameters:
transactionID
- the transaction ID- Throws:
javax.jms.JMSException
- if a transaction cannot be started
-
commit
void commit(int sessionID, long transactionID) throws javax.jms.JMSException
Commit a transaction.- Parameters:
transactionID
- the transaction ID to commit- Throws:
javax.jms.JMSException
- if the transaction cannot be committed
-
commit
void commit(int sessionID, java.lang.String xaTransactionID) throws javax.jms.JMSException
Commit a transaction.- Parameters:
xaTransactionID
- the XA transaction ID to commit- Throws:
javax.jms.JMSException
- if the transaction cannot be committed
-
rollback
void rollback(int sessionID, long transactionID) throws javax.jms.JMSException
Rollback a transaction.- Parameters:
transactionID
- the transaction ID to rollback.- Throws:
javax.jms.JMSException
- if the transaction cannot be rolled back
-
rollback
void rollback(int sessionID, java.lang.String xaTransactionID) throws javax.jms.JMSException
Rollback a transaction.- Parameters:
xaTransactionID
- the XA transaction ID to rollback.- Throws:
javax.jms.JMSException
- if the transaction cannot be rolled back
-
recover
java.lang.String[] recover(int sessionID, int flags, long lastRetrivedTxId) throws javax.jms.JMSException
Recover the prepared transactions.- Returns:
- a list of prepared transactions
- Throws:
javax.jms.JMSException
-
forget
void forget(int sessionID, java.lang.String xaTransactionID) throws javax.jms.JMSException
Forget a transaction.- Parameters:
xaTransactionID
- the XA transaction ID- Throws:
javax.jms.JMSException
-
prepare
void prepare(int sessionID, java.lang.String xaTransactionID) throws javax.jms.JMSException
Prepare a transaction.- Parameters:
xaTransactionID
- the XA transaction ID- Throws:
javax.jms.JMSException
-
prepare
void prepare(int sessionID, long xaTransactionID) throws javax.jms.JMSException
Prepare a transaction.- Parameters:
xaTransactionID
- the XA transaction ID- Throws:
javax.jms.JMSException
-
getQueueLength
long getQueueLength(int sessionID) throws javax.jms.JMSException
Get the queue length.- Returns:
- the queue length
- Throws:
javax.jms.JMSException
-
clearQueue
void clearQueue(int sessionID) throws javax.jms.JMSException
Clear the queue.- Throws:
javax.jms.JMSException
-
receive
Notification receive(int sessionID, long transactionID, int max, long ack, boolean synchronous, ReplyCb cb) throws javax.jms.JMSException
Send a request to receive messages from the Broker.- Parameters:
max
- maximum number of messages to receiveack
- acknowledge through this sequence number, used for DUPS-OK acknowledge mode, or -1 to acknowledge nothingcb
- the callback to invoke when the messages arrive- Returns:
- the notification request
- Throws:
javax.jms.JMSException
- if the request cannot be sent
-
cancelReceive
void cancelReceive(int sessionID, int pendingRequestID) throws javax.jms.JMSException
Cancel a request to receive messages from the Broker.- Parameters:
pendingRequestID
- the pending request ID to cancel- Throws:
javax.jms.JMSException
- if the request cannot be canceled
-
acknowledgeThrough
void acknowledgeThrough(int sessionID, long transactionID, long sequenceNumber, boolean confirm) throws javax.jms.JMSException
Acknowledge received messages through this sequence number.- Parameters:
sequenceNumber
- the sequence number to acknowledge through- Throws:
javax.jms.JMSException
- if the acknowledgement cannot be sent
-
acknowledge
void acknowledge(int sessionID, long transactionID, long sequenceNumber) throws javax.jms.JMSException
Acknowledge the given message sequence number.- Parameters:
sequenceNumber
- sequence number to acknowledge- Throws:
javax.jms.JMSException
- if the acknowledgement cannot be sent
-
acknowledge
void acknowledge(int sessionID, long transactionID, long[] sequenceNumbers) throws javax.jms.JMSException
Acknowledge the given list of message sequence numbers.- Parameters:
sequenceNumbers
- list of sequence numbers to acknowledge- Throws:
javax.jms.JMSException
- if the acknowledgement cannot be sent
-
negativeAcknowledge
void negativeAcknowledge(int sessionID, long transactionID, long sequenceNumber) throws javax.jms.JMSException
Negative acknowledge the message sequence number.- Parameters:
sequenceNumber
- sequence number to negative acknowledge- Throws:
javax.jms.JMSException
- if the acknowledgement cannot be sent
-
negativeAcknowledge
void negativeAcknowledge(int sessionID, long transactionID, long[] sequenceNumbers) throws javax.jms.JMSException
Negative acknowledge the given list of message sequence numbers.- Parameters:
sequenceNumbers
- list of sequence numbers to negative acknowledge- Throws:
javax.jms.JMSException
- if the acknowledgement cannot be sent
-
destroy
void destroy(int sessionID) throws javax.jms.JMSException
Destroy the underlying Broker client.- Throws:
javax.jms.JMSException
- if the request cannot be sent
-
disconnect
void disconnect(int sessionID) throws javax.jms.JMSException
Disconnect the underlying Broker client.- Throws:
javax.jms.JMSException
- if the request cannot be sent
-
canSubscribe
void canSubscribe(int sessionID, java.lang.String name) throws javax.jms.JMSException
Checks if there are adequate permissions to subscribe.- Parameters:
name
- the name to check for subscribe permissions- Throws:
javax.jms.JMSException
- if the request cannot be sent or no subscribe permissions
-
canPublish
void canPublish(int sessionID, java.lang.String name) throws javax.jms.JMSException
Checks if there are adequate permissions to publish.- Parameters:
name
- the name to check for publish permissions- Throws:
javax.jms.JMSException
- if the request cannot be sent or no publish permissions
-
setFilter
void setFilter(int sessionID, java.lang.String filter) throws javax.jms.JMSException
Set the session's filter.- Parameters:
filter
- the filter to set for this session- Throws:
javax.jms.JMSException
- if the session cannot be set
-
subscribe
void subscribe(int sessionID, java.lang.String name, java.lang.String filter, int subID) throws javax.jms.JMSException
Send a subscription request.- Parameters:
name
- the subscriptionfilter
- an optional filtersubID
- subscription ID- Throws:
javax.jms.JMSException
- if the subscription request fails
-
unsubscribe
void unsubscribe(int sessionID, java.lang.String name, java.lang.String filter) throws javax.jms.JMSException
Send an unsubscribe request.- Parameters:
name
- the subscription namefilter
- the filter- Throws:
javax.jms.JMSException
- if the request fails
-
subscriptions
Subscription[] subscriptions(int sessionID) throws javax.jms.JMSException
Get the current subscriptions.- Returns:
- the current subscriptions
- Throws:
javax.jms.JMSException
- if the request fails
-
publish
void publish(int sessionID, long transactionID, WmMessageImpl message, int deliveryMode, boolean deliver, boolean confirmDelivery) throws javax.jms.JMSException
Publish a message.- Parameters:
message
- the message to publish- Throws:
javax.jms.JMSException
- if the publish fails
-
publish
void publish(int sessionID, long transactionID, WmMessageImpl[] messages, int deliveryMode, boolean deliver, boolean confirmDelivery) throws javax.jms.JMSException
Publish multiple messages.- Parameters:
messages
- the messages to publish- Throws:
javax.jms.JMSException
- if the publish fails
-
publish
void publish(int sessionID, long transactionID, WmMessageImpl message, int deliveryMode, boolean deliver) throws javax.jms.JMSException
Publish a message.- Parameters:
message
- the message to publish- Throws:
javax.jms.JMSException
- if the publish fails
-
publish
void publish(int sessionID, long transactionID, WmMessageImpl[] messages, int deliveryMode, boolean deliver) throws javax.jms.JMSException
Publish multiple messages.- Parameters:
messages
- the messages to publish- Throws:
javax.jms.JMSException
- if the publish fails
-
getBrokerName
java.lang.String getBrokerName(int sessionID) throws javax.jms.JMSException
Get the name of the broker.- Returns:
- The name of the broker.
- Throws:
javax.jms.JMSException
-
getTerritory
java.lang.String getTerritory(int sessionID) throws javax.jms.JMSException
Get the name of the territory.- Returns:
- Then name of the territory
- Throws:
javax.jms.JMSException
-
sendKeepAlive
void sendKeepAlive(int sessionID) throws javax.jms.JMSException
Send a keep-alive to the Broker.- Throws:
javax.jms.JMSException
- if the request cannot be sent or a reponse was not received within the timeout
-
getAccessLabel
short[] getAccessLabel(int sessionID) throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
getPublishProcessState
int getPublishProcessState(int sessionID) throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
setInfo
void setInfo(int sessionID, java.lang.String clientType) throws javax.jms.JMSException
Set the client's infoset.- Parameters:
clientType
- the type of client- Throws:
javax.jms.JMSException
-
beginBrowse
int beginBrowse(int sessionID, java.lang.String clientID) throws javax.jms.JMSException
Begin browse operations.- Throws:
javax.jms.JMSException
-
endBrowse
void endBrowse(int sessionID, java.lang.String clientID, int browseID) throws javax.jms.JMSException
End browse operations.- Throws:
javax.jms.JMSException
-
setBrowseFilter
void setBrowseFilter(int sessionID, java.lang.String clientID, int browseID, java.lang.String filter) throws javax.jms.JMSException
Set the browse filter.- Throws:
javax.jms.JMSException
-
browse
WmMessageImpl browse(int sessionID, java.lang.String clientID, int browseID) throws javax.jms.JMSException
Browse the next message.- Throws:
javax.jms.JMSException
-
sendKeepAliveResponse
void sendKeepAliveResponse() throws javax.jms.JMSException
Send a keep-alive reply to a Broker keep-alive request.- Throws:
javax.jms.JMSException
- if the reply cannot be sent
-
-