本文整理汇总了Java中com.hivemq.spi.message.RetainedMessage类的典型用法代码示例。如果您正苦于以下问题:Java RetainedMessage类的具体用法?Java RetainedMessage怎么用?Java RetainedMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RetainedMessage类属于com.hivemq.spi.message包,在下文中一共展示了RetainedMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBrokerStart
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
@Override
public void onBrokerStart() throws BrokerUnableToStartException {
log.info("Start callback message: {}", systemMessage.getMessage());
//Sets a retained message on topic "testtopic" programatically by using HiveMQ's plugin services
retainedMessageStore.addOrReplace(new RetainedMessage("testtopic", "testpayload".getBytes(), QoS.AT_LEAST_ONCE));
}
示例2: execute
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
@Override
public void execute() {
/*
* Careful: BlockingRetainedMessageStore.getRetainedMessages() returns all retained messages from all hivemq
* cluster nodes (may block for a very long time and the result may use a lot of memory)
*/
final Set<RetainedMessage> retainedMessages = retainedMessageStore.getRetainedMessages();
for (final RetainedMessage retainedMessage : retainedMessages) {
if (retainedMessage != null) {
retainedMessageStore.remove(retainedMessage.getTopic());
}
}
log.info("All retained messages have been cleared!");
}
示例3: getLocalRetainedMessages
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* @return a {@link com.google.common.util.concurrent.ListenableFuture} which contains all retained messages which are currently stored on this HiveMQ instance.
*/
ListenableFuture<Set<RetainedMessage>> getLocalRetainedMessages();
示例4: getRetainedMessages
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* @return a {@link com.google.common.util.concurrent.ListenableFuture} which contains all retained messages which are currently stored
*/
ListenableFuture<Set<RetainedMessage>> getRetainedMessages();
示例5: getRetainedMessage
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* @param topic a topic
* @return a {@link com.google.common.util.concurrent.ListenableFuture} which contains the retained message for the specific topic or <code>null</code>.
*/
ListenableFuture<RetainedMessage> getRetainedMessage(String topic);
示例6: addOrReplace
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* This method adds or replaces a retained message
*
* @param retainedMessage which should be added or replaced
* @return a {@link com.google.common.util.concurrent.ListenableFuture} which returns after adding or replacing
*/
ListenableFuture<Void> addOrReplace(RetainedMessage retainedMessage);
示例7: getRetainedMessages
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* @return all retained messages which are currently stored
*/
@Deprecated
Set<RetainedMessage> getRetainedMessages();
示例8: getRetainedMessage
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* @param topic a topic
* @return retained message for the specific topic, otherwise an {@link com.google.common.base.Optional}
* instance with an empty reference
* @deprecated Use RetainedMessageStoreLocal or RetainedMessageStoreCluster instead.
*/
@Deprecated
Optional<RetainedMessage> getRetainedMessage(String topic);
示例9: remove
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* Removes a given retained message. <code>null</code> values are ignored.
* If the given retained message doesn't exist, nothing will happen.
*
* @param retainedMessage which should be removed
* @deprecated Use {@link BlockingRetainedMessageStore} or {@link AsyncRetainedMessageStore} instead.
*/
@Deprecated
void remove(RetainedMessage retainedMessage);
示例10: addOrReplace
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* This method adds or replaces a retained message
*
* @param retainedMessage which should be added or replaced
* @deprecated Use {@link BlockingRetainedMessageStore} or {@link AsyncRetainedMessageStore} instead.
*/
@Deprecated
void addOrReplace(RetainedMessage retainedMessage);
示例11: contains
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* Checks if the retained message is present in the retained message store.
* Only the topic is of a retained message is considered for this check, QoS and message are ignored.
*
* @param retainedMessage to check if it's already in the message store
* @return true if there's already a message on the topic of the given retained message
* @deprecated Use {@link BlockingRetainedMessageStore} or {@link AsyncRetainedMessageStore} instead.
*/
@Deprecated
boolean contains(RetainedMessage retainedMessage);
示例12: getLocalRetainedMessages
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* @return all retained messages which are currently stored on this HiveMQ instance.
*/
Set<RetainedMessage> getLocalRetainedMessages();
示例13: getRetainedMessages
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* @return all retained messages which are currently stored
*/
Set<RetainedMessage> getRetainedMessages();
示例14: getRetainedMessage
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* @param topic a topic
* @return retained message for the specific topic or <code>null</code>.
* instance with an empty reference
*/
@Nullable
RetainedMessage getRetainedMessage(String topic);
示例15: addOrReplace
import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
* This method adds or replaces a retained message
*
* @param retainedMessage which should be added or replaced
*/
void addOrReplace(RetainedMessage retainedMessage);