public interface Session
Session
represents the main application interface.
+---------------------------------------+
| JCSMP |
+---------------------------------------+
| CSMP |
+---------------------------------------+
| SMF |
+---------------------------------------+
| TCP/IP |
+---------------------------------------+
(SMF stands for Solace Message Format.)
Session
provides these major functions:
A client application uses JCSMPFactory
to acquire a
JCSMPSession
instance by providing JCSMPProperties
.
Note: All methods defined in Session
are thread-safe.
XMLMessage
for more details.
Persistent
and
Non-Persistent
messages can only be
published over the
JCSMPChannelProperties.SUPPORTED_PROTOCOL_STACK_SMF_TCP
protocol
stack.
Direct
messages are never spooled to disk on the appliance, and they can be delivered out of
order.
Direct
messages can be published over the
JCSMPChannelProperties.SUPPORTED_PROTOCOL_STACK_SMF_TCP
protocol
stack.
Session
supports two message acknowledgement modes:
AUTO_ACK and CLIENT_ACK. With AUTO_ACK mode, when delivering each message to
the application, the session acknowledges the message to the appliance
automatically. With CLIENT_ACK, it is the application's responsibility to
acknowledge by calling
XMLMessage.ackMessage()
. It is also the
application's responsibility to have a policy in place to enforce in-time
acknowledgement of all messages to avoid repeated delivery of Persistent
and Non-Persistent messages.
JCSMPException
for details.
Modifier and Type | Method and Description |
---|---|
void |
addSubscriber()
Deprecated.
It is no longer necessary to call this function. This
function might be removed in a future version of JCSMP.
|
void |
clearSubscriber()
Deprecated.
This method is no longer supported. The recommended way to
delete subscriptions from the appliance is to perform an
applySubscriptions() on the session with an
empty subscription list. |
void |
closeSession()
Closes the session.
|
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.
|
void |
logSessionStats(JCSMPLogLevel level)
Outputs a log at the specified log level containing a textual
representation of the session statistics.
|
void |
removeSubscriber()
Deprecated.
Subscribers are now created and removed only through the
appliance's management interface. This method has the same
effect as
Session.clearSubscriber() |
String getSessionName()
JCSMPProperties.SESSION_NAME
, this method
returns the name specified. Otherwise, a default name is returned.void closeSession()
Any XMLMessageProducer
, XMLMessageConsumer
, and channel
connections associated with the session are also closed.
JCSMPSessionStats getSessionStats()
void logSessionStats(JCSMPLogLevel level)
level
- The level (corresponding to
org.apache.commons.logging
levels) at which to
output the log.void clearSubscriber() throws JCSMPException
applySubscriptions()
on the session with an
empty subscription list.Note 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.void addSubscriber() throws JCSMPException
Session
.
If the user already exists on the appliance, this method still returns success.
JCSMPException
- If there was an error adding the subscriber.void removeSubscriber() throws JCSMPException
Session.clearSubscriber()
Session
.JCSMPException
- If there was an error removing the
subscriber.Copyright 2004-2024 Solace Corporation. All rights reserved.