/** 
 * 
 * Copyright 2004 Protique Ltd
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 * 
 **/

package org.codehaus.activemq.message;

/**
 * Infomation about the Capacity for more messages for a Connection/Broker
 * @version $Revision: 1.2 $
 */

public class CapacityInfo extends AbstractPacket {

    private String resourceName;
    private String correlationId;
    private int capacity = 100;
    private long flowControlTimeout;
    /**
     * @return the PacketType
     */
    public int getPacketType() {
        return Packet.CAPACITY_INFO;
    }


    /**
     * @return Returns the capacity.
     */
    public int getCapacity() {
        return capacity;
    }
    /**
     * @param capacity The capacity to set.
     */
    public void setCapacity(int capacity) {
        this.capacity = capacity;
    }
    /**
     * @return Returns the resourceName.
     */
    public String getResourceName() {
        return resourceName;
    }
    /**
     * @param resourceName The resourceName to set.
     */
    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }
    /**
     * @return Returns the correlationId.
     */
    public String getCorrelationId() {
        return correlationId;
    }
    /**
     * @param correlationId The correlationId to set.
     */
    public void setCorrelationId(String correlationId) {
        this.correlationId = correlationId;
    }
    /**
     * @return Returns the flowControlTimeout (ms)
     */
    public long getFlowControlTimeout() {
        return flowControlTimeout;
    }
    /**
     * @param flowControlTimeout The flowControlTimeout to set(ms).
     */
    public void setFlowControlTimeout(long flowControlTimeout) {
        this.flowControlTimeout = flowControlTimeout;
    }
    
    /**
     * @return a pretty print
     */
    public String toString() {
        return super.toString() + " CapacityInfo{ " +
                "capacity = " + capacity +
                ", resourceName = '" + resourceName + "' " +
                ", correlationId = '" + correlationId + "' " +
                ", flowControlTimeout = " + flowControlTimeout +
                " }";
    }
}
