public class SessionModeSupportClient extends SessionModeSupport
FLAG_IGNORE_ALREADY_EXISTS, FLAG_IGNORE_DOES_NOT_EXIST, WAIT_FOR_CONFIRM| Constructor and Description |
|---|
SessionModeSupportClient(CSMPControllerChannel controlChannel,
CSMPPublisherChannel publisherChannel,
CSMPSubscriberChannel subscriberChannel,
TcpClientChannel clientChannel,
SubFlowManagerImpl flowMgr,
JCSMPBasicSession session) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSubscriber()
Adds a subscriber to the appliance using the user information associated
with the
Session. |
void |
addSubscription(Endpoint endpoint,
Subscription subscription,
int subscribeFlags)
Adds a subscription to an Endpoint on the appliance.
|
void |
addSubscription(Endpoint endpoint,
Subscription subscription,
JCSMPResponseListener handler,
Object key)
Adds a subscription asynchronously to an Endpoint on the appliance.
|
void |
addSubscription(Subscription subscription)
Adds a subscription to the appliance.
|
void |
addSubscription(Subscription subscription,
boolean waitForConfirm)
Adds a subscription to an appliance.
|
void |
addSubscription(Subscription subscription,
boolean waitForConfirm,
boolean notifySubCache) |
void |
addSubscription(Subscription subscription,
JCSMPResponseListener handler,
Object key)
Adds a subscription asynchronously to the appliance.
|
Consumer |
addSubscription(Subscription subscription,
XMLMessageListener listener,
ConsumerNotificationDispatcherFactory dispatcherFactory)
[SolReserved]
For Topic Dispatching.
|
void |
applySubscriptions(Set<Subscription> subscriptions)
Uses the subscription refresh feature to override the subscriptions and
subscription filters associated with a subscriber on the appliance with a
given list of subscriptions.
|
void |
clearSubscriber()
Removes a subscriber's CSMP-created subscriptions from the appliance.
|
void |
closeControlChannel() |
Browser |
createBrowser(BrowserProperties properties)
Creates a
Browser, which can be used for browsing the contents of a Queue. |
Browser |
createBrowser(BrowserProperties properties,
FlowEventHandler flowEventHandler)
Creates a
Browser, which can be used for browsing the contents of a Queue. |
CacheSession |
createCacheSession(CacheSessionProperties properties)
Creates a CacheSession using the provided CacheSession properties.
|
TransactedSession |
createTransactedSession()
Creates a new
TransactedSession with the connected appliance. |
XASession |
createXASession()
SolReserved - Creates a new
XASession with the connected appliance. |
void |
deleteSubscriber() |
JndiMessage |
executeJndiQuery(JndiMessage request)
SolReserved - Executes a JNDI query against the appliance, opening the control channel, if
required.
|
XMLMessageProducer |
getMessageProducer(JCSMPStreamingPublishEventHandler callback)
Get an instance of
XMLMessageProducer. |
XMLMessageProducer |
getMessageProducer(JCSMPStreamingPublishEventHandler callback,
JCSMPProducerEventHandler eventCallback)
Get an instance of
XMLMessageProducer. |
WireMessage |
performDeleteEndpointCommad(WireMessage delEpCommand) |
WireMessage |
performProvisionEndpointCommand(WireMessage provEpCommand) |
void |
reestablishSubCache()
Reestablishes the subscription cache using non-retryable, non-blocking
subscription adds.
|
void |
removeSubscription(Endpoint endpoint,
Subscription subscription,
int unsubscribeFlags)
Removes a subscription from an Endpoint on the appliance.
|
void |
removeSubscription(Endpoint endpoint,
Subscription subscription,
JCSMPResponseListener handler,
Object key)
Removes a subscription asynchronously from an Endpoint on the appliance.
|
void |
removeSubscription(Subscription subscription)
Removes a subscription from the appliance.
|
void |
removeSubscription(Subscription subscription,
boolean waitForConfirm)
Removes a subscription from the appliance.
|
void |
removeSubscription(Subscription subscription,
JCSMPResponseListener handler,
Object key)
Removes a subscription asynchronously from the appliance.
|
void |
setJmsClientId(String clientId,
boolean allowSharedClientId) |
void |
setProperty(String property,
Object value)
Sets a modifiable Session property once the Session has been constructed.
|
void |
validateBindTopicOrQueue(AbstractDestination dest) |
void |
validateSubscriberEndpointValidEndpoint() |
closeSession, connect, createFlow, createFlow, createFlow, createFlow, createFlow, createFlow, createFlow, createNonDurableTopicEndpoint, createNonDurableTopicEndpoint, createProducer, createProducer, createRequestor, createTemporaryQueue, createTemporaryQueue, createTemporaryTopic, deprovision, getCapability, getConsumer, getHostId, getMessageConsumer, getMessageConsumer, getMessageConsumer, getMessageConsumer, getMessageConsumer, getMessageConsumer, getMessageConsumer, getMessageConsumer, getMessageProducer, getProducer, getProperty, getSessionName, getSessionStats, getSubscriptionCache, isCapable, isClosed, logFlowInfo, logSessionStats, notifySubscriptionEvent, provision, removeSubscriber, unsubscribeDurableTopicEndpointpublic SessionModeSupportClient(CSMPControllerChannel controlChannel, CSMPPublisherChannel publisherChannel, CSMPSubscriberChannel subscriberChannel, TcpClientChannel clientChannel, SubFlowManagerImpl flowMgr, JCSMPBasicSession session)
public JndiMessage executeJndiQuery(JndiMessage request) throws JCSMPException
JCSMPSessionrequest - The JNDI request to execute.JndiMessage object containing the response.JCSMPException - on errorpublic void addSubscription(Subscription subscription) throws JCSMPException
JCSMPSessionJCSMPSession.addSubscription(Subscription, boolean)addSubscription in interface JCSMPSessionaddSubscription in class SessionModeSupportsubscription - The subscription to add.JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPException - On any other error condition.public void addSubscription(Subscription subscription, boolean waitForConfirm) throws JCSMPException
JCSMPSession
This method is used to add a subscription in either a blocking or non-blocking mode.
Setting waitForConfirm to false
prevents the API from waiting for a response before returning. In this
mode, a response is only sent by the appliance if the subscription is
rejected, and such a response is delivered to the
session event handler. It is invalid to set waitForConfirm
to false on a Session where no Session event handler is set,
and such an operation throws OperationNotSupportedException.
waitForConfirm is false the application will
never receive a positive confirmation, only errors are sent by callback.
When waitForConfirm is true, this method does not return until the
appliance has responded to the subscription operation, it throws on error and otherwise
returns to indicate the subscription operation was successful.
addSubscription in interface JCSMPSessionaddSubscription in class SessionModeSupportsubscription - The subscription to add.waitForConfirm - Whether to request, and wait for, a response from the appliance
before returning.JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPException - On any other error condition.public void addSubscription(Subscription subscription, boolean waitForConfirm, boolean notifySubCache) throws JCSMPException
addSubscription in class SessionModeSupportJCSMPExceptionpublic Consumer addSubscription(Subscription subscription, XMLMessageListener listener, ConsumerNotificationDispatcherFactory dispatcherFactory) throws JCSMPException
JCSMPSessionaddSubscription in interface JCSMPSessionaddSubscription in class SessionModeSupportsubscription - The subscription to add.listener - The XMLMessageListener to receive the incoming
before returning.JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPException - On any other error condition.public void removeSubscription(Subscription subscription) throws JCSMPException
JCSMPSessionremoveSubscription in interface JCSMPSessionremoveSubscription in class SessionModeSupportsubscription - The subscription to remove.JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPException - On any other error condition.public void removeSubscription(Subscription subscription, boolean waitForConfirm) throws JCSMPException
JCSMPSession
Setting waitForConfirm to
false prevents the API from waiting for a response before
returning. In this mode, the appliance only sends a response if the
subscription is rejected, and such a response is delivered to the
session event handler. It is invalid to set waitForConfirm
to false on a Session where no Session event handler is set;
such an operation throws OperationNotSupportedException.
removeSubscription in interface JCSMPSessionremoveSubscription in class SessionModeSupportsubscription - The subscription to remove.waitForConfirm - Whether to request, and wait for, a response from the appliance
before returning.JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPException - On any other error condition.public void addSubscription(Endpoint endpoint, Subscription subscription, int subscribeFlags) throws JCSMPException
JCSMPSessionQueue or a ClientName.
Queue Endpoint can be used.Topic subscription can be used.ClientName Endpoint can be used.Topic subscription can be used.JCSMPSession.WAIT_FOR_CONFIRM is specified, the API waits
for a response before returning, otherwise the API returns immediately
after sending the update to the appliance. If JCSMPSession.WAIT_FOR_CONFIRM is
not specified, negative responses are delivered to the
session event handler. On a Session where no Session event handler is
set, an OperationNotSupportedException is thrown if
JCSMPSession.WAIT_FOR_CONFIRM is not specified.
JCSMPProperties.REAPPLY_SUBSCRIPTIONS will only apply direct
topic subscriptions unpon a Session reconnect. It will not reapply
topic subscriptions on durable and non-durable endpoints.
endpoint - The Endpoint to add the subscription on. If null, behaves like
JCSMPSession.addSubscription(Subscription, boolean).subscription - The subscription to add.subscribeFlags - The valid flag is JCSMPSession.WAIT_FOR_CONFIRMJCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
JCSMPErrorResponseSubcodeEx.SUBSCRIPTION_INVALIDJCSMPErrorResponseSubcodeEx.SUBSCRIPTION_ALREADY_PRESENTJCSMPErrorResponseSubcodeEx.SUBSCRIPTION_TOO_MANYJCSMPErrorResponseSubcodeEx.OUT_OF_RESOURCES JCSMPErrorResponseSubcodeEx.SUBSCRIPTION_ACL_DENIEDJCSMPErrorResponseSubcodeEx.UNKNOWN_QUEUE_NAMEJCSMPErrorResponseSubcodeEx.UNKNOWN_CLIENT_NAMEJCSMPErrorResponseSubcodeEx.SUBSCRIPTION_MANAGER_DENIEDOperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPException - On any other error condition.public void removeSubscription(Endpoint endpoint, Subscription subscription, int unsubscribeFlags) throws JCSMPException
JCSMPSessionJCSMPSession.addSubscription(Endpoint, Subscription, int) method.
Refer to that method's documentation for operational parameters.
This method cannot remove subscriptions added through the CLI.endpoint - The Endpoint to remove the subscription from. If null, behaves
like JCSMPSession.removeSubscription(Subscription, boolean).subscription - The subscription to remove.unsubscribeFlags - Valid flag is JCSMPSession.WAIT_FOR_CONFIRMJCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPException - On any other error condition.public void setProperty(String property, Object value) throws JCSMPException
JCSMPSessionModifiable properties include:
CLIENT_NAME (in TBRM only)Note: Modifying a Session property while the channel to the appliance is disconnected can cause it to connect and go through the authentication process.
property - The name of the property to modify.value - The new value of the property.JCSMPTransportException - If a transport error occurs.JCSMPErrorResponseException - If the appliance rejects the modification.JCSMPException - On other errors.public void addSubscriber()
throws JCSMPException
SessionSession.
If the user already exists on the appliance, this method still returns success.
JCSMPException - If there was an error adding the subscriber.public void clearSubscriber()
throws JCSMPException
SessionNote that if the subscriber has a large number of subscriptions, this operation can take a long time to return. If your application creates subscribers with several thousand subscriptions, it is advisable to increase the session's response timeout from the default, otherwise this operation could fail while waiting for the appliance to respond.
JCSMPException - If there was an error clearing the subscriber.OperationNotSupportedException - If performed on a closed session or a session not configured
for this operation.public XMLMessageProducer getMessageProducer(JCSMPStreamingPublishEventHandler callback) throws JCSMPException
JCSMPSessionXMLMessageProducer.
NOTE: For a given JCSMPSession, this method returns a
new XMLMessageProducer object on each call, closing the
existing producer if it exists.
NOTE: To monitor transport events in publish only applications
it is necessary to create an empty XMLMessageConsumer.
see JCSMPSession.getMessageConsumer(JCSMPReconnectEventHandler, XMLMessageListener).
callback - A mandatory callback handler to set. By setting a callback handler, any
send returns immediately without confirming the
successful delivery of the message. Applications receive a
response (when applicable) to the send
asynchronously through the callback.
For TR-mode clients, blocking publishing mode is not supported
and the callback cannot be null.
For legacy CR-mode clients, setting this to
(JCSMPStreamingPublishEventHandler)null
puts the producer in blocking mode.
JCSMPException - If acquiring the message producer failed.OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPErrorResponseException - If the operation fails with an error response, see
JCSMPErrorResponseSubcodeEx for login failures.public XMLMessageProducer getMessageProducer(JCSMPStreamingPublishEventHandler callback, JCSMPProducerEventHandler eventCallback) throws JCSMPException
JCSMPSessionXMLMessageProducer.
NOTE: For a given JCSMPSession, this method returns a
new XMLMessageProducer object on each call, closing the
existing producer if it exists.
NOTE: To monitor transport events in publish only applications
it is necessary to create an empty XMLMessageConsumer.
see JCSMPSession.getMessageConsumer(JCSMPReconnectEventHandler, XMLMessageListener).
callback - A mandatory stream callback handler to set. By setting a callback handler, any
send returns immediately without confirming the
successful delivery of the message. Applications receive a
response (when applicable) to the send
asynchronously through the callback.
For TR-mode clients, blocking publishing mode is not supported
and the callback cannot be null.
For legacy CR-mode clients, setting this to
(JCSMPStreamingPublishEventHandler)null
puts the producer in blocking mode.
eventCallback - A producer event handler.JCSMPException - If acquiring the message producer failed.OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPErrorResponseException - If the operation fails with an error response, see
JCSMPErrorResponseSubcodeEx for login failures.public void applySubscriptions(Set<Subscription> subscriptions) throws JCSMPException
JCSMPSessionThe application can call this method at any time to initiate a subscription refresh. Only valid if the Session is operating in non-client mode.
subscriptions - A Set<Subscription> of Subscription
objects.OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPException - On any other error condition.public void deleteSubscriber()
throws JCSMPException
JCSMPExceptionpublic CacheSession createCacheSession(CacheSessionProperties properties)
JCSMPSessionproperties - Properties for the CacheSession.public void closeControlChannel()
closeControlChannel in class SessionModeSupportpublic void validateSubscriberEndpointValidEndpoint()
throws JCSMPException
validateSubscriberEndpointValidEndpoint in class SessionModeSupportJCSMPExceptionpublic void validateBindTopicOrQueue(AbstractDestination dest) throws JCSMPException
validateBindTopicOrQueue in class SessionModeSupportJCSMPExceptionpublic void reestablishSubCache()
throws JCSMPException
reestablishSubCache in class SessionModeSupportJCSMPExceptionpublic WireMessage performProvisionEndpointCommand(WireMessage provEpCommand) throws JCSMPException
performProvisionEndpointCommand in class SessionModeSupportJCSMPExceptionpublic WireMessage performDeleteEndpointCommad(WireMessage delEpCommand) throws JCSMPException
performDeleteEndpointCommad in class SessionModeSupportJCSMPExceptionpublic Browser createBrowser(BrowserProperties properties) throws JCSMPException
JCSMPSessionBrowser, which can be used for browsing the contents of a Queue.properties - The Browser properties used for creation.JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
JCSMPErrorResponseSubcodeEx.CANNOT_BIND_TO_QUEUEJCSMPErrorResponseSubcodeEx.PERMISSION_NOT_ALLOWEDJCSMPErrorResponseSubcodeEx.MAX_CLIENTS_FOR_QUEUEJCSMPErrorResponseSubcodeEx.MAX_CLIENTS_FOR_TEJCSMPErrorResponseSubcodeEx.UNKNOWN_QUEUE_NAMEJCSMPErrorResponseSubcodeEx.UNKNOWN_TE_NAMEJCSMPErrorResponseSubcodeEx.QUEUE_SHUTDOWNJCSMPErrorResponseSubcodeEx.TE_SHUTDOWNJCSMPException - on other exceptions.public TransactedSession createTransactedSession() throws JCSMPException
JCSMPSessionTransactedSession with the connected appliance. This
call blocks until the TransactedSession is successfully
created.TransactedSession.JCSMPException - on errorpublic XASession createXASession() throws JCSMPException
JCSMPSessionXASession with the connected appliance. This
call blocks until the XASession is successfully
created.JCSMPException - on errorpublic void setJmsClientId(String clientId, boolean allowSharedClientId) throws JCSMPException
JCSMPExceptionpublic Browser createBrowser(BrowserProperties properties, FlowEventHandler flowEventHandler) throws JCSMPException
JCSMPSessionBrowser, which can be used for browsing the contents of a Queue.properties - The Browser properties used for creation.flowEventHandler - (optional) A callback listener registered to a flow to receive
flow active or flow inactive event if active flow indication is set to
true in the consumer flow properties. See
ConsumerFlowProperties.setActiveFlowIndication(boolean).JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
JCSMPErrorResponseSubcodeEx.CANNOT_BIND_TO_QUEUEJCSMPErrorResponseSubcodeEx.PERMISSION_NOT_ALLOWEDJCSMPErrorResponseSubcodeEx.MAX_CLIENTS_FOR_QUEUEJCSMPErrorResponseSubcodeEx.MAX_CLIENTS_FOR_TEJCSMPErrorResponseSubcodeEx.UNKNOWN_QUEUE_NAMEJCSMPErrorResponseSubcodeEx.UNKNOWN_TE_NAMEJCSMPErrorResponseSubcodeEx.QUEUE_SHUTDOWNJCSMPErrorResponseSubcodeEx.TE_SHUTDOWNJCSMPException - on other exceptions.public void addSubscription(Subscription subscription, JCSMPResponseListener handler, Object key) throws JCSMPException
JCSMPSessionsubscription - The subscription to add.handler - The subscription event handlerkey - The correlation key of the add subscription operationOperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPException - On any other error condition.public void addSubscription(Endpoint endpoint, Subscription subscription, JCSMPResponseListener handler, Object key) throws JCSMPException
JCSMPSessionQueue or a ClientName.
Queue Endpoint can be used.Topic subscription can be used.ClientName Endpoint can be used.Topic subscription can be used.
JCSMPProperties.REAPPLY_SUBSCRIPTIONS will not reapply
topic subscriptions on durable and non-durable endpoints.
endpoint - The Endpoint to add the subscription on.subscription - The subscription to add.handler - The subscription event handlerkey - The correlation key of the add subscription operationOperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPException - On any other error condition.public void removeSubscription(Subscription subscription, JCSMPResponseListener handler, Object key) throws JCSMPException
JCSMPSessionsubscription - The subscription to remove.handler - The subscription event handlerkey - The correlation key of the remove subscription operationOperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPException - On any other error condition.public void removeSubscription(Endpoint endpoint, Subscription subscription, JCSMPResponseListener handler, Object key) throws JCSMPException
JCSMPSessionendpoint - The Endpoint to remove the subscription from.subscription - The subscription to remove.handler - The subscription event handlerkey - The correlation key of the remove subscription operationOperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPException - On any other error condition.Copyright 2004-2020 Solace Corporation. All rights reserved.