com.alibaba.rocketmq.common.protocol.body.ConsumerConnection Maven / Gradle / Ivy
package com.alibaba.rocketmq.common.protocol.body;
import com.alibaba.rocketmq.common.consumer.ConsumeFromWhere;
import com.alibaba.rocketmq.common.protocol.heartbeat.ConsumeType;
import com.alibaba.rocketmq.common.protocol.heartbeat.MessageModel;
import com.alibaba.rocketmq.common.protocol.heartbeat.SubscriptionData;
import com.alibaba.rocketmq.remoting.protocol.RemotingSerializable;
import java.util.HashSet;
import java.util.concurrent.ConcurrentHashMap;
/**
* TODO
*
* @author shijia.wxr
* @since 13-8-5
*/
public class ConsumerConnection extends RemotingSerializable {
private HashSet connectionSet = new HashSet();
private ConcurrentHashMap subscriptionTable =
new ConcurrentHashMap();
private ConsumeType consumeType;
private MessageModel messageModel;
private ConsumeFromWhere consumeFromWhere;
public int computeMinVersion() {
int minVersion = Integer.MAX_VALUE;
for (Connection c : this.connectionSet) {
if (c.getVersion() < minVersion) {
minVersion = c.getVersion();
}
}
return minVersion;
}
public HashSet getConnectionSet() {
return connectionSet;
}
public void setConnectionSet(HashSet connectionSet) {
this.connectionSet = connectionSet;
}
public ConcurrentHashMap getSubscriptionTable() {
return subscriptionTable;
}
public void setSubscriptionTable(ConcurrentHashMap subscriptionTable) {
this.subscriptionTable = subscriptionTable;
}
public ConsumeType getConsumeType() {
return consumeType;
}
public void setConsumeType(ConsumeType consumeType) {
this.consumeType = consumeType;
}
public MessageModel getMessageModel() {
return messageModel;
}
public void setMessageModel(MessageModel messageModel) {
this.messageModel = messageModel;
}
public ConsumeFromWhere getConsumeFromWhere() {
return consumeFromWhere;
}
public void setConsumeFromWhere(ConsumeFromWhere consumeFromWhere) {
this.consumeFromWhere = consumeFromWhere;
}
}