org.noear.water.protocol.MsgSource Maven / Gradle / Ivy
package org.noear.water.protocol;
import org.noear.water.protocol.model.message.DistributionModel;
import org.noear.water.protocol.model.message.MessageModel;
import org.noear.water.protocol.model.message.MessageState;
import org.noear.water.protocol.model.message.SubscriberModel;
import java.io.Closeable;
import java.util.Date;
import java.util.List;
/**
* @author noear 2021/2/1 created
*/
public interface MsgSource extends Closeable {
//
//for api
//
void setMessageAsCancel(String msg_key) throws Exception;
void setMessageAsSucceed(String msg_key) throws Exception;
void setDistributionAsCancel(String msg_key, String subscriber_key) throws Exception;
void setDistributionAsSucceed(String msg_key, String subscriber_key) throws Exception;
long addMessage(String topic_name, String content) throws Exception;
long addMessage(String msg_key, String trace_id, String tags, String topic_name, String content, Date plan_time, boolean autoDelay) throws Exception;
//
//for sev
//
List getMessageListOfPending(int rows, long dist_nexttime) throws Exception;
MessageModel getMessageById(long msg_id) throws Exception;
void setMessageRouteState(MessageModel msg, boolean dist_routed);
boolean setMessageState(MessageModel msg, MessageState state);
boolean setMessageState(MessageModel msg, MessageState state, long dist_nexttime);
boolean setMessageRepet(MessageModel msg, MessageState state);
void addDistributionNoLock(MessageModel msg, SubscriberModel subs) throws Exception;
List getDistributionListByMsg(long msg_id) throws Exception;
boolean setDistributionState(MessageModel msg, DistributionModel dist, MessageState state);
//
//for admin
//
MessageModel getMessageByKey(String msg_key) throws Exception;
List getMessageList(int _m, String key) throws Exception;
/**
* 获取派发记录
* */
List getDistributionListByMsgIds(List