当前位置: 首页>>代码示例>>Java>>正文


Java RetainedMessage类代码示例

本文整理汇总了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));
}
 
开发者ID:hivemq,项目名称:hivemq-spring-example-plugin,代码行数:9,代码来源:StartCallback.java

示例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!");
}
 
开发者ID:hivemq,项目名称:hivemq-hello-world-plugin,代码行数:15,代码来源:ScheduledClearRetainedCallback.java

示例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();
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:5,代码来源:AsyncRetainedMessageStore.java

示例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();
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:5,代码来源:AsyncRetainedMessageStore.java

示例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);
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:6,代码来源:AsyncRetainedMessageStore.java

示例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);
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:8,代码来源:AsyncRetainedMessageStore.java

示例7: getRetainedMessages

import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
 * @return all retained messages which are currently stored
 */
@Deprecated
Set<RetainedMessage> getRetainedMessages();
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:6,代码来源:RetainedMessageStore.java

示例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);
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:9,代码来源:RetainedMessageStore.java

示例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);
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:10,代码来源:RetainedMessageStore.java

示例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);
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:9,代码来源:RetainedMessageStore.java

示例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);
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:11,代码来源:RetainedMessageStore.java

示例12: getLocalRetainedMessages

import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
 * @return all retained messages which are currently stored on this HiveMQ instance.
 */
Set<RetainedMessage> getLocalRetainedMessages();
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:5,代码来源:BlockingRetainedMessageStore.java

示例13: getRetainedMessages

import com.hivemq.spi.message.RetainedMessage; //导入依赖的package包/类
/**
 * @return all retained messages which are currently stored
 */
Set<RetainedMessage> getRetainedMessages();
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:5,代码来源:BlockingRetainedMessageStore.java

示例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);
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:8,代码来源:BlockingRetainedMessageStore.java

示例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);
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:7,代码来源:BlockingRetainedMessageStore.java


注:本文中的com.hivemq.spi.message.RetainedMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。