public class JCSMPBasicSession extends Object implements JCSMPSession, JCSMPDestinationSession, SessionSubscriptionEventListener
JCSMPBasicSession The base class of JCSMPSession implementation| Modifier and Type | Class and Description |
|---|---|
static class |
JCSMPBasicSession.InternalBindProperties |
static class |
JCSMPBasicSession.TransientData |
FLAG_IGNORE_ALREADY_EXISTS, FLAG_IGNORE_DOES_NOT_EXIST, WAIT_FOR_CONFIRM| Constructor and Description |
|---|
JCSMPBasicSession(JCSMPProperties properties,
SecureProperties secureProps,
ContextImpl parentCtx,
SessionEventHandler eventHandler) |
JCSMPBasicSession(JCSMPProperties properties,
SecureProperties secureProps,
ContextImpl parentCtx,
SessionEventHandler eventHandler,
boolean allowSharedClientId) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSubscriber()
Deprecated.
|
void |
addSubscription(Endpoint endpoint,
Subscription subscription,
int subscribeFlags)
Adds a subscription to an Endpoint on the appliance.
|
void |
addSubscription(Endpoint endpoint,
Subscription subscription,
JCSMPResponseListener listener,
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,
JCSMPResponseListener listener,
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 |
closeSession()
Closes the session.
|
void |
connect()
Connect to the appliance.
|
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.
|
FlowReceiver |
createFlow(Endpoint endpoint,
Subscription newSubscription,
XMLMessageListener listener)
|
FlowReceiver |
createFlow(XMLMessageListener listener,
ConsumerFlowProperties flowProperties)
|
FlowReceiver |
createFlow(XMLMessageListener listener,
ConsumerFlowProperties flowProperties,
EndpointProperties endpointProps)
|
FlowReceiver |
createFlow(XMLMessageListener listener,
ConsumerFlowProperties flowProperties,
EndpointProperties endpointProps,
FlowEventHandler flowEventHandler)
|
FlowReceiver |
createFlow(XMLMessageListener listener,
ConsumerFlowProperties flowProperties,
EndpointProperties endpointProps,
JCSMPBasicSession.InternalBindProperties int_bind_prop) |
FlowReceiver |
createFlow(XMLMessageListener listener,
ConsumerFlowProperties flowProperties,
EndpointProperties endpointProps,
JCSMPBasicSession.InternalBindProperties int_bind_prop,
FlowEventHandler flowEventHandler) |
static JCSMPGenericXMLMessage |
createGenericXMLMessage(int contentSize,
boolean useDirectBuffers,
boolean isPub) |
static JCSMPGenericXMLMessage |
createGenericXMLMessage(JCSMPGenericXMLMessage toclone,
boolean useDirect,
boolean resetContent) |
TopicEndpoint |
createNonDurableTopicEndpoint()
Creates a non-durable Topic Endpoint.
|
TopicEndpoint |
createNonDurableTopicEndpoint(String name)
Creates a non-durable Topic Endpoint based on the given name.
|
XMLMessageProducer |
createProducer(ProducerFlowProperties fprop,
JCSMPStreamingPublishEventHandler callback)
[SolReserved] Open a new producer flow using the specified properties.
|
XMLMessageProducer |
createProducer(ProducerFlowProperties fprop,
JCSMPStreamingPublishEventHandler callback,
JCSMPProducerEventHandler eventCallback)
[SolReserved] Open a new producer flow using the specified properties.
|
XMLMessageProducer |
createProducer(ProducerFlowProperties fprop,
JCSMPStreamingPublishEventHandler streamCallback,
JCSMPProducerEventHandler eventCallback,
JCSMPBasicSession.InternalBindProperties internalBindProperties) |
Requestor |
createRequestor()
Creates a new
Requestor for this Session. |
Queue |
createTemporaryQueue()
Creates a temporary Queue for this Session.
|
Queue |
createTemporaryQueue(String name)
Creates a temporary Queue with the given name.
|
Topic |
createTemporaryTopic()
Creates a temporary Topic for this Session.
|
TransactedSession |
createTransactedSession()
Creates a new
TransactedSession with the connected appliance. |
TransactedSession |
createTransactedSessionInternal() |
XASession |
createXASession()
SolReserved - Creates a new
XASession with the connected appliance. |
void |
deleteSubscriber() |
void |
deprovision(Endpoint endpoint,
long deprovisionFlags)
Deprovisions an Endpoint on the appliance.
|
JndiMessage |
executeJndiQuery(JndiMessage request)
SolReserved - Executes a JNDI query against the appliance, opening the control channel, if
required.
|
AssuredCtrlFactory |
getAssuredCtrlFactory() |
Object |
getCapability(CapabilityType type)
Gets the value of a capability for the currently connected Session.
|
TcpClientChannel |
getClientChannel() |
ClientInfoProvider |
getClientInfoProvider() |
JCSMPXMLMessageConsumer |
getConsumer() |
ContextImpl |
getContext() |
String |
getGdReconnectFailAction() |
JCSMPProperties |
getJCSMPProperties() |
XMLMessageConsumer |
getMessageConsumer()
Deprecated.
|
DestinationConsumer |
getMessageConsumer(DestinationListener listener)
Get the instance of
DestinationConsumer. |
DestinationConsumer |
getMessageConsumer(DestinationSubscriptionStateProvider destinationSubscriptionStateProvider,
DestinationListener listener)
Get the instance of
DestinationConsumer with subscriptions
out-of-sync checking. |
DestinationConsumer |
getMessageConsumer(DestinationSubscriptionStateProvider destinationSubscriptionStateProvider,
JCSMPReconnectEventHandler reconnectHandler,
DestinationListener listener)
Get the instance of
DestinationConsumer with subscriptions out-of-sync
checking and reconnect event handler. |
XMLMessageConsumer |
getMessageConsumer(JCSMPReconnectEventHandler reconnectHandler)
Deprecated.
|
DestinationConsumer |
getMessageConsumer(JCSMPReconnectEventHandler reconnectHandler,
DestinationListener listener)
Get the instance of
DestinationConsumer with a reconnect event
handler. |
XMLMessageConsumer |
getMessageConsumer(JCSMPReconnectEventHandler reconnectHandler,
XMLMessageListener listener)
Get an instance of
XMLMessageConsumer with a reconnect event
handler. |
XMLMessageConsumer |
getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider)
Deprecated.
|
XMLMessageConsumer |
getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider,
JCSMPReconnectEventHandler reconnectHandler)
Deprecated.
|
XMLMessageConsumer |
getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider,
JCSMPReconnectEventHandler reconnectHandler,
XMLMessageListener listener)
Deprecated.
|
XMLMessageConsumer |
getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider,
XMLMessageListener listener)
Deprecated.
|
XMLMessageConsumer |
getMessageConsumer(XMLMessageListener listener)
Get an instance of
XMLMessageConsumer. |
XMLMessageProducer |
getMessageProducer() |
XMLMessageProducer |
getMessageProducer(JCSMPStreamingPublishEventHandler callback)
Get an instance of
XMLMessageProducer. |
DestinationProducer |
getMessageProducer(JCSMPStreamingPublishEventHandler callback,
Destination defaultTopic)
Get the instance of
DestinationProducer. |
XMLMessageProducer |
getMessageProducer(JCSMPStreamingPublishEventHandler callback,
JCSMPProducerEventHandler eventCallback)
Get an instance of
XMLMessageProducer. |
int |
getNegotiatedMaxADCtrlVersion() |
int |
getNegotiatedMaxXAVersion() |
int |
getNegotiatedMinADCtrlVersion() |
int |
getNegotiatedMinXAVersion() |
String |
getP2pTopicDescriptionBase() |
JCSMPXMLMessageProducer |
getProducer() |
Object |
getProperty(String property)
Gets a Session property.
|
PubFlowManager |
getPubFlowManager() |
TargetRouterMode |
getRouterMode() |
SecureProperties |
getSecureProperties() |
JCSMPException |
getSessionAbortException() |
String |
getSessionID() |
String |
getSessionName()
If the session name is specified by
JCSMPProperties.SESSION_NAME, this method
returns the name specified. |
JCSMPSessionStats |
getSessionStats()
Get this session's statistics.
|
Set<Subscription> |
getSubscriptionCache()
Gets an unmodifiable view of the Session's subscription cache.
|
Object |
getTransientData(JCSMPBasicSession.TransientData key) |
String |
getVirtualRouterName() |
void |
handleSessionEvent(SessionEventArgs event) |
boolean |
hasSessionEventHandler() |
boolean |
isCapable(CapabilityType ctype)
Checks if the specified capability is set on the currently connected
Session.
|
boolean |
isClosed()
SolReserved - Checks if this session has been closed.
|
boolean |
isSessionReconnectAborted() |
void |
logFlowInfo(JCSMPLogLevel level)
Outputs a log at the specified log level that contains the flow state
information for flows in this Session.
|
void |
logSessionStats(JCSMPLogLevel level)
Outputs a log at the specified log level containing a textual
representation of the session statistics.
|
void |
notifySessionReconnectAborted(JCSMPException e) |
void |
notifySubscriptionEvent(SessionSubscriptionEvent ev)
Call here to process user subscription events for the Subscription Cache.
|
void |
notifyVridChange() |
void |
provision(Endpoint endpoint,
EndpointProperties props,
long provisionFlags)
Provisions an Endpoint on the appliance.
|
void |
putTransientData(JCSMPBasicSession.TransientData key,
Object value,
boolean noreplace) |
boolean |
reconnectInProgress() |
void |
reconnectInProgress(boolean status) |
void |
reestablishSubCache()
Reestablishes the subscription cache using non-retryable, non-blocking
subscription adds.
|
void |
removeSubscriber()
Deprecated.
|
void |
removeSubscription(Endpoint endpoint,
Subscription subscription,
int unsubscribeFlags)
Removes a subscription from an Endpoint on the appliance.
|
void |
removeSubscription(Endpoint endpoint,
Subscription subscription,
JCSMPResponseListener listener,
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 listener,
Object key)
Removes a subscription asynchronously from the appliance.
|
void |
setJmsClientId(String clientId,
boolean allowSharedClientId) |
void |
setP2pTopicDescriptionBase(String p2pTopicDescriptionBase) |
void |
setProperty(String property,
Object value)
Sets a modifiable Session property once the Session has been constructed.
|
void |
unsubscribeDurableTopicEndpoint(DurableTopicEndpoint endpoint)
Unsubscribe from the durable Topic Endpoint.
|
void |
waitUntilSessionReconnectDone(String caller) |
void |
xaSessionMessageIdRenumbering(PubADManager adMgr) |
public JCSMPBasicSession(JCSMPProperties properties, SecureProperties secureProps, ContextImpl parentCtx, SessionEventHandler eventHandler)
public JCSMPBasicSession(JCSMPProperties properties, SecureProperties secureProps, ContextImpl parentCtx, SessionEventHandler eventHandler, boolean allowSharedClientId)
public void notifySessionReconnectAborted(JCSMPException e)
public boolean isSessionReconnectAborted()
public JCSMPException getSessionAbortException()
public int getNegotiatedMinXAVersion()
public void notifyVridChange()
public int getNegotiatedMaxXAVersion()
public PubFlowManager getPubFlowManager()
public void xaSessionMessageIdRenumbering(PubADManager adMgr)
public int getNegotiatedMinADCtrlVersion()
public int getNegotiatedMaxADCtrlVersion()
public String getGdReconnectFailAction()
public Object getTransientData(JCSMPBasicSession.TransientData key)
public void putTransientData(JCSMPBasicSession.TransientData key, Object value, boolean noreplace)
public ContextImpl getContext()
public String getSessionName()
SessionJCSMPProperties.SESSION_NAME, this method
returns the name specified. Otherwise, a default name is returned.getSessionName in interface Sessionpublic TargetRouterMode getRouterMode()
public static JCSMPGenericXMLMessage createGenericXMLMessage(int contentSize, boolean useDirectBuffers, boolean isPub)
public static JCSMPGenericXMLMessage createGenericXMLMessage(JCSMPGenericXMLMessage toclone, boolean useDirect, boolean resetContent)
public void closeSession()
Session
Any XMLMessageProducer, XMLMessageConsumer, and channel
connections associated with the session are also closed.
closeSession in interface SessionSession.closeSession()public boolean isClosed()
Sessionpublic JCSMPSessionStats getSessionStats()
SessiongetSessionStats in interface SessionSession.getSessionStats()public void logSessionStats(JCSMPLogLevel level)
SessionlogSessionStats in interface Sessionlevel - The level (corresponding to
org.apache.commons.logging levels) at which to
output the log.public void logFlowInfo(JCSMPLogLevel level)
JCSMPSessionlogFlowInfo in interface JCSMPSessionlevel - The level (corresponding to
org.apache.commons.logging levels) at which to
output the log.@Deprecated public void addSubscriber() throws JCSMPException
SessionSession.
If the user already exists on the appliance, this method still returns success.
addSubscriber in interface SessionJCSMPException - If there was an error adding the subscriber.Session.addSubscriber()@Deprecated public void removeSubscriber() throws JCSMPException
SessionSession.removeSubscriber in interface SessionJCSMPException - If there was an error removing the
subscriber.Session.removeSubscriber()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.
clearSubscriber in interface SessionJCSMPException - If there was an error clearing the subscriber.OperationNotSupportedException - If performed on a closed session or a session not configured
for this operation.public void deleteSubscriber()
throws JCSMPException
deleteSubscriber in interface SessionJCSMPExceptionpublic XMLMessageProducer createProducer(ProducerFlowProperties fprop, JCSMPStreamingPublishEventHandler callback) throws JCSMPException
JCSMPSessioncallback must not
be null. A producer flow can only be used to send Guaranteed
messages.createProducer in interface JCSMPSessionfprop - The producer flow properties.callback - The streaming event handler.InvalidOperationException - If the peer capabilities do not support features requested in
this operation.JCSMPException - On other errors.public XMLMessageProducer createProducer(ProducerFlowProperties fprop, JCSMPStreamingPublishEventHandler callback, JCSMPProducerEventHandler eventCallback) throws JCSMPException
JCSMPSessioncallback must not
be null. A producer flow can only be used to send Guaranteed
messages.createProducer in interface JCSMPSessionfprop - The producer flow properties.callback - The streaming event handler.eventCallback - A producer event handler.InvalidOperationException - If the peer capabilities do not support features requested in
this operation.JCSMPException - On other errors.public XMLMessageProducer createProducer(ProducerFlowProperties fprop, JCSMPStreamingPublishEventHandler streamCallback, JCSMPProducerEventHandler eventCallback, JCSMPBasicSession.InternalBindProperties internalBindProperties) throws JCSMPException
JCSMPExceptionpublic XMLMessageProducer getMessageProducer() throws JCSMPException
getMessageProducer in interface JCSMPSessionJCSMPExceptionpublic 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).
getMessageProducer in interface JCSMPSessioncallback - 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.JCSMPSession.getMessageProducer(JCSMPStreamingPublishEventHandler)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).
getMessageProducer in interface JCSMPSessioncallback - 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.JCSMPSession.getMessageProducer(JCSMPStreamingPublishEventHandler)@Deprecated public XMLMessageConsumer getMessageConsumer() throws JCSMPException
getMessageConsumer in interface JCSMPSessionJCSMPExceptionpublic XMLMessageConsumer getMessageConsumer(XMLMessageListener listener) throws JCSMPException
JCSMPSessionXMLMessageConsumer.
NOTE: For a given JCSMPSession, this method returns a
new XMLMessageConsumer object on each call, closing the
existing consumer if it exists.
getMessageConsumer in interface JCSMPSessionlistener - Sets the message consumer's message listener. By setting a
message listener, the message consumer works in asynchronous
mode. Setting the message listener to
((XMLMessageListener)null) puts the message consumer in
synchronous delivery mode.JCSMPException - If acquiring the message consumer failed.JCSMPErrorResponseException - If the operation fails with an error response, see
JCSMPErrorResponseSubcodeEx for login failures.OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.JCSMPSession.getMessageConsumer(XMLMessageListener)@Deprecated public XMLMessageConsumer getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider) throws JCSMPException
getMessageConsumer in interface JCSMPSessionJCSMPException@Deprecated public XMLMessageConsumer getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider, XMLMessageListener listener) throws JCSMPException
JCSMPSessionXMLMessageConsumer with subscriptions
out-of-sync checking.
If the subscriptions on the appliance are not in sync with the
SubscriptionState returned from SubscriptionStateProvider,
SubscriptionsOutOfSynchException is raised.
NOTE: For a given JCSMPSession, this method
returns a new XMLMessageConsumer object on each call, closing the
existing consumer, if applicable.
getMessageConsumer in interface JCSMPSessionsubscriptionStateProvider - An implementation of SubscriptionStateProvider.listener - Sets the message consumer's message listener. By setting a
message listener, the message consumer works in asynchronous
mode. Setting the message listener to null puts the message
consumer in synchronous delivery mode.JCSMPException - If acquiring the message consumer
failed.OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.@Deprecated public XMLMessageConsumer getMessageConsumer(JCSMPReconnectEventHandler reconnectHandler) throws JCSMPException
getMessageConsumer in interface JCSMPSessionJCSMPExceptionpublic XMLMessageConsumer getMessageConsumer(JCSMPReconnectEventHandler reconnectHandler, XMLMessageListener listener) throws JCSMPException
JCSMPSessionXMLMessageConsumer with a reconnect event
handler.
If auto-reconnect is enabled through the subscriber data channel's
reconnectRetries in JCSMPChannelProperties, upon
detecting the loss of the connection,
JCSMPReconnectEventHandler.preReconnect() is called before JCSMP
attempts to reestablish the connection with the appliance. If the method
call returns the value false, the auto-reconnect process
aborts. If the method call returns the value true,
auto-reconnect process starts. When the connection is established
successfully, JCSMPReconnectEventHandler.postReconnect() is
called. To detect a permanent loss of a connection (when retries are
exhausted) the method
XMLMessageListener.onException(JCSMPException) will be called.
NOTE: For a given JCSMPSession, this method returns a
new XMLMessageConsumer object on each call, closing the
existing consumer if it exists.
getMessageConsumer in interface JCSMPSessionreconnectHandler - An implementation of JCSMPReconnectEventHandler. This
is strongly recommended when operating in client mode, since
topic subscriptions do not persist between connections on the
appliance.listener - Sets the message consumer's message listener. By setting a
message listener, the message consumer works in asynchronous
mode. Setting the message listener to null puts
the message consumer in synchronous delivery mode.JCSMPException - If acquiring the message consumer failed.JCSMPErrorResponseException - If the operation fails with an error response, see
JCSMPErrorResponseSubcodeEx for login failures.OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.@Deprecated public XMLMessageConsumer getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider, JCSMPReconnectEventHandler reconnectHandler) throws JCSMPException
getMessageConsumer in interface JCSMPSessionJCSMPException@Deprecated public XMLMessageConsumer getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider, JCSMPReconnectEventHandler reconnectHandler, XMLMessageListener listener) throws JCSMPException
JCSMPSessionXMLMessageConsumer with subscriptions
out-of-sync checking and reconnect event handler.
If the subscriptions on the appliance are not in sync with the
SubscriptionState returned from SubscriptionStateProvider,
SubscriptionsOutOfSynchException is raised.
If auto-reconnect is enabled through the subscriber data channel's
reconnectRetries in JCSMPChannelProperties, when
detecting the loss of the connection,
JCSMPReconnectEventHandler.preReconnect() is called before JCSMP
attempts to re-establish the connection with the appliance. If the method
call returns the value false, the auto-reconnect process aborts. If the
method call returns the value true, the auto-reconnect process starts.
When the connection is established successfully,
JCSMPReconnectEventHandler.postReconnect() is called.
NOTE: For a given JCSMPSession, this method
returns a new XMLMessageConsumer object on each call,
closing the existing consumer, if applicable.
getMessageConsumer in interface JCSMPSessionsubscriptionStateProvider - An implementation of SubscriptionStateProvider.listener - Sets the message consumer's message listener. By setting a
message listener, the message consumer works in asynchronous
mode. Setting the message listener to null puts the message
consumer in synchronous delivery mode.JCSMPException - If acquiring the message consumer failed.OperationNotSupportedException - If performed on a closed Session or a Session not configured
for this operation.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.
applySubscriptions in interface JCSMPSessionsubscriptions - 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 String getSessionID()
public TcpClientChannel getClientChannel()
public JCSMPProperties getJCSMPProperties()
public SecureProperties getSecureProperties()
public void addSubscription(Subscription subscription) throws JCSMPException
JCSMPSessionJCSMPSession.addSubscription(Subscription, boolean)addSubscription in interface JCSMPSessionsubscription - 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 JCSMPSessionsubscription - 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 Consumer addSubscription(Subscription subscription, XMLMessageListener listener, ConsumerNotificationDispatcherFactory dispatcherFactory) throws JCSMPException
JCSMPSessionaddSubscription in interface JCSMPSessionsubscription - 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 JCSMPSessionsubscription - 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 JCSMPSessionsubscription - 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.
addSubscription in interface JCSMPSessionendpoint - 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.removeSubscription in interface JCSMPSessionendpoint - 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 DestinationConsumer getMessageConsumer(DestinationListener listener) throws JCSMPException
JCSMPDestinationSessionDestinationConsumer.
NOTE: For a given JCSMPDestinationSession, this method
returns a new DestinationConsumer object on each call, closing the
existing consumer if it exists.
getMessageConsumer in interface JCSMPDestinationSessionlistener - Sets the destination consumer's message listener. By setting a
message listener, the destination consumer works in asynchronous
mode. Setting the message listener to null puts the message
consumer in synchronous delivery mode.JCSMPException - if acquiring the destination consumer failed.OperationNotSupportedException - if performed on a closed session or a session not configured
for this operation.public DestinationConsumer getMessageConsumer(JCSMPReconnectEventHandler reconnectHandler, DestinationListener listener) throws JCSMPException
JCSMPDestinationSessionDestinationConsumer with a reconnect event
handler.
If auto-reconnect is enabled through the subscriber data channel's
reconnectRetries in JCSMPChannelProperties, when connection loss
is detected,
JCSMPReconnectEventHandler.preReconnect() is called before JCSMP
attempts to re-establish the connection with the appliance. If the method
call returns the value false, the auto-reconnect process
aborts. If the method call returns the value true,
the auto-reconnect process starts. When the connection is established
successfully, JCSMPReconnectEventHandler.postReconnect() is
called.
NOTE: For a given JCSMPDestinationSession, this method
returns a new DestinationConsumer object on each call, closing the
existing consumer (if it exists).
getMessageConsumer in interface JCSMPDestinationSessionreconnectHandler - an instance of a JCSMPReconnectEventHandlerlistener - Sets the destination consumer's message listener. By setting a
message listener, the destination consumer works in asynchronous
mode. Setting the message listener to null puts the message
consumer in synchronous delivery mode.JCSMPException - if acquiring the destination consumer failed.OperationNotSupportedException - if performed on a closed session, or a session not configured
for this operation.public DestinationConsumer getMessageConsumer(DestinationSubscriptionStateProvider destinationSubscriptionStateProvider, DestinationListener listener) throws JCSMPException
JCSMPDestinationSessionDestinationConsumer with subscriptions
out-of-sync checking.
If the destination subscriptions on the appliance are not in sync with the
DestinationSubscriptionState returned from DestinationSubscriptionStateProvider,
SubscriptionsOutOfSynchException is raised.
NOTE: For a given JCSMPDestinationSession, this method
returns a new DestinationConsumer object on each call, closing the
existing consumer if it exists.
getMessageConsumer in interface JCSMPDestinationSessiondestinationSubscriptionStateProvider - An implementation of DestinationSubscriptionStateProvider.listener - Sets the destination consumer's message listener. By setting a
message listener, the destination consumer works in asynchronous
mode. Setting the message listener to null puts the message
consumer in synchronous delivery mode.JCSMPException - if acquiring the destination consumer
failed.OperationNotSupportedException - if performed on a closed session, or a session not configured
for this operation.public DestinationConsumer getMessageConsumer(DestinationSubscriptionStateProvider destinationSubscriptionStateProvider, JCSMPReconnectEventHandler reconnectHandler, DestinationListener listener) throws JCSMPException
JCSMPDestinationSessionDestinationConsumer with subscriptions out-of-sync
checking and reconnect event handler.
If the destination subscriptions on the appliance are not in sync with the
DestinationSubscriptionState returned from DestinationSubscriptionStateProvider,
SubscriptionsOutOfSynchException is raised.
If auto-reconnect is enabled through the subscriber data channel's reconnectRetries in
JCSMPChannelProperties, when detecting the loss of the connection,
JCSMPReconnectEventHandler.preReconnect() is called before JCSMP
attempts to re-establish the connection with the appliance. If the method call
returns the value false, the auto-reconnect process aborts. If the method call
returns the value true, the auto-reconnect process starts. When the connection is
established successfully, JCSMPReconnectEventHandler.postReconnect()
is called.
NOTE: For a given JCSMPDestinationSession, this method
returns a new DestinationConsumer object on each call, closing the
existing consumer (if it exists).
getMessageConsumer in interface JCSMPDestinationSessiondestinationSubscriptionStateProvider - An implementation of DestinationSubscriptionStateProvider.listener - Sets the destination consumer's message listener. By setting a
message listener, the destination consumer works in asynchronous
mode. Setting the message listener to null puts the message
consumer in synchronous delivery mode.JCSMPException - if acquiring the destination consumer failed.OperationNotSupportedException - if performed on a closed session, or a session not configured
for this operation.public void unsubscribeDurableTopicEndpoint(DurableTopicEndpoint endpoint) throws JCSMPException
JCSMPSessionThis method is only valid if the Session is operating in non-client mode.
unsubscribeDurableTopicEndpoint in interface JCSMPSessionendpoint - The durable Topic Endpoint on the appliance to unsubscribe from.JCSMPErrorResponseException - If the unsubscribe command is rejected. With detailed error
information on error responses from the appliance. Error
response subcodes:
JCSMPException - On any other error.public FlowReceiver createFlow(Endpoint endpoint, Subscription newSubscription, XMLMessageListener listener) throws JCSMPException
JCSMPSessionFlowReceiver bound to a appliance Endpoint, such
as a Queue or TopicEndpoint. Each time this method is
called, it returns a new FlowReceiver object.
createFlow in interface JCSMPSessionendpoint - The appliance Endpoint to bind to.newSubscription - If binding to a TopicEndpoint the Topic
to set/replace as a topic subscription on the endpoint.
This must be specified for a TopicEndpoint, null otherwise.listener - (optional) A callback listener to be used for asynchronous
notification. If null, synchronous notification
is used.FlowReceiver instance.OperationNotSupportedException - If the Session configuration does not allow the operation.JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
JCSMPErrorResponseSubcodeEx.CANNOT_BIND_TO_QUEUEJCSMPErrorResponseSubcodeEx.ENDPOINT_ALREADY_EXISTSJCSMPErrorResponseSubcodeEx.PERMISSION_NOT_ALLOWEDJCSMPErrorResponseSubcodeEx.MAX_CLIENTS_FOR_QUEUEJCSMPErrorResponseSubcodeEx.MAX_CLIENTS_FOR_TEJCSMPErrorResponseSubcodeEx.UNKNOWN_QUEUE_NAMEJCSMPErrorResponseSubcodeEx.UNKNOWN_TE_NAMEJCSMPErrorResponseSubcodeEx.QUEUE_SHUTDOWNJCSMPErrorResponseSubcodeEx.TE_SHUTDOWNJCSMPErrorResponseSubcodeEx.NO_MORE_NON_DURABLE_QUEUE_OR_TEJCSMPErrorResponseSubcodeEx.INVALID_TOPIC_NAME_FOR_TEInvalidOperationException - If the peer capabilities do not support features requested in
this operation.JCSMPException - Other error cases.public FlowReceiver createFlow(XMLMessageListener listener, ConsumerFlowProperties flowProperties) throws JCSMPException
JCSMPSessionFlowReceiver bound to an appliance Endpoint, such
as a Queue or TopicEndpoint. This method returns a new
FlowReceiver object each time it is called.
Note: If the flow's message acknowledge mode is
JCSMPProperties.SUPPORTED_MESSAGE_ACK_AUTO (the default behaviour),
then the call to this method is ignored and a warning log is generated.
createFlow in interface JCSMPSessionlistener - (optional) A callback listener to be used for asynchronous
notification. If null, synchronous notification
is used.flowProperties - Consumer flow properties, like Guaranteed message window size, Endpoint to
bind to, and so on.FlowReceiver instance.OperationNotSupportedException - If the Session configuration does not allow the operation.JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
JCSMPErrorResponseSubcodeEx.CANNOT_BIND_TO_QUEUEJCSMPErrorResponseSubcodeEx.ENDPOINT_ALREADY_EXISTSJCSMPErrorResponseSubcodeEx.PERMISSION_NOT_ALLOWEDJCSMPErrorResponseSubcodeEx.MAX_CLIENTS_FOR_QUEUEJCSMPErrorResponseSubcodeEx.MAX_CLIENTS_FOR_TEJCSMPErrorResponseSubcodeEx.UNKNOWN_QUEUE_NAMEJCSMPErrorResponseSubcodeEx.UNKNOWN_TE_NAMEJCSMPErrorResponseSubcodeEx.QUEUE_SHUTDOWN JCSMPErrorResponseSubcodeEx.TE_SHUTDOWN JCSMPErrorResponseSubcodeEx.NO_MORE_NON_DURABLE_QUEUE_OR_TEJCSMPErrorResponseSubcodeEx.INVALID_TOPIC_NAME_FOR_TEJCSMPErrorResponseSubcodeEx.SUBSCRIPTION_MATCH_ERRORJCSMPErrorResponseSubcodeEx.SELECTOR_MATCH_ERRORJCSMPErrorResponseSubcodeEx.SELECTOR_INVALIDInvalidOperationException - If the peer capabilities do not support features requested in
this operation.JCSMPException - Other error cases.public FlowReceiver createFlow(XMLMessageListener listener, ConsumerFlowProperties flowProperties, EndpointProperties endpointProps) throws JCSMPException
JCSMPSessionFlowReceiver bound to an appliance Endpoint, such
as a Queue or TopicEndpoint. This method returns a new
FlowReceiver object each time it is called.
createFlow in interface JCSMPSessionlistener - (optional) A callback listener to be used for asynchronous
notification. If null, synchronous notification
is used.flowProperties - Consumer flow properties, like Guaranteed message window size, Endpoint to
bind to, and so on.endpointProps - (optional) Endpoint properties for the created temporary
Endpoint (when binding to a temporary / non-durable Endpoint).
If null, default Endpoint properties are applied
by the appliance.FlowReceiver instance.OperationNotSupportedException - If the Session configuration does not allow the operation.JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
JCSMPErrorResponseSubcodeEx.CANNOT_BIND_TO_QUEUEJCSMPErrorResponseSubcodeEx.ENDPOINT_ALREADY_EXISTSJCSMPErrorResponseSubcodeEx.PERMISSION_NOT_ALLOWEDJCSMPErrorResponseSubcodeEx.MAX_CLIENTS_FOR_QUEUEJCSMPErrorResponseSubcodeEx.MAX_CLIENTS_FOR_TEJCSMPErrorResponseSubcodeEx.UNKNOWN_QUEUE_NAMEJCSMPErrorResponseSubcodeEx.UNKNOWN_TE_NAMEJCSMPErrorResponseSubcodeEx.QUEUE_SHUTDOWN JCSMPErrorResponseSubcodeEx.TE_SHUTDOWN JCSMPErrorResponseSubcodeEx.NO_MORE_NON_DURABLE_QUEUE_OR_TEJCSMPErrorResponseSubcodeEx.INVALID_TOPIC_NAME_FOR_TEInvalidOperationException - If the peer capabilities do not support features requested in
this operation.JCSMPException - Other error cases.public FlowReceiver createFlow(XMLMessageListener listener, ConsumerFlowProperties flowProperties, EndpointProperties endpointProps, FlowEventHandler flowEventHandler) throws JCSMPException
JCSMPSessionFlowReceiver bound to an appliance Endpoint, such
as a Queue or TopicEndpoint. This method returns a new
FlowReceiver object each time it is called.
createFlow in interface JCSMPSessionlistener - (optional) A callback listener to be used for asynchronous
notification. If null, synchronous notification
is used.flowProperties - Consumer flow properties, like Guaranteed message window size, Endpoint to
bind to, and so on.endpointProps - (optional) Endpoint properties for the created temporary
Endpoint (when binding to a temporary / non-durable Endpoint).
If null, default Endpoint properties are applied
by the appliance.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).FlowReceiver instance.OperationNotSupportedException - If the Session configuration does not allow the operation.JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
JCSMPErrorResponseSubcodeEx.CANNOT_BIND_TO_QUEUEJCSMPErrorResponseSubcodeEx.ENDPOINT_ALREADY_EXISTSJCSMPErrorResponseSubcodeEx.PERMISSION_NOT_ALLOWEDJCSMPErrorResponseSubcodeEx.MAX_CLIENTS_FOR_QUEUEJCSMPErrorResponseSubcodeEx.MAX_CLIENTS_FOR_TEJCSMPErrorResponseSubcodeEx.UNKNOWN_QUEUE_NAMEJCSMPErrorResponseSubcodeEx.UNKNOWN_TE_NAMEJCSMPErrorResponseSubcodeEx.QUEUE_SHUTDOWNJCSMPErrorResponseSubcodeEx.TE_SHUTDOWNJCSMPErrorResponseSubcodeEx.NO_MORE_NON_DURABLE_QUEUE_OR_TEJCSMPErrorResponseSubcodeEx.INVALID_TOPIC_NAME_FOR_TEInvalidOperationException - If the peer capabilities do not support features requested in
this operation.InvalidPropertiesException - If active flow indication is set to true in the
consumer properties, but flow event handler parameter is set
to null.JCSMPException - Other error cases.public FlowReceiver createFlow(XMLMessageListener listener, ConsumerFlowProperties flowProperties, EndpointProperties endpointProps, JCSMPBasicSession.InternalBindProperties int_bind_prop) throws JCSMPException
JCSMPExceptionpublic FlowReceiver createFlow(XMLMessageListener listener, ConsumerFlowProperties flowProperties, EndpointProperties endpointProps, JCSMPBasicSession.InternalBindProperties int_bind_prop, FlowEventHandler flowEventHandler) throws JCSMPException
JCSMPExceptionpublic DestinationProducer getMessageProducer(JCSMPStreamingPublishEventHandler callback, Destination defaultTopic) throws JCSMPException
JCSMPDestinationSessionDestinationProducer.
NOTE: For a given JCSMPDestinationSession, this method
returns a new DestinationProducer object on each call,
closing the existing producer (if it exists).
getMessageProducer in interface JCSMPDestinationSessioncallback - Callback handler to set. By setting a streaming callback handler, any
send returns immediately without confirming the
successful delivery of the message. Applications receive the
response of the send asynchronously through the
callback. Setting this to null puts the
producer in blocking mode.defaultTopic - the default Destination. If null, the default Destination is left unset.JCSMPException - if acquiring the destination producer failed.OperationNotSupportedException - if performed on a closed session, or a session not configured
for this operation.JCSMPSession.getMessageProducer(JCSMPStreamingPublishEventHandler)public JndiMessage executeJndiQuery(JndiMessage request) throws JCSMPException
JCSMPSessionexecuteJndiQuery in interface JCSMPSessionrequest - The JNDI request to execute.JndiMessage object containing the response.JCSMPException - on errorpublic 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.
setProperty in interface JCSMPSessionproperty - 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 Object getProperty(String property)
JCSMPSessiongetProperty in interface JCSMPSessionproperty - The requested property name.null if it does not exist.public String getP2pTopicDescriptionBase()
public void setP2pTopicDescriptionBase(String p2pTopicDescriptionBase)
public JCSMPXMLMessageProducer getProducer()
public JCSMPXMLMessageConsumer getConsumer()
public CacheSession createCacheSession(CacheSessionProperties properties) throws JCSMPException
JCSMPSessioncreateCacheSession in interface JCSMPSessionproperties - Properties for the CacheSession.JCSMPException - on errorpublic Requestor createRequestor() throws JCSMPException
JCSMPSessionRequestor for this Session. Applications are
responsible for having previously created an
XMLMessageProducer and XMLMessageConsumer on
this Session. The XMLMessageConsumer must be started before
performing a request.createRequestor in interface JCSMPSessionRequestor instance.JCSMPException - on errorpublic boolean hasSessionEventHandler()
public void handleSessionEvent(SessionEventArgs event)
public Queue createTemporaryQueue() throws JCSMPException
JCSMPSession
This operation requires that the Session be previously connected to the appliance, as appliance capabilities must be populated to
create non-durable entities.
createTemporaryQueue in interface JCSMPSessionJCSMPException - on errorpublic Queue createTemporaryQueue(String name) throws JCSMPException
JCSMPSessionconnected to the appliance, as appliance capabilities must be populated to
create non-durable entities.createTemporaryQueue in interface JCSMPSessionname - The name of the temporary Queue.JCSMPException - on errorpublic Topic createTemporaryTopic() throws JCSMPException
JCSMPSessionconnected to the appliance, as appliance capabilities must be populated to
create non-durable entities.
The temporary Topic's physical name is fully generated by JCSMP to provide uniqueness.createTemporaryTopic in interface JCSMPSessionJCSMPException - on errorpublic TopicEndpoint createNonDurableTopicEndpoint() throws JCSMPException
JCSMPSessionconnected to the appliance, as appliance capabilities must be populated to
create non-durable entities.createNonDurableTopicEndpoint in interface JCSMPSessionJCSMPException - on errorpublic TopicEndpoint createNonDurableTopicEndpoint(String name) throws JCSMPException
JCSMPSessionconnected to the appliance, as appliance capabilities must be populated to
create non-durable entities.createNonDurableTopicEndpoint in interface JCSMPSessionname - The name of the non-durable Topic Endpoint.JCSMPException - on errorpublic Object getCapability(CapabilityType type) throws JCSMPException
JCSMPSession
The returned value is an object of the type specified in
CapabilityType.
This operation requires that the Session be previously connected to the appliance. If the Session is not connected,
requesting a capability will throw InvalidOperationException.
Otherwise, the last known value reported is returned.
getCapability in interface JCSMPSessionJCSMPExceptionpublic boolean isCapable(CapabilityType ctype)
JCSMPSessionIllegalArgumentException if the
provided key does not allow conversion of the value to
boolean.
If the Session has never been connected, requesting a capability
returns false. Otherwise, the last known value is returned.
isCapable in interface JCSMPSessionctype - The capability to check.public void connect()
throws JCSMPException
JCSMPSessionJCSMPSession can be connected as a side effect of
requesting a producer or consumer, as best practice it is recommended to
always explicitly connect before.
After connect() returns, the Session is connected to the
appliance. At this point, the appliance's information and capabilities are
populated, and can be queried by JCSMPSession.getCapability(CapabilityType).
Some Session operations require the Session to be connected before
attempting them, such as:
connect in interface JCSMPSessionJCSMPTransportException - If a connection exception occurs.JCSMPException - On other failures.public void reestablishSubCache()
throws JCSMPException
JCSMPExceptionpublic void notifySubscriptionEvent(SessionSubscriptionEvent ev)
notifySubscriptionEvent in interface SessionSubscriptionEventListenerpublic ClientInfoProvider getClientInfoProvider()
public void setJmsClientId(String clientId, boolean allowSharedClientId) throws JCSMPException
setJmsClientId in interface JCSMPSessionJCSMPExceptionpublic Set<Subscription> getSubscriptionCache()
JCSMPSessionJCSMPProperties.REAPPLY_SUBSCRIPTIONS is
disabled.getSubscriptionCache in interface JCSMPSessionpublic String getVirtualRouterName()
public void deprovision(Endpoint endpoint, long deprovisionFlags) throws JCSMPException
JCSMPSessionAllowed flags for the deprovisioning operation include:
deprovision in interface JCSMPSessionendpoint - The Endpoint to deprovision.deprovisionFlags - Deprovisioning flags.JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
JCSMPException - on errorpublic void provision(Endpoint endpoint, EndpointProperties props, long provisionFlags) throws JCSMPException
JCSMPSessionAllowed flags for the provisioning operation include:
provision in interface JCSMPSessionendpoint - Endpoint to provision.props - Properties for the provisioned Endpoint.provisionFlags - Provisioning flags.JCSMPErrorResponseException - With detailed error information on error responses from the
appliance. Error response subcodes:
JCSMPException - on errorpublic Browser createBrowser(BrowserProperties properties) throws JCSMPException
JCSMPSessionBrowser, which can be used for browsing the contents of a Queue.createBrowser in interface JCSMPSessionproperties - 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 Browser createBrowser(BrowserProperties properties, FlowEventHandler flowEventHandler) throws JCSMPException
JCSMPSessionBrowser, which can be used for browsing the contents of a Queue.createBrowser in interface JCSMPSessionproperties - 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 TransactedSession createTransactedSession() throws JCSMPException
JCSMPSessionTransactedSession with the connected appliance. This
call blocks until the TransactedSession is successfully
created.createTransactedSession in interface JCSMPSessionTransactedSession.JCSMPException - on errorpublic TransactedSession createTransactedSessionInternal() throws JCSMPException
JCSMPExceptionpublic XASession createXASession() throws JCSMPException
JCSMPSessionXASession with the connected appliance. This
call blocks until the XASession is successfully
created.createXASession in interface JCSMPSessionJCSMPException - on errorpublic void waitUntilSessionReconnectDone(String caller) throws JCSMPException
JCSMPExceptionpublic void reconnectInProgress(boolean status)
public boolean reconnectInProgress()
public AssuredCtrlFactory getAssuredCtrlFactory()
public void addSubscription(Subscription subscription, JCSMPResponseListener listener, Object key) throws JCSMPException
JCSMPSessionaddSubscription in interface JCSMPSessionsubscription - The subscription to add.listener - 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 listener, 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.
addSubscription in interface JCSMPSessionendpoint - The Endpoint to add the subscription on.subscription - The subscription to add.listener - 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 listener, Object key) throws JCSMPException
JCSMPSessionremoveSubscription in interface JCSMPSessionsubscription - The subscription to remove.listener - 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 listener, Object key) throws JCSMPException
JCSMPSessionremoveSubscription in interface JCSMPSessionendpoint - The Endpoint to remove the subscription from.subscription - The subscription to remove.listener - 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.