mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

opends
28.11.2006 eda79366f0bdacebb6fca64c8e472538c9b16798
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying * information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2006 Sun Microsystems, Inc.
 */
package org.opends.server.synchronization;
 
import org.opends.server.messages.MessageHandler;
import static org.opends.server.messages.MessageHandler.*;
 
/**
 * This class defines the set of message IDs and default format strings for
 * messages associated with the Synchronization.
 */
public class SynchMessages {
 
  /**
   * name of Synchronization.
   */
  public static final String SYNCHRONIZATION = "synchronization";
 
  /**
   * Name used to store attachment of historical information in the
   * operation.
   */
  public static final String HISTORICAL = "historical";
 
  /**
   * Invalid DN.
   */
  public static final int MSGID_SYNC_INVALID_DN =
       CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 1;
 
  /**
   * Need at least one Changelog Server.
   */
  public static final int MSGID_NEED_CHANGELOG_SERVER =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 2;
 
  /**
   * Need to have a server ID.
   */
  public static final int MSGID_NEED_SERVER_ID =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 3;
 
  /**
   * Invalid Changelog Server.
   */
  public static final int MSGID_INVALID_CHANGELOG_SERVER =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 4;
 
  /**
   * Unknown hostname.
   */
  public static final int MSGID_UNKNOWN_HOSTNAME =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 5;
 
  /**
   * Could not connect to any changelog server.
   */
  public static final int MSGID_COULD_NOT_BIND_CHANGELOG =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 6;
 
  /**
   * Unknown Operation type.
   */
  public static final int MSGID_UNKNOWN_TYPE =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 7;
 
  /**
   * Error while replaying an operation.
   */
  public static final int MSGID_ERROR_REPLAYING_OPERATION =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 8;
 
  /**
   * Operation was not found in Pending List during Post-Operation processing.
   */
  public static final int MSGID_OPERATION_NOT_FOUND_IN_PENDING =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 9;
 
  /**
   * Unable to open changelog database.
   */
  public static final int MSGID_COULD_NOT_INITIALIZE_DB =
   CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 10;
 
  /**
   * Unable to read changelog database.
   */
  public static final int MSGID_COULD_NOT_READ_DB =
   CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 11;
 
  /**
   * Exception while replaying an operation.
   */
  public static final int MSGID_EXCEPTION_REPLAYING_OPERATION =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 12;
 
  /**
   * Need to have a Changelog port.
   */
  public static final int MSGID_NEED_CHANGELOG_PORT =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 13;
 
  /**
   * Error while updating the ruv.
   */
  public static final int MSGID_ERROR_UPDATING_RUV =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 14;
 
  /**
   * Error while searching the ruv.
   */
  public static final int MSGID_ERROR_SEARCHING_RUV =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_MILD_ERROR | 15;
 
  /**
   * A server disconnected from the changelog server.
   * (this is an informational message)
   */
  public static final int MSGID_SERVER_DISCONNECT =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_NOTICE | 16;
 
  /**
   * There is no server listening on this host:port.
   * (this is an informational message)
   */
  public static final int MSGID_NO_CHANGELOG_SERVER_LISTENING =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_NOTICE | 17;
 
  /**
   * Tried to connect to a changelog server that does not have
   * all the changes that we have.
   * Try another one.
   */
  public static final int MSGID_CHANGELOG_MISSING_CHANGES =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_NOTICE | 18;
 
  /**
   * Only one changelog server is configured.
   * If this server fails the LDAP server will not be able to
   * process updates anymore.
   */
  public static final int MSGID_NEED_MORE_THAN_ONE_CHANGELOG_SERVER =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_NOTICE | 19;
 
  /**
   * An Exception happened during connection to a changelog server.
   */
  public static final int MSGID_EXCEPTION_STARTING_SESSION =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_NOTICE | 20;
 
  /**
   * The internal search operation used to find old changes
   * caused an error.
   */
  public static final int MSGID_CANNOT_RECOVER_CHANGES =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_NOTICE | 21;
 
