ClientProperties.java
01 /* Licensed to the Apache Software Foundation (ASF) under one
02  * or more contributor license agreements.  See the NOTICE file
03  * distributed with this work for additional information
04  * regarding copyright ownership.  The ASF licenses this file
05  * to you under the Apache License, Version 2.0 (the
06  * "License"); you may not use this file except in compliance
07  * with the License.  You may obtain a copy of the License at
08  *
09  *   http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing,
12  * software distributed under the License is distributed on an
13  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14  * KIND, either express or implied.  See the License for the
15  * specific language governing permissions and limitations
16  * under the License.
17  */
18 
19 package org.apache.qpid.client.configuration;
20 
21 /**
22  * This class centralized the Qpid client properties.
23  */
24 public class ClientProperties
25 {
26 
27     /**
28      * Currently with Qpid it is not possible to change the client ID.
29      * If one is not specified upon connection construction, an id is generated automatically.
30      * Therefore an exception is always thrown unless this property is set to true.
31      * type: boolean
32      */
33     public static final String IGNORE_SET_CLIENTID_PROP_NAME = "ignore_setclientID";
34 
35     /**
36      * This property is currently used within the 0.10 code path only 
37      * The maximum number of pre-fetched messages per destination
38      * This property is used for all the connection unless it is overwritten by the connectionURL
39      * type: long
40      */
41     public static final String MAX_PREFETCH_PROP_NAME = "max_prefetch";
42     public static final String MAX_PREFETCH_DEFAULT = "5000";
43 
44     /**
45      * When true a sync command is sent after every persistent messages.
46      * type: boolean
47      */
48     public static final String SYNC_PERSISTENT_PROP_NAME = "sync_persistence";
49     
50     
51     /**
52      * This value will be used in the following settings
53      * To calculate the SO_TIMEOUT option of the socket (2*idle_timeout)
54      * If this values is between the max and min values specified for heartbeat
55      * by the broker in TuneOK it will be used as the heartbeat interval.
56      * If not a warning will be printed and the max value specified for 
57      * heartbeat in TuneOK will be used
58      */
59     public static final String IDLE_TIMEOUT_PROP_NAME = "idle_timeout";
60     
61 
62      /**
63      * ==========================================================
64      * Those properties are used when the io size should be bounded
65      * ==========================================================
66      */
67 
68     /**
69      * When set to true the io layer throttle down producers and consumers
70      * when written or read messages are accumulating and exceeding a certain size.
71      * This is especially useful when a the producer rate is greater than the network
72      * speed.
73      * type: boolean
74      */
75     public static final String PROTECTIO_PROP_NAME = "protectio";
76 
77     //=== The following properties are only used when the previous one is true.
78     /**
79      * Max size of read messages that can be stored within the MINA layer
80      * type: int
81      */
82     public static final String READ_BUFFER_LIMIT_PROP_NAME = "qpid.read.buffer.limit";
83     public static final String READ_BUFFER_LIMIT_DEFAULT = "262144";
84     /**
85      * Max size of written messages that can be stored within the MINA layer
86      * type: int
87      */
88     public static final String WRITE_BUFFER_LIMIT_PROP_NAME = "qpid.read.buffer.limit";
89     public static final String WRITE_BUFFER_LIMIT_DEFAULT = "262144";
90 }