KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mr > MantaAgentConstants


1 /*
2  * Copyright 2002 by
3  * <a HREF="http://www.coridan.com">Coridan</a>
4  * <a HREF="mailto: support@coridan.com ">support@coridan.com</a>
5  *
6  * The contents of this file are subject to the Mozilla Public License Version
7  * 1.1 (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  * http://www.mozilla.org/MPL/
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the
14  * License.
15  *
16  * The Original Code is "MantaRay" (TM).
17  *
18  * The Initial Developer of the Original Code is Amir Shevat.
19  * Portions created by the Initial Developer are Copyright (C) 2006
20  * Coridan Inc. All Rights Reserved.
21  *
22  * Contributor(s): all the names of the contributors are added in the source
23  * code where applicable.
24  *
25  * Alternatively, the contents of this file may be used under the terms of the
26  * LGPL license (the "GNU LESSER GENERAL PUBLIC LICENSE"), in which case the
27  * provisions of LGPL are applicable instead of those above. If you wish to
28  * allow use of your version of this file only under the terms of the LGPL
29  * License and not to allow others to use your version of this file under
30  * the MPL, indicate your decision by deleting the provisions above and
31  * replace them with the notice and other provisions required by the LGPL.
32  * If you do not delete the provisions above, a recipient may use your version
33  * of this file under either the MPL or the GNU LESSER GENERAL PUBLIC LICENSE.
34  
35  *
36  * This library is free software; you can redistribute it and/or modify it
37  * under the terms of the MPL as stated above or under the terms of the GNU
38  * Lesser General Public License as published by the Free Software Foundation;
39  * either version 2.1 of the License, or any later version.
40  *
41  * This library is distributed in the hope that it will be useful, but WITHOUT
42  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
43  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
44  * License for more details.
45  */

46 package org.mr;
47 /**
48  * This class holds the static data for Manta Agent
49  *
50  * @version 1.0
51  * @since Dec 29, 2003
52  * @author Amir Shevat
53  *
54  */

55 public class MantaAgentConstants {
56     /**
57      * PRIORITY - messages going into a SLA queue ere ordered by there priority X is valid values if ( HIGH >= X <= LOW)
58      * this is the HIGH marker for the range
59      */

60     public static final byte HIGH = 9;
61     /**
62      * PRIORITY - messages going into a SLA queue ere ordered by there priorety X is valid values if ( HIGH >= X <= LOW)
63      * this is the NORMAL marker for the range
64      */

65     public static final byte NORMAL = 5;
66     /**
67      * PRIORITY - messages going into a SLA queue ere ordered by there priorety X is valid values if ( HIGH >= X <= LOW)
68      * this is the LOW marker for the range
69      */

70     public static final byte LOW = 0;
71     
72     /**
73      * DELIVERY MODE
74      */

75     
76     /**
77      * messages will be saved befor been sent to the remote layer
78      */

79     public static final byte PERSISTENT = 2;
80     /**
81      * messages will not be saved befor been sent to the remote layer
82      */

83     public static final byte NON_PERSISTENT = 1;
84     
85     public static final int AGENT_DEFAULT_PRIORITY = NORMAL;
86     
87     /**
88      * DELIVERY MODE
89      */

90     public static final byte AGENT_DEFAULT_DELIVERY_MODE = NON_PERSISTENT;
91     
92     /**
93      * ack types
94      */

95     /**
96      * no acknowledgment will be return by the receiving end
97      */

98     public static final byte NO_ACK = 66;
99     /**
100      * the layer will send an acknowledgment as soon as the network passed the message up to the layer
101      */

102     public static final byte AUTO_ACK = 1;
103     /**
104      * it is up for the top layers to send acknowledgment, the manta layer will not send an acknowledgment
105      */

106     public static final byte CLIENT_ACK = 2;
107     
108     /**
109      * AUTO_ACK or CLIENT_ACK can be sent (or both)
110      */

111     public static final byte DUPLICATE_ACK = 3;
112     
113     /**
114      * Do not use this. This is for the JMS adapter use only.
115      */

116     //public static final byte JMS_ACK = 10;
117

118     public static final byte DEFAULT_ACK_TYPE = AUTO_ACK;
119     
120     /**
121      * default time to leave for messages
122      */

123     public static final long DEFAULT_TTL = 60000;
124     /**
125      * number of PRIORITIES
126      */

127     public static final short TOTAL_PRIORITIES = 10;
128     /**
129      * the default blocking mode of PERSISTENCY (true = wait until written)
130      */

131     public static final boolean DEFAULT_PERSISTENCY_BLOCKING_MODE = true;
132     
133     /**
134      * from this key in the system property the layer knows where it was installed
135      */

136     public static final String JavaDoc MANTA_CONFIG = "mantaConfig";
137     
138     public static final String JavaDoc USE_MANTA_LOG4J = "useMantarayLog4j";
139     
140     
141     // ttl of messages in the system
142
/**
143      * ACK messages with have this time to leave
144      */

145     public final static long ACK_TTL = 60000;
146     /**
147      * control messages with have this time to leave
148      */

149     public final static long CONTROL_MESSAGES_TTL = 600000;
150     
151     
152     // Constants used in log print out
153
/**
154      * log level DEBUG
155      */

156     public final static byte DEBUG = 0;
157     /**
158      * log level INFO
159      */

160     public final static byte INFO = 10;
161     /**
162      * log level WARNING
163      */

164     public final static byte WARNING = 20;
165     /**
166      * log level ERROR
167      */

168     public final static byte ERROR = 30;
169     /**
170      * log level FATAL
171      */

172     public final static byte FATAL = 40;
173     
174     
175 }
176
Popular Tags