1 18 package org.apache.activemq.command; 19 20 import org.apache.activemq.state.CommandVisitor; 21 22 27 public class ProducerInfo extends BaseCommand { 28 29 public static final byte DATA_STRUCTURE_TYPE=CommandTypes.PRODUCER_INFO; 30 31 protected ProducerId producerId; 32 protected ActiveMQDestination destination; 33 protected BrokerId[] brokerPath; 34 protected boolean dispatchAsync; 35 protected int windowSize; 36 37 public ProducerInfo() { 38 } 39 40 public ProducerInfo(ProducerId producerId) { 41 this.producerId = producerId; 42 } 43 44 public ProducerInfo(SessionInfo sessionInfo, long producerId) { 45 this.producerId = new ProducerId(sessionInfo.getSessionId(), producerId); 46 } 47 48 public ProducerInfo copy() { 49 ProducerInfo info = new ProducerInfo(); 50 copy(info); 51 return info; 52 } 53 54 public void copy(ProducerInfo info) { 55 super.copy(info); 56 info.producerId = producerId; 57 info.destination = destination; 58 } 59 60 public byte getDataStructureType() { 61 return DATA_STRUCTURE_TYPE; 62 } 63 64 67 public ProducerId getProducerId() { 68 return producerId; 69 } 70 public void setProducerId(ProducerId producerId) { 71 this.producerId = producerId; 72 } 73 74 77 public ActiveMQDestination getDestination() { 78 return destination; 79 } 80 public void setDestination(ActiveMQDestination destination) { 81 this.destination = destination; 82 } 83 84 public RemoveInfo createRemoveCommand() { 85 RemoveInfo command = new RemoveInfo(getProducerId()); 86 command.setResponseRequired(isResponseRequired()); 87 return command; 88 } 89 90 95 public BrokerId[] getBrokerPath() { 96 return brokerPath; 97 } 98 public void setBrokerPath(BrokerId[] brokerPath) { 99 this.brokerPath = brokerPath; 100 } 101 102 public Response visit(CommandVisitor visitor) throws Exception { 103 return visitor.processAddProducer( this ); 104 } 105 106 113 public boolean isDispatchAsync() { 114 return dispatchAsync; 115 } 116 117 public void setDispatchAsync(boolean dispatchAsync) { 118 this.dispatchAsync = dispatchAsync; 119 } 120 121 128 public int getWindowSize() { 129 return windowSize; 130 } 131 132 public void setWindowSize(int windowSize) { 133 this.windowSize = windowSize; 134 } 135 136 } 137 | Popular Tags |