Upstream version 10.38.222.0
[platform/framework/web/crosswalk.git] / src / third_party / cacheinvalidation / src / java / com / google / ipc / invalidation / common / CommonInvalidationConstants2.java
1 /*
2  * Copyright 2011 Google Inc.
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 package com.google.ipc.invalidation.common;
18
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;
25
26 /**
27  * Various constants common to  clients and servers used in version 2 of the Ticl.
28  *
29  */
30 public class CommonInvalidationConstants2 {
31
32   /** Major version of the client library. */
33   public static final int CLIENT_MAJOR_VERSION = 3;
34
35   /**
36    * Minor version of the client library, defined to be equal to the datestamp of the build
37    * (e.g. 20130401).
38    */
39   public static final int CLIENT_MINOR_VERSION = BuildConstants.BUILD_DATESTAMP;
40
41   /** Major version of the protocol between the client and the server. */
42   public static final int PROTOCOL_MAJOR_VERSION = 3;
43
44   /** Minor version of the protocol between the client and the server. */
45   public static final int PROTOCOL_MINOR_VERSION = 2;
46
47   /** Major version of the client config. */
48   public static final int CONFIG_MAJOR_VERSION = 3;
49
50   /** Minor version of the client config. */
51   public static final int CONFIG_MINOR_VERSION = 2;
52
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();
56
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();
60
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);
64
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();
67
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();
70
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();
73
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();
76
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)
81       .build();
82 }