public abstract class SessionModeSupport extends Object implements JCSMPSession, SessionSubscriptionEventListener
FLAG_IGNORE_ALREADY_EXISTS, FLAG_IGNORE_DOES_NOT_EXIST, WAIT_FOR_CONFIRM| Modifier and Type | Method and Description |
|---|---|
abstract void |
addSubscription(Subscription subscription)
Adds a subscription to the appliance.
|
abstract void |
addSubscription(Subscription subscription,
boolean waitForConfirm)
Adds a subscription to an appliance.
|
abstract void |
addSubscription(Subscription subscription,
boolean waitForConfirm,
boolean notifySubCache) |
abstract Consumer |
addSubscription(Subscription subscription,
XMLMessageListener listener,
ConsumerNotificationDispatcherFactory dispatcherFactory)
[SolReserved]
For Topic Dispatching.
|
abstract void |
closeControlChannel() |
void |
closeSession()
Closes the session.
|
void |
connect()
Connect to the appliance.
|
FlowReceiver |
createFlow(BrowserProperties b_prop) |
FlowReceiver |
createFlow(BrowserProperties b_prop,
FlowEventHandler flowEventHandler,
BrowserImpl browser) |
FlowReceiver |
createFlow(Endpoint endpoint,
Subscription newSubscription,
XMLMessageListener listener)
|
FlowReceiver |
createFlow(XMLMessageListener listener,
ConsumerFlowProperties f_prop)
|
FlowReceiver |
createFlow(XMLMessageListener listener,
ConsumerFlowProperties f_prop,
EndpointProperties e_prop)
|
FlowReceiver |
createFlow(XMLMessageListener listener,
ConsumerFlowProperties f_prop,
EndpointProperties e_prop,
FlowEventHandler flowEventHandler)
|
FlowReceiver |
createFlow(XMLMessageListener listener,
ConsumerFlowProperties f_prop,
EndpointProperties e_prop,
JCSMPBasicSession.InternalBindProperties internalBindProp,
FlowEventHandler flowEventHandler) |
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.
|
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.
|
void |
deprovision(Endpoint endpoint,
long deprovisionFlags)
Deprovisions an Endpoint on the appliance.
|
Object |
getCapability(CapabilityType type)
Gets the value of a capability for the currently connected Session.
|
JCSMPXMLMessageConsumer |
getConsumer() |
String |
getHostId() |
XMLMessageConsumer |
getMessageConsumer() |
XMLMessageConsumer |
getMessageConsumer(JCSMPReconnectEventHandler reconnectHandler) |
XMLMessageConsumer |
getMessageConsumer(JCSMPReconnectEventHandler reconnectHandler,
XMLMessageListener listener)
Get an instance of
XMLMessageConsumer with a reconnect event
handler. |
XMLMessageConsumer |
getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider) |
XMLMessageConsumer |
getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider,
JCSMPReconnectEventHandler reconnectHandler) |
XMLMessageConsumer |
getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider,
JCSMPReconnectEventHandler reconnectHandler,
XMLMessageListener listener)
Get an instance of
XMLMessageConsumer with subscriptions
out-of-sync checking and reconnect event handler. |
XMLMessageConsumer |
getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider,
XMLMessageListener listener)
Get an instance of
XMLMessageConsumer with subscriptions
out-of-sync checking. |
XMLMessageConsumer |
getMessageConsumer(XMLMessageListener listener)
Get an instance of
XMLMessageConsumer. |
XMLMessageProducer |
getMessageProducer() |
JCSMPXMLMessageProducer |
getProducer() |
Object |
getProperty(String property)
Gets a Session property.
|
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.
|
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.
|
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 |
notifySubscriptionEvent(SessionSubscriptionEvent ev) |
abstract WireMessage |
performDeleteEndpointCommad(WireMessage del_ep_command) |
abstract WireMessage |
performProvisionEndpointCommand(WireMessage prov_ep_command) |
void |
provision(Endpoint endpoint,
EndpointProperties props,
long provisionFlags)
Provisions an Endpoint on the appliance.
|
abstract void |
reestablishSubCache() |
void |
removeSubscriber()
Removes a subscriber from the appliance using the user information
associated with the
Session. |
abstract void |
removeSubscription(Subscription subscription)
Removes a subscription from the appliance.
|
abstract void |
removeSubscription(Subscription subscription,
boolean waitForConfirm)
Removes a subscription from the appliance.
|
void |
unsubscribeDurableTopicEndpoint(DurableTopicEndpoint endpoint)
Unsubscribe from the durable Topic Endpoint.
|
abstract void |
validateBindTopicOrQueue(AbstractDestination dest) |
abstract void |
validateSubscriberEndpointValidEndpoint() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddSubscription, applySubscriptions, createBrowser, createBrowser, createCacheSession, createTransactedSession, createXASession, executeJndiQuery, getMessageProducer, getMessageProducer, removeSubscription, setJmsClientId, setPropertyaddSubscriber, clearSubscriber, deleteSubscriberpublic JCSMPXMLMessageProducer getProducer()
public JCSMPXMLMessageConsumer getConsumer()
public void closeSession()
Session
Any XMLMessageProducer, XMLMessageConsumer, and channel
connections associated with the session are also closed.
closeSession in interface Sessionpublic abstract 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 abstract 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 abstract void addSubscription(Subscription subscription, boolean waitForConfirm, boolean notifySubCache) throws JCSMPException
JCSMPExceptionpublic abstract 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 abstract 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 abstract 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 abstract void closeControlChannel()
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 f_prop) 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.f_prop - 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 f_prop, EndpointProperties e_prop) 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.f_prop - Consumer flow properties, like Guaranteed message window size, Endpoint to
bind to, and so on.e_prop - (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 f_prop, EndpointProperties e_prop, 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.f_prop - Consumer flow properties, like Guaranteed message window size, Endpoint to
bind to, and so on.e_prop - (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 f_prop, EndpointProperties e_prop, JCSMPBasicSession.InternalBindProperties internalBindProp, FlowEventHandler flowEventHandler) throws JCSMPException
JCSMPExceptionpublic FlowReceiver createFlow(BrowserProperties b_prop) throws JCSMPException
JCSMPExceptionpublic FlowReceiver createFlow(BrowserProperties b_prop, FlowEventHandler flowEventHandler, BrowserImpl browser) throws JCSMPException
JCSMPExceptionpublic abstract void validateSubscriberEndpointValidEndpoint()
throws JCSMPException
JCSMPExceptionpublic abstract void validateBindTopicOrQueue(AbstractDestination dest) throws JCSMPException
JCSMPExceptionpublic 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.public XMLMessageConsumer getMessageConsumer() 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.public XMLMessageConsumer getMessageConsumer(JCSMPReconnectEventHandler reconnectHandler) throws JCSMPException
getMessageConsumer in interface JCSMPSessionJCSMPExceptionpublic 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.public XMLMessageConsumer getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider) throws JCSMPException
getMessageConsumer in interface JCSMPSessionJCSMPExceptionpublic 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 XMLMessageConsumer getMessageConsumer(SubscriptionStateProvider subscriptionStateProvider, JCSMPReconnectEventHandler reconnectHandler) throws JCSMPException
getMessageConsumer in interface JCSMPSessionJCSMPExceptionpublic 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 getMessageProducer() throws JCSMPException
getMessageProducer in interface JCSMPSessionJCSMPExceptionpublic String getSessionName()
SessionJCSMPProperties.SESSION_NAME, this method
returns the name specified. Otherwise, a default name is returned.getSessionName in interface Sessionpublic JCSMPSessionStats getSessionStats()
SessiongetSessionStats in interface Sessionpublic 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.public boolean isClosed()
Sessionpublic void removeSubscriber()
throws JCSMPException
SessionSession.removeSubscriber in interface SessionJCSMPException - If there was an error removing the
subscriber.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 Object getProperty(String property)
JCSMPSessiongetProperty in interface JCSMPSessionproperty - The requested property name.null if it does not exist.public 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 Object getCapability(CapabilityType type)
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 JCSMPSessionpublic 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 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(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 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 void notifySubscriptionEvent(SessionSubscriptionEvent ev)
notifySubscriptionEvent in interface SessionSubscriptionEventListenerpublic abstract void reestablishSubCache()
throws JCSMPException
JCSMPExceptionpublic Set<Subscription> getSubscriptionCache()
JCSMPSessionJCSMPProperties.REAPPLY_SUBSCRIPTIONS is
disabled.getSubscriptionCache in interface JCSMPSessionpublic abstract WireMessage performProvisionEndpointCommand(WireMessage prov_ep_command) throws JCSMPException
JCSMPExceptionpublic abstract WireMessage performDeleteEndpointCommad(WireMessage del_ep_command) throws JCSMPException
JCSMPExceptionpublic 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 String getHostId()
Copyright 2004-2020 Solace Corporation. All rights reserved.