KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > sandesha > Constants


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 package org.apache.sandesha;
19
20 import org.apache.axis.message.addressing.util.AddressingUtils;
21
22 /**
23  * class Constants
24  *
25  * @author Amila Navarathna
26  * @author Jaliya Ekanayaka
27  * @author Sudar Nimalan
28  * @author Chamikara Jayalath
29  */

30 public interface Constants {
31
32     int INVOKER_THREADS = 10;
33     int SENDER_THREADS = 2;
34
35     int DEFAULR_CLIENT_SIDE_LISTENER_PORT = 9090;
36     int DEFAULT_SIMPLE_AXIS_SERVER_PORT = 8080;
37
38     String JavaDoc HTTP = "http";
39     String JavaDoc COLON = ":";
40     String JavaDoc SLASH = "/";
41     String JavaDoc UUID = "uuid:";
42     String JavaDoc ASTERISK = "*";
43
44     String JavaDoc URL_RM_SERVICE = "/axis/services/RMService";
45     String JavaDoc IGNORE_ACTION = "ignoreAction";
46     String JavaDoc RESPONSE = "Response";
47     String JavaDoc CONTEXT = "context";
48     String JavaDoc INVOKER = "invoker";
49     String JavaDoc THREAD_POOL_SIZE = "threadPoolSize";
50
51     long RETRANSMISSION_INTERVAL = 4000L;
52     long ACKNOWLEDGEMENT_INTERVAL = 200L;
53     long INACTIVITY_TIMEOUT = 600000L;
54     long RMINVOKER_SLEEP_TIME = 2000L;
55     long SENDER_SLEEP_TIME = 2000L;
56     long CLIENT_RESPONSE_CHECKING_INTERVAL = 500L;
57     long CLIENT_WAIT_PERIOD_FOR_COMPLETE = 1000L;
58
59     int SERVER_QUEUE_ACCESSOR = 1;
60     int SERVER_DATABASE_ACCESSOR = 2;
61
62     int MSG_TYPE_CREATE_SEQUENCE_REQUEST = 1;
63     int MSG_TYPE_CREATE_SEQUENCE_RESPONSE = 2;
64     int MSG_TYPE_SERVICE_REQUEST = 3;
65     int MSG_TYPE_SERVICE_RESPONSE = 4;
66     int MSG_TYPE_ACKNOWLEDGEMENT = 5;
67     int MSG_TYPE_TERMINATE_SEQUENCE = 6;
68
69     //To identify the end point
70
byte SERVER = (byte) 1;
71     byte CLIENT = (byte) 0;
72
73     int SYNCHRONOUS = 0;
74
75     public interface WSA {
76         String JavaDoc NS_ADDRESSING_ANONYMOUS = AddressingUtils.getAnonymousRoleURI();
77     }
78
79     public interface WSRM {
80         String JavaDoc NS_PREFIX_RM = "wsrm";
81         String JavaDoc NS_URI_RM = "http://schemas.xmlsoap.org/ws/2005/02/rm";
82         String JavaDoc ACTION_CREATE_SEQUENCE = WSRM.NS_URI_RM + "/CreateSequence";
83         String JavaDoc ACTION_CREATE_SEQUENCE_RESPONSE = WSRM.NS_URI_RM + "/CreateSequenceResponse";
84         String JavaDoc ACTION_TERMINATE_SEQUENCE = WSRM.NS_URI_RM + "/TerminateSequence";
85         String JavaDoc SEQUENCE_ACKNOWLEDGEMENT_ACTION = WSRM.NS_URI_RM + "/SequenceAcknowledgement";
86
87         String JavaDoc ACK_RANGE = "AcknowledgementRange";
88         String JavaDoc UPPER = "Upper";
89         String JavaDoc LOWER = "Lower";
90         String JavaDoc ACK_REQUESTED = "AckRequested";
91         String JavaDoc MSG_NUMBER = "MessageNumber";
92         String JavaDoc CREATE_SEQUENCE = "CreateSequence";
93         String JavaDoc CREATE_SEQUENCE_RESPONSE = "CreateSequenceResponse";
94         String JavaDoc FAULT_CODE = "FaultCode";
95         String JavaDoc LAST_MSG = "LastMessage";
96         String JavaDoc NACK = "Nack";
97         String JavaDoc SEQUENCE = "Sequence";
98         String JavaDoc SEQUENCE_ACK = "SequenceAcknowledgement";
99         String JavaDoc TERMINATE_DEQUENCE = "TerminateSequence";
100         String JavaDoc SEQUENCE_FAULT = "SequenceFault";
101         String JavaDoc ACKS_TO = "AcksTo";
102         String JavaDoc SEQUENCE_OFFER = "Offer";
103         String JavaDoc ACCEPT = "Accept";
104         String JavaDoc IDENTIFIER = "Identifier";
105
106         double MAX_MSG_NO = 18446744073709551615.0d;
107     }
108
109     public interface FaultMessages {
110         String JavaDoc SERVER_INTERNAL_ERROR = "Server Interanal Error";
111
112         String JavaDoc NO_ADDRESSING_HEADERS = "No Addressing Headers Available in this Message";
113         String JavaDoc NO_TO = "Required header <wsa:To> NOT found.";
114
115         String JavaDoc NO_RM_HEADES = "No RM Headers Available in this Message";
116
117         String JavaDoc INVALID_ACKNOWLEDGEMENT = "The SequenceAcknowledgement violates the cumulative " +
118                 "cknowledgement invariant.";
119         String JavaDoc UNKNOWN_SEQUENCE = "The value of wsrm:Identifier is not a known Sequence " +
120                 "identifier.";
121         String JavaDoc MSG_NO_ROLLOVER = "The maximum value for wsrm:MessageNumber has been exceeded.";
122         String JavaDoc LAST_MSG_NO_EXCEEDED = "The value for wsrm:MessageNumber exceeds the value of the" +
123                 " MessageNumber accompanying a LastMessage element in this Sequence.";
124         String JavaDoc INVALID_MESSAGE = "Invalid Message";
125     }
126
127     public interface FaultCodes {
128         String JavaDoc WSRM_SERVER_INTERNAL_ERROR = "ServerInternalError";
129         String JavaDoc IN_CORRECT_MESSAGE = "Incorrect Message";
130         String JavaDoc WSRM_FAULT_INVALID_ACKNOWLEDGEMENT = "wsrm:InvalidAcknowledgement";
131         String JavaDoc WSRM_FAULT_UNKNOWN_SEQUENCE = "wsrm:UnknownSequence";
132         String JavaDoc WSRM_FAULT_MSG_NO_ROLLOVER = "wsrm:MessageNumberRollover";
133         String JavaDoc WSRM_FAULR_LAST_MSG_NO_EXCEEDED = "wsrm:LastMessageNumberExceeded";
134     }
135
136     public interface ErrorMessages {
137         String JavaDoc CLIENT_PROPERTY_VALIDATION_ERROR = "ERROR: To perform the operation, " +
138                 "ReplyTo address must be specified. This EPR will not be the Sandesha end point. " +
139                 "If it should be Sandesha end point, please set the propety 'sync' " +
140                 "to false in call.";
141         String JavaDoc MESSAGE_NUMBER_NOT_SPECIFIED = "ERROR: Message Number Not Specified or Action " +
142                 "is null";
143
144         String JavaDoc SET_APPROVED_OUT_SEQ = "ERROR: setApprovedOutSequence()";
145
146         String JavaDoc CANNOT_SEND_THE_TERMINATE_SEQ = "SERVER ERROR: Cannot send the TerminateSequence " +
147                 "from Server";
148
149         String JavaDoc NULL_REQUEST_MSG = "ERROR : NULL REQUEST MESSAGE";
150
151         String JavaDoc SEQ_IS_NOT_CREATED = "ERROR: Sequence was not created correcly in the in queue";
152
153     }
154
155     public interface InfomationMessage {
156         String JavaDoc SENDING_CREATE_SEQ = "INFO: SENDING CREATE SEQUENCE REQUEST ....\n";
157         String JavaDoc SENDING_CREATE_SEQ_RES = "INFO: SENDING CREATE SEQUENCE RESPONSE ....\n";
158         String JavaDoc SENDING_TERMINATE_SEQ = "INFO: SENDING TERMINATE SEQUENCE REQUEST ....\n";
159         String JavaDoc SENDING_ACK = "INFO: SENDING ACKNOWLEDGEMENT ....\n";
160         String JavaDoc SENDING_REQ = "INFO: SENDING REQUEST MESSAGE ....\n";
161         String JavaDoc SENDING_RES = "INFO: SENDING RESPONSE MESSAGE ....\n";
162         String JavaDoc PROVIDER_RECEIVED_MSG = "INFO: RMPROVIDER RECEIVED A SOAP REQUEST....\n";
163         String JavaDoc SENDER_STARTED = "INFO: SENDER STARTED ....\n";
164         String JavaDoc WAITING_TO_STOP_CLIENT = "INFO: WATING TO STOP CLIENT ....\n";
165
166     }
167
168     //Constants related to the queue.
169
public interface Queue {
170         String JavaDoc ADD_ERROR = "Error in adding message";
171         String JavaDoc QUEUE_INCONSIS = "Inconsistent queue";
172         String JavaDoc MESSAGE_EXISTS = "Message already exists";
173         String JavaDoc SEQUENCE_ABSENT = "Sequence id does not exist............";
174         String JavaDoc RESPONSE_SEQ_NULL = "ERROR: RESPONSE SEQ IS NULL";
175         String JavaDoc SEQUENCE_ID_NULL = "Sequence Id is null";
176         String JavaDoc MESSAGE_ID_NULL = "Message is null";
177     }
178
179
180     public interface ClientProperties {
181
182         short IN_OUT = (short) 1;
183         short IN_ONLY = (short) 2;
184
185         String JavaDoc PROPERTY_FILE = "sandesha.properties";
186         String JavaDoc WSRM_POLICY_FILE = "WSRMPolicy.xml";
187
188         String JavaDoc CLIENT_LISTENER_PORT = "CLIENT_LISTENER_PORT";
189         String JavaDoc SIMPLE_AXIS_SERVER_PORT_POPERTY = "SIMPLE_AXIS_SERVER_PORT";
190
191         String JavaDoc FROM = "from";
192         String JavaDoc REPLY_TO = "replyTo";
193         String JavaDoc MSG_NUMBER = "msgNumber";
194         String JavaDoc LAST_MESSAGE = "lastMessage";
195         String JavaDoc SYNC = "sync";
196         String JavaDoc ACTION = "action";
197         String JavaDoc ACKS_TO = "acksTo";
198         String JavaDoc TO = "to";
199         String JavaDoc FAULT_TO = "faultTo";
200         String JavaDoc SEND_OFFER = "offer";
201         String JavaDoc SOURCE_URL = "sourceURL";
202         String JavaDoc MEP = "mep";
203         String JavaDoc CALL_KEY = "callKey";
204         String JavaDoc REPORT = "report";
205
206         String JavaDoc REQUEST_HANDLER = "requestHandler";
207         String JavaDoc RESPONSE_HANDLER = "responseHandler";
208         String JavaDoc LISTENER_REQUEST_HANDLER = "listenerRequestHandler";
209         String JavaDoc LISTENER_RESPONSE_HANDLER = "listenerResponseHandler";
210
211         String JavaDoc PROVIDER_CLASS = "providerClass";
212         String JavaDoc DEFAULT_PROVIDER_CLASS = "org.apache.axis.providers.java.RPCProvider";
213
214         String JavaDoc CLASS_NAME = "className";
215         String JavaDoc RMSERVICE = "RMService";
216         String JavaDoc RMSERVICE_CLASS = "org.apache.sandesha.client.RMService";
217         String JavaDoc ALLOWED_METHODS = "allowedMethods";
218     }
219
220     public interface WSRMPolicy {
221         String JavaDoc INA_TIMEOUT = "InactivityTimeout";
222         String JavaDoc BASE_TX_INTERVAL = "BaseRetransmissionInterval";
223         String JavaDoc ACK_INTERVAL = "AcknowledgementInterval";
224         String JavaDoc EXP_BACKOFF = "ExponentialBackoff";
225
226         String JavaDoc WSRM = "http://schemas.xmlsoap.org/ws/2005/02/rm/policy";
227         String JavaDoc BIN_BACKOFF = "BinaryBackoff";
228     }
229
230     String JavaDoc INVOKE_STRATEGY = "invokeStrategy";
231     String JavaDoc DEFAULT_STRATEGY = "org.apache.sandesha.server.ThreadPoolInvokeStrategy:threadPoolSize=10";
232     String JavaDoc INVOKE_HANDLER = "invokeHandler";
233     String JavaDoc DEFAULT_HANDLER = "org.apache.sandesha.server.InvokeHandlerImpl:invoker=org.apache.axis.providers.java." +
234             "RPCProvider";
235
236 }
237
238
Popular Tags