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 a topic on cache if topic exists, otherwise throws exception.
|
TopicSubscription |
createSubscription(MessageReceivedListener messageReceivedEventListener,
DeliveryMode deliveryMode) |
This method is used to subscribe against a topic on cache if topic exists, otherwise throws exception.
|
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 the user has subscribed to pattern based or the simple subscription.
|
void |
publish(Message message,
DeliveryOption deliverOption) |
This method is used to publish the message in the cache with the specified DeliveryOption.
|
void |
publish(Message message,
DeliveryOption deliverOption,
boolean notifyDeliveryFailure) |
This method is used to publish the message in the cache with the specified DeliveryOption.
|
void |
publish(Message message,
DeliveryOption deliverOption,
java.lang.String sequenceName) |
This method is used to publish the message in the cache with the specified DeliveryOption.
|
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.
|
java.util.concurrent.FutureTask |
publishAsync(Message message,
DeliveryOption deliverOption) |
This method is used to publish a message asynchronously in the cache with the specified DeliveryOption and the option to notify the publisher if the message has failed to deliver because of expiration, eviction or internal system issue.
|
java.util.concurrent.FutureTask |
publishAsync(Message message,
DeliveryOption deliverOption,
boolean notifyDeliveryFailure) |
This method is used to publish a message asynchronously in the cache with the specified DeliveryOption and the option to notify the publisher if the message has failed to deliver because of expiration, eviction or internal system issue.
|
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 the 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 the 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 Message is delivered through this listener.java.lang.Exception
TopicSubscription createSubscription(MessageReceivedListener messageReceivedEventListener, DeliveryMode deliveryMode) throws java.lang.Exception
messageReceivedEventListener
- The Message is delivered through this listener.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
- Subscription policy whether Shared or Exclusive.subscriptionPolicy
- Policy that is subscription is Shared or Exclusive.messageReceivedListener
- Message is delivered through this listener.expirationTime
- A timespan that determines 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 if 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 if 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 - delivery option 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 - delivery option 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