  /**
   * When trying to find a changelog sever, it was detected that
   * none of the Changelog server has seen all the operations
   * that this server has already processed.
   */
  public static final int MSGID_COULD_NOT_FIND_CHANGELOG_WITH_MY_CHANGES =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_NOTICE | 22;
 
  /**
   * Could not find any working changelog server.
   */
  public static final int MSGID_COULD_NOT_FIND_CHANGELOG =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_NOTICE | 23;
 
  /**
   * Exception closing changelog database.
   */
  public static final int MSGID_EXCEPTION_CLOSING_DATABASE =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_NOTICE | 24;
 
  /**
   * Error Decoding message during operation replay.
   */
  public static final int MSGID_EXCEPTION_DECODING_OPERATION =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_SEVERE_ERROR | 25;
 
  /**
   * Database Exception in the Chanlog service causing the
   * changelog to shutdown.
   */
  public static final int MSGID_CHANGELOG_SHUTDOWN_DATABASE_ERROR =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_FATAL_ERROR | 26;
 
  /**
   * Database Exception in the Chanlog service causing the
   * changelog to shutdown.
   */
  public static final int MSGID_IGNORE_BAD_DN_IN_DATABASE_IDENTIFIER =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_SEVERE_ERROR | 27;
 
  /**
   * Database Exception closing the Changelog Environement.
   */
  public static final int MSGID_ERROR_CLOSING_CHANGELOG_ENV =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_SEVERE_ERROR | 28;
 
  /**
   * Exception during the database trimming or flush.
   */
  public static final int MSGID_EXCEPTION_CHANGELOG_TRIM_FLUSH =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_SEVERE_ERROR | 29;
 
  /**
   * Error processing changelog message.
   */
  public static final int MSGID_CHANGELOG_CONNECTION_ERROR =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_SEVERE_ERROR | 30;
 
  /**
   * Remote server has sent an unknown message.
   */
  public static final int MSGID_UNKNOWN_MESSAGE =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_SEVERE_ERROR | 31;
 
  /**
   * Remote server has sent an unknown message.
   */
  public static final int MSGID_WRITER_UNEXPECTED_EXCEPTION =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_SEVERE_ERROR | 32;
 
  /**
   * Remote server has sent an unknown message.
   */
  public static final int MSGID_CHANGELOG_ERROR_SENDING_ACK =
    CATEGORY_MASK_SYNC | SEVERITY_MASK_SEVERE_ERROR | 33;
 
