Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / cacheinvalidation / src / proto / android_listener.proto
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 // Specification of protocols used by the AndroidListener abstraction.
18 //
19 // Note: unless otherwise specified in a comment, all fields in all messages
20 // are required, even though they are listed as optional.
21
22 syntax = "proto2";
23
24 package com.google.protos.ipc.invalidation;
25
26 option optimize_for = LITE_RUNTIME;
27
28
29 option java_outer_classname = "NanoAndroidListenerProtocol";
30 option java_package = "com.google.protos.ipc.invalidation";
31
32
33 import "client.proto";
34 import "client_protocol.proto";
35
36 // Used to persist internal state between instantiations of Android listener
37 // objects.
38 message AndroidListenerState {
39   // When a registration request has failed, we track state for that object that
40   // allows retries to be delayed using exponential backoff.
41   message RetryRegistrationState {
42     // Identifier of the object for which there has been a failure.
43     optional ObjectIdP object_id = 1;
44
45     // State of exponential backoff delay generator that is used to delay any
46     // registration retries for the object.
47     optional ExponentialBackoffState exponential_backoff_state = 2;
48   }
49
50   // Set of object ids tracking the application's desired registrations.
51   repeated ObjectIdP registration = 1;
52
53   // Set of states for registrations retries. When there is a transient
54   // registration failure relative to an object, an entry is added. If
55   // registration is successful or the user gives up on the request, the entry
56   // is removed.
57   repeated RetryRegistrationState retry_registration_state = 2;
58
59   // Identifier of client with which this listener is associated. This client ID
60   // is randomly generated by the Android listener whenever a new client is
61   // started and has no relationship to 's application client ID.
62   optional bytes client_id = 3;
63
64   // Sequence number for alarm manager request codes. Sequence numbers are
65   // assigned serially for each distinct client_id. This value indicates
66   // the request code used for the last request.
67   optional int32 request_code_seq_num = 4;
68 }
69
70 // Represents a command that registers or unregisters a set of objects. The
71 // command may be initiated by the application or by the Android listener when
72 // there is a registration failure.
73 message RegistrationCommand {
74   // Indicates whether this is a register command (when true) or unregister
75   // (when false) request.
76   optional bool is_register = 1;
77
78   // Identifies the objects to register or unregister.
79   repeated ObjectIdP object_id = 2;
80
81   // Identifier of client with which this listener is associated.
82   optional bytes client_id = 3;
83
84   // Indicates whether this is a delayed registration command. When a
85   // registration command intent is handled by the Android listener, this field
86   // is used to determine whether the command has been delayed yet or not. If it
87   // has not already been delayed, the listener may choose to defer the command
88   // until later.
89   optional bool is_delayed = 4;
90 }
91
92 // Represents a command that starts an Android invalidation client.
93 message StartCommand {
94   // Type of client to start.
95   optional int32 client_type = 1;
96
97   // Name of client to start.
98   optional bytes client_name = 2;
99
100   // Whether suppression is permitted for this client.
101   optional bool allow_suppression = 3;
102 }
103