2 * Copyright 2011 Google Inc.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package com.google.ipc.invalidation.common;
19 import com.google.protobuf.ByteString;
20 import com.google.protos.ipc.invalidation.ClientProtocol.ObjectIdP;
21 import com.google.protos.ipc.invalidation.ClientProtocol.ProtocolVersion;
22 import com.google.protos.ipc.invalidation.ClientProtocol.Version;
23 import com.google.protos.ipc.invalidation.Types.ClientType;
24 import com.google.protos.ipc.invalidation.Types.ObjectSource;
27 * Various constants common to clients and servers used in version 2 of the Ticl.
30 public class CommonInvalidationConstants2 {
32 /** Major version of the client library. */
33 public static final int CLIENT_MAJOR_VERSION = 3;
36 * Minor version of the client library, defined to be equal to the datestamp of the build
39 public static final int CLIENT_MINOR_VERSION = BuildConstants.BUILD_DATESTAMP;
41 /** Major version of the protocol between the client and the server. */
42 public static final int PROTOCOL_MAJOR_VERSION = 3;
44 /** Minor version of the protocol between the client and the server. */
45 public static final int PROTOCOL_MINOR_VERSION = 2;
47 /** Major version of the client config. */
48 public static final int CONFIG_MAJOR_VERSION = 3;
50 /** Minor version of the client config. */
51 public static final int CONFIG_MINOR_VERSION = 2;
53 /** Version of the protocol currently being used by the client/server for v2 clients. */
54 public static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.newBuilder()
55 .setVersion(CommonProtos2.newVersion(PROTOCOL_MAJOR_VERSION, PROTOCOL_MINOR_VERSION)).build();
57 /** Version of the protocol currently being used by the client/server for v1 clients. */
58 public static final ProtocolVersion PROTOCOL_VERSION_V1 = ProtocolVersion.newBuilder()
59 .setVersion(CommonProtos2.newVersion(2, 0)).build();
61 /** Version of the client currently being used by the client. */
62 public static final Version CLIENT_VERSION_VALUE =
63 CommonProtos2.newVersion(CLIENT_MAJOR_VERSION, CLIENT_MINOR_VERSION);
65 /** The value of ObjectSource.Type from types.proto. Must be kept in sync with that file. */
66 public static final int INTERNAL_OBJECT_SOURCE_TYPE = ObjectSource.Type.INTERNAL.getNumber();
68 /** The value of ObjectSource.Type from types.proto. Must be kept in sync with that file. */
69 public static final int TEST_OBJECT_SOURCE_TYPE = ObjectSource.Type.TEST.getNumber();
71 /** The value of ClientType.Type from types.proto. Must be kept in sync with that file. */
72 public static final int INTERNAL_CLIENT_TYPE = ClientType.Type.INTERNAL.getNumber();
74 /** The value of ClientType.Type from types.proto. Must be kept in sync with that file. */
75 public static final int TEST_CLIENT_TYPE = ClientType.Type.TEST.getNumber();
77 /** Object id used to trigger a refresh of all cached objects ("invalidate-all"). */
78 public static final ObjectIdP ALL_OBJECT_ID = ObjectIdP.newBuilder()
79 .setName(ByteString.EMPTY)
80 .setSource(INTERNAL_OBJECT_SOURCE_TYPE)