  /**
   * Register the messages from this class in the core server.
   *
   */
  static void registerMessages()
  {
    MessageHandler.registerMessage(MSGID_SYNC_INVALID_DN,
       "The Synchronization configuration DN is invalid");
    MessageHandler.registerMessage(MSGID_NEED_CHANGELOG_SERVER,
        "At least one changelog server must be declared");
    MessageHandler.registerMessage(MSGID_NEED_SERVER_ID,
        "The Server id must be defined");
    MessageHandler.registerMessage(MSGID_INVALID_CHANGELOG_SERVER,
        "Invalid changelog server configuration");
    MessageHandler.registerMessage(MSGID_UNKNOWN_HOSTNAME,
        "Changelog failed to start because the hostname is unknown.");
    MessageHandler.registerMessage(MSGID_COULD_NOT_BIND_CHANGELOG,
        "Changelog failed to start :" +
        " could not bind to the changelog listen port : %d. Error : %s");
    MessageHandler.registerMessage(MSGID_UNKNOWN_TYPE,
        "Unknown operation type : %s");
    MessageHandler.registerMessage(MSGID_ERROR_REPLAYING_OPERATION,
        "Error %s when replaying operation %s : %s");
    MessageHandler.registerMessage(MSGID_OPERATION_NOT_FOUND_IN_PENDING,
        "Internal Error : Operation %s change number %s" +
        " was not found in pending list");
    MessageHandler.registerMessage(MSGID_COULD_NOT_INITIALIZE_DB,
        "Changelog failed to start " +
        "because the database %s could not be opened");
    MessageHandler.registerMessage(MSGID_COULD_NOT_READ_DB,
        "Changelog failed to start " +
        "because the database %s could not be read");
    MessageHandler.registerMessage(MSGID_EXCEPTION_REPLAYING_OPERATION,
         "Caught Exception %s when replaying operation %s : %s");
    MessageHandler.registerMessage(MSGID_NEED_CHANGELOG_PORT,
         "The Changelog server port must be defined");
    MessageHandler.registerMessage(MSGID_ERROR_UPDATING_RUV,
         "Error %s when updating server state %s : %s base dn : %s");
    MessageHandler.registerMessage(MSGID_ERROR_SEARCHING_RUV,
         "Error %s when searching for server state %s : %s base dn : %s");
    MessageHandler.registerMessage(MSGID_SERVER_DISCONNECT,
         "%s has disconnected from this changelog server.");
    MessageHandler.registerMessage(MSGID_NO_CHANGELOG_SERVER_LISTENING,
         "There is no changelog server listening on %s.");
    MessageHandler.registerMessage(MSGID_CHANGELOG_MISSING_CHANGES,
        "The changelog server %s is missing some changes that this server" +
        " has already processed.");
    MessageHandler.registerMessage(MSGID_NEED_MORE_THAN_ONE_CHANGELOG_SERVER,
        "More than one changelog server should be configured.");
    MessageHandler.registerMessage(MSGID_EXCEPTION_STARTING_SESSION,
        "Caught Exception during initial communication with " +
        "changelog server : ");
    MessageHandler.registerMessage(MSGID_CANNOT_RECOVER_CHANGES,
        "Error when searching old changes from the database. ");
    MessageHandler.registerMessage(
        MSGID_COULD_NOT_FIND_CHANGELOG_WITH_MY_CHANGES,
        "Could not find a changelog server that has seen all the local" +
        " changes. Going to replay changes.");
    MessageHandler.registerMessage(MSGID_COULD_NOT_FIND_CHANGELOG,
        "Could not connect to any changelog server, retrying...");
    MessageHandler.registerMessage(MSGID_EXCEPTION_CLOSING_DATABASE,
        "Error closing changelog database %s : ");
    MessageHandler.registerMessage(MSGID_EXCEPTION_DECODING_OPERATION,
        "Error trying to replay %s, operation could not be decoded : ");
    MessageHandler.registerMessage(MSGID_CHANGELOG_SHUTDOWN_DATABASE_ERROR,
        "Error Trying to use the underlying database. " +
        "The Changelog Service is going to shut down. ");
    MessageHandler.registerMessage(MSGID_IGNORE_BAD_DN_IN_DATABASE_IDENTIFIER,
        "A badly formatted DN was found in the list of database known " +
        "By this changelog service :%s. This Identifier will be ignored. ");
    MessageHandler.registerMessage(MSGID_ERROR_CLOSING_CHANGELOG_ENV,
        "Error closing the changelog database : ");
    MessageHandler.registerMessage(MSGID_EXCEPTION_CHANGELOG_TRIM_FLUSH,
        "Error during the changelog database trimming or flush process." +
        " The Changelog service is going to shutdown. ");
    MessageHandler.registerMessage(MSGID_CHANGELOG_CONNECTION_ERROR,
        "Error during Changelog service message processing ." +
        " Connection %s is rejected. ");
    MessageHandler.registerMessage(MSGID_UNKNOWN_MESSAGE,
        "%s has sent an unknown message. Closing the connection. ");
    MessageHandler.registerMessage(MSGID_WRITER_UNEXPECTED_EXCEPTION,
        "An unexpected error happened handling connection with %s." +
        "This connection is going to be closed. ");
    MessageHandler.registerMessage(MSGID_CHANGELOG_ERROR_SENDING_ACK,
        "An unexpected error happened sending an ack to %s." +
        "This connection is going to be closed. ");
  }
}