Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: b84d3880ef75226367a2cd0c208ce17b2e09d48d (plain) (blame)
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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
/*
 * Copyright (c) 2009-2017 Eike Stepper (Berlin, Germany) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Eike Stepper - initial API and implementation
 *    Simon McDuff - bug 230832
 *    Simon McDuff - bug 233490
 *    Simon McDuff - bug 213402
 *    Christian W. Damus (CEA LIST) - bug 399306, bug 399487
 */
package org.eclipse.emf.cdo.common.protocol;

import org.eclipse.net4j.util.om.OMPlatform;

/**
 * Symbolic protocol constants commonly used in CDO.
 *
 * @author Eike Stepper
 * @since 2.0
 * @noextend This interface is not intended to be extended by clients.
 * @noimplement This interface is not intended to be implemented by clients.
 */
public interface CDOProtocolConstants
{
  public static final String PROTOCOL_NAME = "cdo"; //$NON-NLS-1$

  /**
   * @since 4.2
   * @noreference This field is not intended to be referenced by clients.
   */
  public static final int PROTOCOL_VERSION = 36; // CDOID.NIL

  // public static final int PROTOCOL_VERSION = 35; // DiffieHellman.Server.Challenge.getSecretAlgorithmKeyLen()
  // public static final int PROTOCOL_VERSION = 34; // CDOSessionProtocol.loadMergeData2()
  // public static final int PROTOCOL_VERSION = 33; // CDOCommitInfo.getMergeSource()
  // public static final int PROTOCOL_VERSION = 32; // ROLLBACK_REASON_UNIT_INTEGRITY
  // public static final int PROTOCOL_VERSION = 31; // CDOCommonRepository.isSupportingUnits()
  // public static final int PROTOCOL_VERSION = 30; // UnitOpcode
  // public static final int PROTOCOL_VERSION = 29; // SIGNAL_UNIT
  // public static final int PROTOCOL_VERSION = 28; // SIGNAL_RESET_TRANSACTION
  // public static final int PROTOCOL_VERSION = 27; // SIGNAL_OPENED_SESSION
  // public static final int PROTOCOL_VERSION = 26; // Add prefetch depth in LockStateRequest/Indication
  // public static final int PROTOCOL_VERSION = 25; // OpenSessionResponse.repositoryAuthenticating
  // public static final int PROTOCOL_VERSION = 24; // SIGNAL_LOAD_OBJECT_LIFETIME
  // public static final int PROTOCOL_VERSION = 23; // Fix branch renaming
  // public static final int PROTOCOL_VERSION = 22; // Prefetch returns RevisionInfo instead of CDORevision to have
  // PointerCDORevision
  // public static final int PROTOCOL_VERSION = 21; // Update how CDOChangeSetData's detachedObject is encoded, see
  // https://bugs.eclipse.org/bugs/show_bug.cgi?id=449171
  // public static final int PROTOCOL_VERSION = 20; // Have OMMonitor optional in
  // RequestWithMonitoring/IndicationWithMonitoring
  // public static final int PROTOCOL_VERSION = 19; // Branch renaming
  // public static final int PROTOCOL_VERSION = 18; // Password change protocol
  // public static final int PROTOCOL_VERSION = 17; // Last update for make query fail in sequence

  /**
   * @since 4.6
   */
  public static final boolean X_COMPRESSION = OMPlatform.INSTANCE.isProperty("org.eclipse.emf.cdo.common.protocol.X_COMPRESSION", true);

  // //////////////////////////////////////////////////////////////////////
  // Signal IDs

  public static final short SIGNAL_OPEN_SESSION = 1;

  public static final short SIGNAL_AUTHENTICATION = 2;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_OPEN_VIEW = 3;

  /**
   * @since 4.0
   */
  public static final short SIGNAL_SWITCH_TARGET = 4;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_CLOSE_VIEW = 5;

  public static final short SIGNAL_LOAD_PACKAGES = 6;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_LOAD_REVISIONS = 7;

  public static final short SIGNAL_LOAD_REVISION_BY_VERSION = 8;

  public static final short SIGNAL_LOAD_CHUNK = 9;

  public static final short SIGNAL_COMMIT_NOTIFICATION = 10;

  public static final short SIGNAL_COMMIT_TRANSACTION = 11;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_COMMIT_DELEGATION = 12;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_XA_COMMIT_TRANSACTION_PHASE1 = 13;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_XA_COMMIT_TRANSACTION_PHASE2 = 14;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_XA_COMMIT_TRANSACTION_PHASE3 = 15;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_XA_COMMIT_TRANSACTION_CANCEL = 16;

