blob: cd3287e27448af90eec2ef4269723f62c9a03650 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// Specification of protocol buffers that are used with the Android
// service.
//
// Note: unless otherwise specified in a comment, all fields in all messages
// are required, even though they are listed as optional.
syntax = "proto2";
package com.google.protos.ipc.invalidation;
option optimize_for = LITE_RUNTIME;
option java_outer_classname = "AndroidService";
import "client_protocol.proto";
import "java_client.proto";
// Call from application to Ticl.
message ClientDowncall {
message StartDowncall {}
message StopDowncall {}
message AckDowncall {
optional bytes ack_handle = 1;
}
message RegistrationDowncall {
repeated ObjectIdP registrations = 1;
repeated ObjectIdP unregistrations = 2;
}
// Serial number to prevent intent reordering.
// TODO: use.
optional int64 serial = 1;
optional Version version = 2;
// Exactly one of the following fields must be set.
optional StartDowncall start = 3;
optional StopDowncall stop = 4;
optional AckDowncall ack = 5;
optional RegistrationDowncall registrations = 6;
}
// Internal (non-public) call from application to Ticl.
message InternalDowncall {
message ServerMessage {
optional bytes data = 1;
}
message NetworkStatus {
optional bool is_online = 1;
}
message CreateClient {
optional int32 client_type = 1; // client type code.
optional bytes client_name = 2; // application client id.
optional ClientConfigP client_config = 3; // Client config.
// Whether the client should not be started on creation. Must always be
// false for production use.
optional bool skip_start_for_test = 4;
}
optional Version version = 1;
// Exactly one must be set.
optional ServerMessage server_message = 2;
optional NetworkStatus network_status = 3;
optional bool network_addr_change = 4;
optional CreateClient create_client = 5;
}
// Upcall from Ticl to application listener.
message ListenerUpcall {
message ReadyUpcall {}
message InvalidateUpcall {
// Required.
optional bytes ack_handle = 1;
// Exactly one must be set.
optional InvalidationP invalidation = 2;
optional ObjectIdP invalidate_unknown = 3;
optional bool invalidate_all = 4;
}
message RegistrationStatusUpcall {
optional ObjectIdP object_id = 1;
optional bool is_registered = 2;
}
message RegistrationFailureUpcall {
optional ObjectIdP object_id = 1;
optional bool transient = 2;
optional string message = 3;
}
message ReissueRegistrationsUpcall {
optional bytes prefix = 1;
optional int32 length = 2;
}
message ErrorUpcall {
optional int32 error_code = 1;
optional string error_message = 2;
optional bool is_transient = 3;
}
// Serial number to prevent intent reordering. Not currently used.
// TODO: use
optional int64 serial = 1;
optional Version version = 2;
// Exactly one must be sent.
optional ReadyUpcall ready = 3;
optional InvalidateUpcall invalidate = 4;
optional RegistrationStatusUpcall registration_status = 5;
optional RegistrationFailureUpcall registration_failure = 6;
optional ReissueRegistrationsUpcall reissue_registrations = 7;
optional ErrorUpcall error = 8;
}
// Internal proto used by the Android scheduler to represent an event to run.
message AndroidSchedulerEvent {
optional Version version = 1;
// Name of the recurring task to execute.
optional string event_name = 2;
// Generation number of the Ticl with which this event is associated. Used to
// prevent old events from accidentally firing on new Ticls.
optional int64 ticl_id = 3;
}
// Internal proto used by the Android network to represent a message to send
// to the data center from the client.
message AndroidNetworkSendRequest {
optional Version version = 1; // Required
optional bytes message = 2; // Required
}
// Protocol buffer used to store state for a persisted Ticl.
message AndroidTiclState {
message Metadata {
// All fields are required.
optional int32 client_type = 1; // client type code.
optional bytes client_name = 2; // application client id.
optional int64 ticl_id = 3; // Ticl uniquifier.
optional ClientConfigP client_config = 4; // client config.
}
optional Version version = 1;
optional InvalidationClientState ticl_state = 2; // Marshalled Ticl.
optional Metadata metadata = 3; // Extra state needed to construct a Ticl.
}
// An AndroidTiclState state plus a digest; this is the protocol buffer actually
// stored persistently by the service.
message AndroidTiclStateWithDigest {
optional AndroidTiclState state = 1;
optional bytes digest = 2; // Digest of "state."
}
|