java.lang.AutoCloseable
public interface Topic
extends java.lang.AutoCloseable
Modifier and Type | Method | Description |
---|---|---|
void |
addMessageDeliveryFailureListener(TopicListener messageFailedEventListener) |
This method registers for message delivery failure events on this topic.
|
void |
addTopicDeletedListener(TopicListener deleteEventListener) |
This method registers for topic deleted event.
|
DurableTopicSubscription |
createDurableSubscription(java.lang.String subscriptionName,
SubscriptionPolicy subscriptionPolicy,
MessageReceivedListener messageReceivedListener,
TimeSpan expirationTime) |
This method is used to create a durable subscription to this topic.
|
DurableTopicSubscription |
createDurableSubscription(java.lang.String subscriptionName,
SubscriptionPolicy subscriptionPolicy,
MessageReceivedListener messageReceivedListener,
TimeSpan expirationTime,
DeliveryMode deliveryMode) |
This method is used to create a durable subscription to this topic.
|
TopicSubscription |
createSubscription(MessageReceivedListener messageReceivedEventListener) |
This method is used to subscribe against topic on cache if topic exists.
|
TopicSubscription |
createSubscription(MessageReceivedListener messageReceivedEventListener,
DeliveryMode deliveryMode) |
This method is used to subscribe against topic on cache if topic exists.
|
TimeSpan |
getExpirationTime() |
Gets the expiry time of messsage for this topic.
|
boolean |
getIsClosed() |
Specifies whether topic is closed or not.
|
long |
getMessageCount() |
Gets the number of messages published for this topic.
|
java.lang.String |
getName() |
Gets the name of the Topic.
|
TopicPriority |
getPriority() |
The relative priority of the topic.
|
TopicSearchOptions |
getSearchOptions() |
Specifies whether user has subscribed to pattern based or simple subscription.
|
void |
publish(Message message,
DeliveryOption deliverOption) |
This method is used to publish the message to the topic with the specified DeliveryOption.
|
void |
publish(Message message,
DeliveryOption deliverOption,
boolean notifyDeliveryFailure) |
This method is used to publish the message to the topic with the specified DeliveryOption.
|
void |
publish(Message message,
DeliveryOption deliverOption,
java.lang.String sequenceName) |
This method is used to publish the message to the topic with the specified DeliveryOption and sequence name.Order of messages with same sequence name is retained.
|
void |
publish(Message message,
DeliveryOption deliverOption,
java.lang.String sequenceName,
boolean notifyDeliveryFailure) |
This method is used to publish the message to the topic with the specified DeliveryOption and sequence name.Order of messages with same sequence name is retained.
|
java.util.concurrent.FutureTask |
publishAsync(Message message,
DeliveryOption deliverOption) |
This method is used to Publish a message asynchronously to the topic with specified delivery option.
|
java.util.concurrent.FutureTask |
publishAsync(Message message,
DeliveryOption deliverOption,
boolean notifyDeliveryFailure) |
This method is used to Publish a message asynchronously to the topic with specified delivery option.
|
java.util.Map<Message,java.lang.Exception> |
publishBulk(java.util.Map<Message,DeliveryOption> messages) |
This method is used to Publish messages to the topic with specified DeliveryOption.
|
java.util.Map<Message,java.lang.Exception> |
publishBulk(java.util.Map<Message,DeliveryOption> messages,
boolean notifyDeliveryFailure) |
This method is used to Publish messages to the topic with specified DeliveryOption.
|
void |
removeMessageDeliveryFailureListener() |
This method unregisters for message delivery failure events on this topic.
|
void |
removeTopicDeletedListener() |
This method unregisters for topic deleted event.
|
void |
setExpirationTime(TimeSpan value) |
Sets the expiry time of messsage for this topic.
|
java.lang.String getName()
long getMessageCount() throws java.lang.Exception
java.lang.Exception
TopicPriority getPriority()
TimeSpan getExpirationTime()
void setExpirationTime(TimeSpan value)
value
- The expiry time of message for this topic.boolean getIsClosed()
TopicSearchOptions getSearchOptions()
TopicSubscription createSubscription(MessageReceivedListener messageReceivedEventListener) throws java.lang.Exception
messageReceivedEventListener
- The listener that is invoked whenever a message is published against the topic.java.lang.Exception
TopicSubscription createSubscription(MessageReceivedListener messageReceivedEventListener, DeliveryMode deliveryMode) throws java.lang.Exception
messageReceivedEventListener
- The listener that is invoked whenever a message is published against the topic.deliveryMode
- Specifies whether to deliver messages to register subscribers synchronously or asynchronously.java.lang.Exception
DurableTopicSubscription createDurableSubscription(java.lang.String subscriptionName, SubscriptionPolicy subscriptionPolicy, MessageReceivedListener messageReceivedListener, TimeSpan expirationTime, DeliveryMode deliveryMode) throws CacheException
subscriptionName
- Name of the durable subscription.subscriptionPolicy
- Policy that is subscription is Shared or Exclusive.messageReceivedListener
- Message is delivered to registered user through this listener.expirationTime
- A timespan that specifies the expiration time of the subscription.deliveryMode
- Specifies whether to deliver messages to register subscribers synchronously or asynchronously.DurableTopicSubscription
.CacheException
DurableTopicSubscription createDurableSubscription(java.lang.String subscriptionName, SubscriptionPolicy subscriptionPolicy, MessageReceivedListener messageReceivedListener, TimeSpan expirationTime) throws CacheException
subscriptionName
- Name of the durable subscription.subscriptionPolicy
- Policy that is subscription is Shared or Exclusive.messageReceivedListener
- Message is delivered to registered user through this listener.expirationTime
- A timespan that specifies the expiration time of the subscription.DurableTopicSubscription
.CacheException
void publish(Message message, DeliveryOption deliverOption) throws java.lang.Exception
message
- Message to be published.deliverOption
- Specifies how message is delivered to registered subscribers.java.lang.Exception
void publish(Message message, DeliveryOption deliverOption, boolean notifyDeliveryFailure) throws java.lang.Exception
message
- Message to be published.deliverOption
- Specifies how message is delivered to registered subscribers.notifyDeliveryFailure
- Specifies whether MessageDeliveryFailure event is required for this message.java.lang.Exception
void publish(Message message, DeliveryOption deliverOption, java.lang.String sequenceName) throws java.lang.Exception
message
- Message to be published.deliverOption
- Specifies how message is delivered to registered subscribers.sequenceName
- Sequence name of the message to be publsihed. The messages with same sequence name will be delivered in the same order as they are published.java.lang.Exception
void publish(Message message, DeliveryOption deliverOption, java.lang.String sequenceName, boolean notifyDeliveryFailure) throws java.lang.Exception
message
- Message to be published.deliverOption
- Specifies how message is delivered to registered subscribers.sequenceName
- Sequence name of the message to be publsihed. The messages with same sequence name will be delivered in the same order as they are published.notifyDeliveryFailure
- Specifies whether MessageDeliveryFailure event is required for this message.java.lang.Exception
java.util.concurrent.FutureTask publishAsync(Message message, DeliveryOption deliverOption) throws java.lang.Exception
message
- Message to be published.deliverOption
- Specifies how message is delivered to registered subscribers.FutureTask
can be used to determine status
of the task i.e. isDone(), isCancelled().java.lang.Exception
java.util.concurrent.FutureTask publishAsync(Message message, DeliveryOption deliverOption, boolean notifyDeliveryFailure) throws java.lang.Exception
message
- Message to be published.deliverOption
- Specifies how message is delivered to registered subscribers.notifyDeliveryFailure
- Specifies whether MessageDeliveryFailure event is required for this message.FutureTask
can be used to determine status
of the task i.e. isDone(), isCancelled().java.lang.Exception
java.util.Map<Message,java.lang.Exception> publishBulk(java.util.Map<Message,DeliveryOption> messages) throws CacheException
messages
- Collection of message-deliveryoption pairs in form of a Map.CacheException
java.util.Map<Message,java.lang.Exception> publishBulk(java.util.Map<Message,DeliveryOption> messages, boolean notifyDeliveryFailure) throws CacheException
messages
- Collection of message-deliveryoption pairs in form of a Map.notifyDeliveryFailure
- Specifies whether MessageDeliveryFailure event is required for this message.CacheException
void addTopicDeletedListener(TopicListener deleteEventListener)
deleteEventListener
- The listener that is invoked whenever this topic is deleted.void removeTopicDeletedListener()
void addMessageDeliveryFailureListener(TopicListener messageFailedEventListener) throws java.lang.Exception
messageFailedEventListener
- The listener that is invoked whenever there is failure in message delivery.java.lang.Exception
void removeMessageDeliveryFailureListener() throws java.lang.Exception
java.lang.Exception