| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you 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. |
| // |
| // Author: thorogood@google.com (Sam Thorogood) |
| // |
| // Internal protocol buffers used as part of the client-server RPC subsystem. |
| // This package also provides options which must be used to better define the |
| // way messages are passed between client/server. |
| |
| syntax = "proto2"; |
| |
| import "google/protobuf/descriptor.proto"; |
| |
| package rpc; |
| |
| option java_package = "org.waveprotocol.box.server.rpc"; |
| option java_outer_classname = "Rpc"; |
| |
| extend google.protobuf.MethodOptions { |
| /** |
| * Mark a service method as a streaming RPC. This indicates that the server |
| * end-point of this RPC may return 0-n responses before it is complete. |
| * |
| * Completion of this RPC should be specified by finally passing null as a |
| * result to the callback provided to the interface implementation. Or, by |
| * raising an error condition as normal (through setFailed on the controller). |
| */ |
| // TODO: Create a message type for options instead of using a single bool. |
| optional bool is_streaming_rpc = 1003 [default = false]; |
| } |
| |
| /** |
| * Used internally by the RPC subsystem. |
| * |
| * Passed from client -> server to indicate that a RPC, streaming or otherwise, |
| * should be cancelled. The server still has a responsibility to finish the RPC |
| * in a standard manner, and this is purely a request. |
| */ |
| message CancelRpc { |
| } |
| |
| /** |
| * Used internally by the RPC subsystem. |
| * |
| * Passed from server -> client in two cases; |
| * - a streaming RPC has finished, in which case failed may be true or false |
| * - a normal RPC has failed, in which case failed must be true |
| */ |
| message RpcFinished { |
| required bool failed = 1; |
| optional string error_text = 2; |
| } |