1 /*** 2 * 3 * Copyright 2004 Protique Ltd 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 **/ 18 19 package org.codehaus.activemq.message; 20 21 /*** 22 * Infomation about the Capacity for more messages for a Connection/Broker 23 * @version $Revision: 1.2 $ 24 */ 25 26 public class CapacityInfo extends AbstractPacket { 27 28 private String resourceName; 29 private String correlationId; 30 private int capacity = 100; 31 private long flowControlTimeout; 32 /*** 33 * @return the PacketType 34 */ 35 public int getPacketType() { 36 return Packet.CAPACITY_INFO; 37 } 38 39 40 /*** 41 * @return Returns the capacity. 42 */ 43 public int getCapacity() { 44 return capacity; 45 } 46 /*** 47 * @param capacity The capacity to set. 48 */ 49 public void setCapacity(int capacity) { 50 this.capacity = capacity; 51 } 52 /*** 53 * @return Returns the resourceName. 54 */ 55 public String getResourceName() { 56 return resourceName; 57 } 58 /*** 59 * @param resourceName The resourceName to set. 60 */ 61 public void setResourceName(String resourceName) { 62 this.resourceName = resourceName; 63 } 64 /*** 65 * @return Returns the correlationId. 66 */ 67 public String getCorrelationId() { 68 return correlationId; 69 } 70 /*** 71 * @param correlationId The correlationId to set. 72 */ 73 public void setCorrelationId(String correlationId) { 74 this.correlationId = correlationId; 75 } 76 /*** 77 * @return Returns the flowControlTimeout (ms) 78 */ 79 public long getFlowControlTimeout() { 80 return flowControlTimeout; 81 } 82 /*** 83 * @param flowControlTimeout The flowControlTimeout to set(ms). 84 */ 85 public void setFlowControlTimeout(long flowControlTimeout) { 86 this.flowControlTimeout = flowControlTimeout; 87 } 88 89 /*** 90 * @return a pretty print 91 */ 92 public String toString(){ 93 return "CapacityInfo: cap=" + capacity + ",timeout=" + flowControlTimeout + ",resource=" + resourceName; 94 } 95 }