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 // Specification of protocols used by the AndroidListener abstraction.
19 // Note: unless otherwise specified in a comment, all fields in all messages
20 // are required, even though they are listed as optional.
24 package com.google.protos.ipc.invalidation;
26 option optimize_for = LITE_RUNTIME;
28 option java_outer_classname = "AndroidListenerProtocol";
34 import "client.proto";
35 import "client_protocol.proto";
37 // Used to persist internal state between instantiations of Android listener
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;
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;
51 // Set of object ids tracking the application's desired registrations.
52 repeated ObjectIdP registration = 1;
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
58 repeated RetryRegistrationState retry_registration_state = 2;
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;
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;
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;
79 // Identifies the objects to register or unregister.
80 repeated ObjectIdP object_id = 2;
82 // Identifier of client with which this listener is associated.
83 optional bytes client_id = 3;
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
90 optional bool is_delayed = 4;
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;
98 // Name of client to start.
99 optional bytes client_name = 2;