/*
 * 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 only on the client
// side.
//
// 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 = "Client";





import "client_protocol.proto";

// An object that is serialized and given to clients for acknowledgement
// purposes.
message AckHandleP {
  optional InvalidationP invalidation = 1;
}

// The state persisted at a client so that it can be used after a reboot.
message PersistentTiclState {
  // Last token received from the server (required).
  optional bytes client_token = 1;

  // Last time a message was sent to the server (optional). Must be a value
  // returned by the clock in the Ticl system resources.
  optional int64 last_message_send_time_ms = 2 [default = 0];
}

// An envelope containing a Ticl's internal state, along with a digest of the
// serialized representation of this state, to ensure its integrity across
// reads and writes to persistent storage.
message PersistentStateBlob {
  // The (important parts of the) Ticl's internal state.
  optional PersistentTiclState ticl_state = 1;

  // Implementation-specific message authentication code for the Ticl state.
  optional bytes authentication_code = 2;
}

// State of a Ticl RunState.
message RunStateP {
  enum State {
    NOT_STARTED = 1;
    STARTED = 2;
    STOPPED = 3;
  }
  optional State state = 1;
}

// Fields in this message correspond directly to fields in
// ExponentialBackoffDelayGenerator.
message ExponentialBackoffState {
  optional int32 current_max_delay = 1;
  optional bool in_retry_mode = 2;
}
