當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。