  public static final short SIGNAL_QUERY = 17;

  public static final short SIGNAL_QUERY_CANCEL = 18;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_REFRESH_SESSION = 19;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_DISABLE_PASSIVE_UPDATE = 20;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_SET_PASSIVE_UPDATE_MODE = 21;

  public static final short SIGNAL_CHANGE_SUBSCRIPTION = 22;

  public static final short SIGNAL_REPOSITORY_TIME = 23;

  public static final short SIGNAL_LOCK_OBJECTS = 24;

  public static final short SIGNAL_UNLOCK_OBJECTS = 25;

  public static final short SIGNAL_OBJECT_LOCKED = 26;

  /**
   * @since 4.0
   */
  public static final short SIGNAL_LOCK_AREA = 27;

  public static final short SIGNAL_GET_REMOTE_SESSIONS = 28;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_REMOTE_MESSAGE = 29;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_REMOTE_MESSAGE_NOTIFICATION = 30;

  public static final short SIGNAL_UNSUBSCRIBE_REMOTE_SESSIONS = 31;

  public static final short SIGNAL_REMOTE_SESSION_NOTIFICATION = 32;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_CREATE_BRANCH = 33;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_LOAD_BRANCH = 34;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_LOAD_SUB_BRANCHES = 35;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_LOAD_BRANCHES = 36;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_REPOSITORY_TYPE_NOTIFICATION = 37;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_REPOSITORY_STATE_NOTIFICATION = 38;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_BRANCH_NOTIFICATION = 39;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_LOAD_COMMIT_INFOS = 40;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_LOAD_COMMIT_DATA = 41;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_REPLICATE_REPOSITORY = 42;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_REPLICATE_REPOSITORY_RAW = 43;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_LOAD_CHANGE_SETS = 44;

  /**
   * @since 3.0
   */
  public static final short SIGNAL_LOAD_MERGE_DATA = 45;

  /**
   * @since 4.0
   */
  public static final short SIGNAL_QUERY_LOBS = 46;

  /**
   * @since 4.0
   */
  public static final short SIGNAL_LOAD_LOB = 47;

  /**
   * @since 4.0
   */
  public static final short SIGNAL_HANDLE_REVISIONS = 48;

  /**
   * @since 4.1
   */
  public static final short SIGNAL_LOCK_DELEGATION = 49;

  /**
   * @since 4.1
   */
  public static final short SIGNAL_UNLOCK_DELEGATION = 50;

  /**
   * @since 4.1
   */
  public static final short SIGNAL_LOCK_NOTIFICATION = 51;

  /**
   * @since 4.1
   */
  public static final short SIGNAL_LOCK_STATE = 52;

  /**
   * @since 4.1
   */
  public static final short SIGNAL_ENABLE_LOCK_NOTIFICATION = 53;

  /**
   * @since 4.1
   */
  public static final short SIGNAL_SET_LOCK_NOTIFICATION_MODE = 54;

  /**
   * @since 4.3
   */
  public static final short SIGNAL_LOAD_PERMISSIONS = 55;

  /**
   * Client's request to the server to initiate a change-credentials operation.
   *
   * @since 4.3
   *
   * @see #SIGNAL_CREDENTIALS_CHALLENGE
   */
  public static final short SIGNAL_CHANGE_CREDENTIALS = 56;

  /**
   * Server's request to the client for new credentials.
   *
   * @since 4.3
   *
   * @see #SIGNAL_CHANGE_CREDENTIALS
   */
  public static final short SIGNAL_CREDENTIALS_CHALLENGE = 57;

  /**
   * @since 4.3
   */
  public static final short SIGNAL_RENAME_BRANCH = 58;

  /**
   * @since 4.4
   */
  public static final short SIGNAL_LOAD_OBJECT_LIFETIME = 59;

  /**
   * @since 4.5
   */
  public static final short SIGNAL_OPENED_SESSION = 60;

  /**
   * @since 4.5
   */
  public static final short SIGNAL_RESET_TRANSACTION = 61;

  /**
   * @since 4.5
   */
  public static final short SIGNAL_UNIT = 62;

  // //////////////////////////////////////////////////////////////////////
  // Session Refresh

  /**
   * @since 3.0
   */
  public static final byte REFRESH_FINISHED = 0;

  /**
   * @since 3.0
   */
  public static final byte REFRESH_PACKAGE_UNIT = 1;

  /**
   * @since 3.0
   */
  public static final byte REFRESH_CHANGED_OBJECT = 2;

  /**
   * @since 3.0
   */
  public static final byte REFRESH_DETACHED_OBJECT = 3;

