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