1 18 package org.apache.activemq.command; 19 20 import org.apache.activemq.state.CommandVisitor; 21 22 29 public class PartialCommand implements Command { 30 31 public static final byte DATA_STRUCTURE_TYPE = CommandTypes.PARTIAL_COMMAND; 32 33 private int commandId; 34 private byte[] data; 35 36 private transient Endpoint from; 37 private transient Endpoint to; 38 39 public PartialCommand() { 40 } 41 42 public byte getDataStructureType() { 43 return DATA_STRUCTURE_TYPE; 44 } 45 46 49 public int getCommandId() { 50 return commandId; 51 } 52 53 public void setCommandId(int commandId) { 54 this.commandId = commandId; 55 } 56 57 62 public byte[] getData() { 63 return data; 64 } 65 66 public void setData(byte[] data) { 67 this.data = data; 68 } 69 70 public Endpoint getFrom() { 71 return from; 72 } 73 74 public void setFrom(Endpoint from) { 75 this.from = from; 76 } 77 78 public Endpoint getTo() { 79 return to; 80 } 81 82 public void setTo(Endpoint to) { 83 this.to = to; 84 } 85 86 public Response visit(CommandVisitor visitor) throws Exception { 87 throw new IllegalStateException ("The transport layer should filter out PartialCommand instances but received: " + this); 88 } 89 90 public boolean isResponseRequired() { 91 return false; 92 } 93 94 public boolean isResponse() { 95 return false; 96 } 97 98 public boolean isBrokerInfo() { 99 return false; 100 } 101 102 public boolean isMessageDispatch() { 103 return false; 104 } 105 106 public boolean isMessage() { 107 return false; 108 } 109 110 public boolean isMessageAck() { 111 return false; 112 } 113 114 public boolean isMessageDispatchNotification() { 115 return false; 116 } 117 118 public boolean isShutdownInfo() { 119 return false; 120 } 121 122 public void setResponseRequired(boolean responseRequired) { 123 } 124 125 public boolean isWireFormatInfo() { 126 return false; 127 } 128 129 public boolean isMarshallAware() { 130 return false; 131 } 132 133 public String toString() { 134 int size = 0; 135 if (data != null) { 136 size = data.length; 137 } 138 return "PartialCommand[id: " + commandId + " data: " + size + " byte(s)]"; 139 } 140 141 142 } 143 | Popular Tags |