  // //////////////////////////////////////////////////////////////////////
  // Query Support

  /**
   * @since 4.3
   */
  public static final byte QUERY_RESULT_EXCEPTION = 0;

  /**
   * @since 4.3
   */
  public static final byte QUERY_RESULT_PRIMITIVE = 1;

  /**
   * @since 4.3
   */
  public static final byte QUERY_RESULT_REVISION = 2;

  public static final String QUERY_LANGUAGE_RESOURCES = "resources"; //$NON-NLS-1$

  public static final String QUERY_LANGUAGE_RESOURCES_FOLDER_ID = "folder"; //$NON-NLS-1$

  public static final String QUERY_LANGUAGE_RESOURCES_EXACT_MATCH = "exactMatch"; //$NON-NLS-1$

  /**
   * @since 4.3
   */
  public static final String QUERY_LANGUAGE_INSTANCES = "instances"; //$NON-NLS-1$

  /**
   * @since 4.3
   */
  public static final String QUERY_LANGUAGE_INSTANCES_TYPE = "type"; //$NON-NLS-1$

  /**
   * @since 4.3
   */
  public static final String QUERY_LANGUAGE_INSTANCES_EXACT = "exact"; //$NON-NLS-1$

  /**
   * @since 3.0
   */
  public static final String QUERY_LANGUAGE_XREFS = "xrefs"; //$NON-NLS-1$

  /**
   * @since 3.0
   */
  public static final String QUERY_LANGUAGE_XREFS_SOURCE_REFERENCES = "sourceReferences"; //$NON-NLS-1$

  // //////////////////////////////////////////////////////////////////////
  // Locking Objects

  public static final int RELEASE_ALL_LOCKS = -1;

  // //////////////////////////////////////////////////////////////////////
  // Remote Sessions

  public static final int NO_MORE_REMOTE_SESSIONS = -1;

  public static final byte REMOTE_SESSION_OPENED = 1;

  public static final byte REMOTE_SESSION_CLOSED = 2;

  public static final byte REMOTE_SESSION_SUBSCRIBED = 3;

  public static final byte REMOTE_SESSION_UNSUBSCRIBED = 4;

  /**
   * @since 3.0
   */
  public static final byte REMOTE_SESSION_CUSTOM_DATA = 5;

  // //////////////////////////////////////////////////////////////////////
  // Syncing

  /**
   * @since 3.0
   */
  public static final byte REPLICATE_FINISHED = 0;

  /**
   * @since 3.0
   */
  public static final byte REPLICATE_BRANCH = 1;

  /**
   * @since 3.0
   */
  public static final byte REPLICATE_COMMIT = 2;

  /**
   * @since 4.1
   */
  public static final byte REPLICATE_LOCKAREA = 3;

  // //////////////////////////////////////////////////////////////////////
  // Committing Transactions

  /**
   * @since 4.2
   */
  public static final byte ROLLBACK_REASON_UNKNOWN = 0;

  /**
   * @since 4.2
   */
  public static final byte ROLLBACK_REASON_OPTIMISTIC_LOCKING = 1;

  /**
   * @since 4.2
   */
  public static final byte ROLLBACK_REASON_COMMIT_CONFLICT = 2;

  /**
   * @since 4.2
   */
  public static final byte ROLLBACK_REASON_CONTAINMENT_CYCLE = 3;

  /**
   * @since 4.2
   */
  public static final byte ROLLBACK_REASON_REFERENTIAL_INTEGRITY = 4;

  /**
   * @since 4.3
   */
  public static final byte ROLLBACK_REASON_VALIDATION_ERROR = 5;

  /**
   * @since 4.5
   */
  public static final byte ROLLBACK_REASON_UNIT_INTEGRITY = 6;

  // //////////////////////////////////////////////////////////////////////
  // Security

  /**
   * @since 4.3
   */
  public static final byte REVISION_DOES_NOT_EXIST = -1;

  // //////////////////////////////////////////////////////////////////////
  // Units

  /**
   * @author Eike Stepper
   * @since 4.5
   */
  public static enum UnitOpcode
  {
    CHECK(false, false),

    CREATE(true, false),

    CREATE_AND_OPEN(true, true),

    OPEN(false, true),

    OPEN_DEMAND_CREATE(true, true),

    CLOSE(false, false);

    private boolean create;

    private boolean open;

    private UnitOpcode(boolean create, boolean open)
    {
      this.create = create;
      this.open = open;
    }

    public boolean isCreate()
    {
      return create;
    }

    public boolean isOpen()
    {
      return open;
    }
  }
}

Back to the top