http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/box/common/comms/waveclient-rpc.proto
----------------------------------------------------------------------
diff --git 
a/wave-proto/src/main/proto/org/waveprotocol/box/common/comms/waveclient-rpc.proto
 
b/wave-proto/src/main/proto/org/waveprotocol/box/common/comms/waveclient-rpc.proto
deleted file mode 100644
index 7b308a8..0000000
--- 
a/wave-proto/src/main/proto/org/waveprotocol/box/common/comms/waveclient-rpc.proto
+++ /dev/null
@@ -1,199 +0,0 @@
-// 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.
-//
-// The wave view client-server protocol
-//
-// Author: [email protected] (Jochen Bekmann)
-// Author: [email protected] (Alex North)
-
-syntax = "proto2";
-
-import "org/waveprotocol/box/server/rpc/rpc.proto";
-import "org/waveprotocol/wave/federation/federation.protodevel";
-
-package waveserver;
-
-option java_package = "org.waveprotocol.box.common.comms";
-option java_outer_classname = "WaveClientRpc";
-option java_generic_services = true;
-
-/**
- * Provides streaming wave views.
- *
- * A client requests a possibly filtered view of wavelets in a wave.
- * The response stream contains first a snapshot for each wavelet
- * currently in view, and then deltas for those wavelets. The end of
- * the initial set of snapshots is indicated by a "marker" message.
- * New wavelets may come into view after the marker, resulting in 
- * another snapshot.
- * 
- * The client may indicate that it already has a snapshot for some wavelets
- * by providing one or more known versions and signatures. If one matches
- * the server history the server will not send a snapshot but will instead
- * begin the stream with an empty delta specifying the resynchronization
- * version.
- * 
- * TODO(anorth):
- * - make the first response message a channel id only, then no more
- *   channel ids
- */
-service ProtocolWaveClientRpc {
-  rpc Open (ProtocolOpenRequest) returns (ProtocolWaveletUpdate) {
-    option (rpc.is_streaming_rpc) = true;
-  };
-  rpc Submit (ProtocolSubmitRequest) returns (ProtocolSubmitResponse);
-  rpc Authenticate (ProtocolAuthenticate) returns 
(ProtocolAuthenticationResult);
-}
-
-// A workaround for clients which do not support sending cookies over a 
websocket
-// connection. See: http://code.google.com/p/wave-protocol/issues/detail?id=119
-message ProtocolAuthenticate {
-  required string token = 1;
-}
-
-// RPCs require a return type, although in this case no return data is desired.
-// We don't want to return anything here because clients which implement
-// websockets correctly (and thus don't use ProtocolAuthenticate) cannot
-// recieve the authentication related information.
-// If the client's authentication is not valid, the connection will be closed.
-message ProtocolAuthenticationResult {
-}
-
-/**
- * A request to open a wave view.
- */
-message ProtocolOpenRequest {
-  // User making the request.
-  // TODO(anorth): Remove this, replacing it with the implicit logged-in user.
-  required string participant_id = 1;
-  // Wave id to open.
-  required string wave_id = 2;
-  // Wavelet id prefixes by which to filter the view, empty means no filter.
-  repeated string wavelet_id_prefix = 3;
-  // Known wavelet versions for resynchronization.
-  repeated WaveletVersion known_wavelet = 4;
-}
-
-// A pair of (wavelet id, wavelet version)
-message WaveletVersion {
-  required string wavelet_id = 1;
-  required federation.ProtocolHashedVersion hashed_version = 2;
-}
-
-// A document and associated metadata
-message DocumentSnapshot {
-  required string document_id = 1;
-  // This is a document operation that takes the document from zero to its 
current state.
-  required federation.ProtocolDocumentOperation document_operation = 2;
-
-  // ** Metadata
-  // The participant who submitted the first operation to the document
-  required string author = 3;
-  // All participants who have submitted operations to the document
-  repeated string contributor = 4;
-  // The wavelet version when the document was last modified
-  required int64 last_modified_version = 5;
-  required int64 last_modified_time = 6;
-}
-
-// A wavelet and associated metadata.
-message WaveletSnapshot {
-  required string wavelet_id = 1;
-  // The list of participants of this wavelet.
-  repeated string participant_id = 2;
-  // Snapshots of all the documents in the wavelet.
-  repeated DocumentSnapshot document = 3;
-
-  // ** Metadata
-  // The current version of the wavelet
-  required federation.ProtocolHashedVersion version = 4;
-  // The participant that created the wavelet
-  required int64 last_modified_time = 5;
-  required string creator = 6;
-  required int64 creation_time = 7;
-}
-
-// A snapshot of a user's view of a wave.
-// Contains snapshots of all the wavelets visible to a user
-message WaveViewSnapshot {
-  required string wave_id = 1;
-  repeated WaveletSnapshot wavelet = 2;
-}
-
-/**
- * Update message for a wave view.
- * Contains either:
- * - a channel id (only)
- * - a marker (only)
- * - a wavelet name, snapshot, version, and commit version
- * - a wavelet name, deltas, version
- * Must contain either one or more applied deltas or a commit notice.
- *
- * TODO(anorth): rename to reflect that this is a view update, not wavelet
- */
-message ProtocolWaveletUpdate {
-  // Specifies the wavelet name in the URI netpath notation.
-  // Set only if there are deltas
-  // TODO(anorth) make optional for channel id, marker updates
-  required string wavelet_name = 1;
-
-  // Zero or more deltas for this wavelet, streamed in order.
-  // If snapshot is set, there should be zero deltas.
-  // TODO(soren): consider using this in the snapshot case for uncommitted 
deltas.
-  repeated federation.ProtocolWaveletDelta applied_delta = 2;
-
-  // Indicates that the host server has committed the wavelet to disk at the
-  // given version. Mandatory for snapshots.
-  optional federation.ProtocolHashedVersion commit_notice = 3;
-
-  // Resulting version of the wavelet after all deltas have been applied
-  // May only be missing if there are no appliedDeltas
-  // If snapshot is set, this is the version number of the snapshot, and is
-  // mandatory.
-  optional federation.ProtocolHashedVersion resulting_version = 4;
-
-  // An optional snapshot of the wavelet
-  optional WaveletSnapshot snapshot = 5;
-
-  // View open marker, signifies all current snapshots have been sent.
-  optional bool marker = 6 [default=false];
-
-  // Channel id, set only in the first update to a client.
-  // The client includes it in submits.
-  optional string channel_id = 7;
-}
-
-/**
- * The client requests that the given delta be applied to the wavelet.
- */
-message ProtocolSubmitRequest {
-  required string wavelet_name = 1;
-  required federation.ProtocolWaveletDelta delta = 2;
-  optional string channel_id = 3;
-}
-
-/**
- * The result of submitting the delta to the server. If an error occurs
- * errorMessage will be present, otherwise hashedVersionAfterApplication will 
be
- * present. operationsApplied will report the actual number of operations
- * successfully applied to the wavelet by the server.
- */
-message ProtocolSubmitResponse {
-  required int32 operations_applied = 1;
-  optional string error_message = 2;
-  optional federation.ProtocolHashedVersion hashed_version_after_application = 
3;
-}

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/box/profile/profiles.proto
----------------------------------------------------------------------
diff --git 
a/wave-proto/src/main/proto/org/waveprotocol/box/profile/profiles.proto 
b/wave-proto/src/main/proto/org/waveprotocol/box/profile/profiles.proto
deleted file mode 100644
index 4370ee1..0000000
--- a/wave-proto/src/main/proto/org/waveprotocol/box/profile/profiles.proto
+++ /dev/null
@@ -1,51 +0,0 @@
-// 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.
-//
-// The profile fetch request and response.
-//
-// Author: [email protected] (Yuri Zelikov)
-
-syntax = "proto2";
-
-package profile;
-
-option java_package = "org.waveprotocol.box.profile";
-option java_outer_classname = "ProfilesProto";
-
-
-message ProfileRequest {
-  // The profile addresses in email format.
-  repeated string addresses = 1;
-}
-
-message ProfileResponse {
-  
-  message FetchedProfile {
-    // The profile address in email format.
-    required string address = 1;
-    // The name.
-    required string name = 2;
-    // The image URL.
-    required string imageUrl = 3;
-    // The link to website.
-    optional string profileUrl = 4;
-  }
-  
-  // The fetched profiles.
-  repeated FetchedProfile profiles = 1;
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/box/search/search.proto
----------------------------------------------------------------------
diff --git a/wave-proto/src/main/proto/org/waveprotocol/box/search/search.proto 
b/wave-proto/src/main/proto/org/waveprotocol/box/search/search.proto
deleted file mode 100644
index 889ee05..0000000
--- a/wave-proto/src/main/proto/org/waveprotocol/box/search/search.proto
+++ /dev/null
@@ -1,68 +0,0 @@
-// 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.
-//
-// The search query and response.
-//
-// Author: [email protected] (Yuri Z.)
-
-syntax = "proto2";
-
-package search;
-
-option java_package = "org.waveprotocol.box.search";
-option java_outer_classname = "SearchProto";
-
-
-message SearchRequest {
-  // The query to execute.
-  required string query = 1;
-  // The index from which to return results.
-  required int32 index = 2;
-  // The number of results to return.
-  required int32 numResults = 3;
-}
-
-message SearchResponse {
-  // The wave list digest.
-  message Digest {
-    // The wave title.
-       required string title = 1;
-       // The text snippet.
-       required string snippet = 2;
-       // Serialized wave id
-       required string waveId = 3;
-       // Last modified time of the wave.
-       required int64 lastModified = 4;
-       // Unread count for the user.
-       required int32 unreadCount = 5;
-       // Number of blips in the wave.
-       required int32 blipCount = 6;
-       // Wave participants.
-       repeated string participants = 7;
-       // The wave author.
-       required string author = 8;
-  }
-
-  // The search query.
-  required string query = 1;
-  // The total number of results to the query (not necessarily all returned).
-  required int32 totalResults = 2;
-  // A list of digests, representing the segment [index, index + result_count] 
-  // from the query parameters.
-  repeated Digest digests = 3;
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/box/server/persistence/protos/account-store.proto
----------------------------------------------------------------------
diff --git 
a/wave-proto/src/main/proto/org/waveprotocol/box/server/persistence/protos/account-store.proto
 
b/wave-proto/src/main/proto/org/waveprotocol/box/server/persistence/protos/account-store.proto
deleted file mode 100644
index cd52a51..0000000
--- 
a/wave-proto/src/main/proto/org/waveprotocol/box/server/persistence/protos/account-store.proto
+++ /dev/null
@@ -1,78 +0,0 @@
-// 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.
-//
-// Account Data data structures. These are used as the on-disk representation 
of the internal
-// AccountData classes.
-//
-// Author: [email protected] (Tad Glines)
-
-syntax = "proto2";
-
-package protoaccountstore;
-
-option java_package = "org.waveprotocol.box.server.persistence.protos";
-option java_outer_classname = "ProtoAccountStoreData";
-
-// Represents an AccountData instance
-message ProtoAccountData {
-       enum AccountDataType {
-               HUMAN_ACCOUNT = 1;
-               ROBOT_ACCOUNT = 2;
-       }
-
-       required AccountDataType account_type = 1;
-       
-       // The participant id
-       required string account_id = 2;
-
-       // One must be provided depending on the value of account_type. 
-       optional ProtoHumanAccountData human_account_data = 3;
-       optional ProtoRobotAccountData robot_account_data = 4;
-}
-
-// Data specific to a human account
-message ProtoHumanAccountData {
-       optional ProtoPasswordDigest password_digest = 1;
-}
-
-// The values from a PAsswordDigest instance
-message ProtoPasswordDigest {
-       required bytes salt = 1;
-       required bytes digest = 2;
-}
-
-// Data specific to a robot account
-message ProtoRobotAccountData {
-       required string url = 1;
-       required string consumer_secret = 2;
-       optional ProtoRobotCapabilities robot_capabilities = 3;
-       required bool is_verified = 4;
-}
-
-// Data found in a RobotCapabilities instance
-message ProtoRobotCapabilities {
-       required string capabilities_hash = 1;
-       required string protocol_version = 2;
-       repeated ProtoRobotCapability capability = 3;
-}
-
-// Data found in a com.google.api.robot.Capability instance
-message ProtoRobotCapability {
-       required string event_type = 1;
-       repeated string context = 2;
-       required string filter = 3;
-}

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/box/server/persistence/protos/delta-store.proto
----------------------------------------------------------------------
diff --git 
a/wave-proto/src/main/proto/org/waveprotocol/box/server/persistence/protos/delta-store.proto
 
b/wave-proto/src/main/proto/org/waveprotocol/box/server/persistence/protos/delta-store.proto
deleted file mode 100644
index 09b1adb..0000000
--- 
a/wave-proto/src/main/proto/org/waveprotocol/box/server/persistence/protos/delta-store.proto
+++ /dev/null
@@ -1,38 +0,0 @@
-
-// 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.
-//
-// Account Data data structures. These are used as the on-disk representation 
of the internal
-// AccountData classes.
-//
-// Author: [email protected] (Tad Glines)
-
-syntax = "proto2";
-
-import "org/waveprotocol/wave/federation/federation.protodevel";
-
-package protodeltastore;
-
-option java_package = "org.waveprotocol.box.server.persistence.protos";
-option java_outer_classname = "ProtoDeltaStoreData";
-
-message ProtoTransformedWaveletDelta {
-  required string author = 1;
-  required federation.ProtocolHashedVersion resulting_version = 2;
-  required int64 application_timestamp = 3;
-  repeated federation.ProtocolWaveletOperation operation = 4;
-}

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/box/server/rpc/rpc.proto
----------------------------------------------------------------------
diff --git 
a/wave-proto/src/main/proto/org/waveprotocol/box/server/rpc/rpc.proto 
b/wave-proto/src/main/proto/org/waveprotocol/box/server/rpc/rpc.proto
deleted file mode 100644
index 370cd74..0000000
--- a/wave-proto/src/main/proto/org/waveprotocol/box/server/rpc/rpc.proto
+++ /dev/null
@@ -1,66 +0,0 @@
-// 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: [email protected] (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;
-}

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/protobuf/build.xml
----------------------------------------------------------------------
diff --git a/wave-proto/src/main/proto/org/waveprotocol/protobuf/build.xml 
b/wave-proto/src/main/proto/org/waveprotocol/protobuf/build.xml
deleted file mode 100644
index 264c5c0..0000000
--- a/wave-proto/src/main/proto/org/waveprotocol/protobuf/build.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
-
- 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.
-
--->
-<project name="extensions">
-  <import file="${build.common.path}"/>
-  <property name="libname" value="extensions"/>
-  <patternset id="srcs">
-    <include name="org/waveprotocol/protobuf/*"/>
-  </patternset>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/protobuf/extensions.proto
----------------------------------------------------------------------
diff --git 
a/wave-proto/src/main/proto/org/waveprotocol/protobuf/extensions.proto 
b/wave-proto/src/main/proto/org/waveprotocol/protobuf/extensions.proto
deleted file mode 100644
index 27f2901..0000000
--- a/wave-proto/src/main/proto/org/waveprotocol/protobuf/extensions.proto
+++ /dev/null
@@ -1,34 +0,0 @@
-// 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.
-
-syntax = "proto2";
-
-import "google/protobuf/descriptor.proto";
-
-option java_package = "org.waveprotocol.protobuf";
-option java_outer_classname = "Extensions";
-
-extend google.protobuf.FieldOptions {
-  // Annotates an int64, noting that only the lower 52 bits are important.
-  // This allows languages without 64-bit primitives (like JavaScript) to use
-  // other primtive types instead.
-  //
-  // Annotation ids are apparently meant to be globally unique.  Not sure why,
-  // given that proto names and field ids do not have to be globally unique.
-  // If it becomes an issue, get a unique number from the number distributor.
-  optional bool int52 = 50000 [default = false];
-}

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/wave/concurrencycontrol/clientserver.proto
----------------------------------------------------------------------
diff --git 
a/wave-proto/src/main/proto/org/waveprotocol/wave/concurrencycontrol/clientserver.proto
 
b/wave-proto/src/main/proto/org/waveprotocol/wave/concurrencycontrol/clientserver.proto
deleted file mode 100644
index 17c20a7..0000000
--- 
a/wave-proto/src/main/proto/org/waveprotocol/wave/concurrencycontrol/clientserver.proto
+++ /dev/null
@@ -1,268 +0,0 @@
-// 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.
-//
-// The wave client-server protocol.
-// See 
http://www.waveprotocol.org/protocol/design-proposals/clientserver-protocol
-//
-// Author: [email protected] (Alex North)
-
-syntax = "proto2";
-
-import "org/waveprotocol/box/server/rpc/rpc.proto";
-import "org/waveprotocol/wave/federation/federation.protodevel";
-
-package concurrencycontrol;
-
-option java_package = "org.waveprotocol.wave.concurrencycontrol";
-option java_outer_classname = "ClientServer";
-
-
-/*
- *** Fetch service. ***
- * Provides snapshots describing a client's view of a wave.
- * As a bandwidth optimization, the client may specify that it already has
- * snapshots of some wavelets at some version (such as from a previous fetch).
- * If the server's current version matches the version the client provides
- * then the snapshot is omitted from the response.
- */
-service FetchService {
-  rpc Fetch(FetchWaveViewRequest) returns (FetchWaveViewResponse);
-}
-
-message FetchWaveViewRequest {
-  // Wave to open, URI path format.
-  required string waveId = 1;
-  // Wavelet versions the client already knows.
-  // At most one version per wavelet.
-  repeated WaveletVersion knownWavelet = 2;
-}
-
-message FetchWaveViewResponse {
-  required ResponseStatus status = 1;
-  
-  message Wavelet {
-    // The wavelet in view, URI path format.
-    required string waveletId = 1;
-    // Snapshot of the wavelet; omitted if the client already knew it.
-    optional WaveletSnapshot snapshot = 2;
-  }
-  repeated Wavelet wavelet = 2;
-}
-
-/* A wavelet with a known hashed version of that wavelet. */
-message WaveletVersion {
-  // Known wavelet, URI path format.
-  required string waveletId = 1;
-  // Known hashed version of the wavelet.
-  required federation.ProtocolHashedVersion version = 2;
-}
-
-/* A wavelet and associated metadata. */
-message WaveletSnapshot {
-  // Wavelet's id, URI path format.
-  required string waveletId = 1;
-  // Participants of this wavelet.
-  repeated string participant = 2;
-  // Snapshots of all the documents in the wavelet.
-  repeated DocumentSnapshot document = 3;
-
-  //// Metadata ////
-  // Current version and modification timestamp of the wavelet.
-  required federation.ProtocolHashedVersion version = 4;
-  required int64 lastModifiedTime = 5;
-  // Participant and time of creation for the wavelet.
-  required string creator = 6;
-  required int64 creationTime = 7;
-}
-
-/* A document and associated metadata. */
-message DocumentSnapshot {
-  // Id of the document.
-  required string documentId = 1;
-  // Operation that transforms an empty document the document state.
-  required federation.ProtocolDocumentOperation documentOperation = 2;
-
-  //// Metadata ////
-  // Participant who submitted the first operation to the document.
-  required string author = 3;
-  // All participants who have submitted operations to the document.
-  repeated string contributor = 4;
-  // Wavelet version and timestamp when the document was last modified.
-  required int64 lastModifiedVersion = 5;
-  required int64 lastModifiedTime = 6;
-}
-
-/*
- *** Wavelet channel service. ***
- * Provides a uni-directional stream of deltas for a single wavelet,
- * beginning at the delta applying at a client-specified version.
- * The stream continues until either the client requests the channel
- * be closed or a terminating message is received. Deltas submitted
- * with this channel's id are excluded from the stream. There is no
- * ordering guarantee between this service and responses from the
- * delta submission service.
- */
-service WaveletChannelService {
-  rpc Open(OpenWaveletChannelRequest) returns (OpenWaveletChannelStream) {
-      option (rpc.is_streaming_rpc) = true;
-  };
-  rpc Close(CloseWaveletChannelRequest) returns (EmptyResponse);
-}
-
-message OpenWaveletChannelRequest {
-  // Wave id, URI path format.
-  required string waveId = 1;
-  // Wavelet id, URI path format.
-  required string waveletId = 2;
-  // Application version of first delta to return.
-  required federation.ProtocolHashedVersion beginVersion = 3;
-}
-
-/** Repeated message for a wavelet channel. */
-message OpenWaveletChannelStream {
-  // Identifies the channel, provided only in the first message.
-  optional string channelId = 1;
-
-  // Second and subsequent messages contain either or both a delta
-  // and commitVersion.
-  optional WaveletUpdate delta = 2;
-  optional federation.ProtocolHashedVersion commitVersion = 3;
-
-  // Last message contains only a terminator.
-  optional WaveletChannelTerminator terminator = 4;
-}
-
-message CloseWaveletChannelRequest {
-  // Channel to close.
-  required string channelId = 1;
-}
-
-/** A delta applied to a wavelet. */
-message WaveletUpdate {
-  // Transformed delta.
-  required federation.ProtocolWaveletDelta delta = 1;
-  // Wavelet hashed version after the delta.
-  required federation.ProtocolHashedVersion resultingVersion = 2;
-  // Timestamp of delta application.
-  required int64 applicationTimpstamp = 3;
-}
-
-/** Terminates a wavelet stream. */
-message WaveletChannelTerminator {
-  required ResponseStatus status = 1;
-}
-
-
-/*
- *** Delta submission service. ***
- * Receives deltas submitted against wavelets.
- * Deltas are submitted in association with a wavelet channel (see
- * WaveletChannelService).
- */
-service DeltaSubmissionService {
-  rpc Submit(SubmitDeltaRequest) returns (SubmitDeltaResponse);
-}
-
-message SubmitDeltaRequest {
-  // Wave to submit to, URI path format.
-  required string waveId = 1;
-  // Wavelet to submit to, URI path format.
-  required string waveletId = 2;
-  // Delta to submit.
-  required federation.ProtocolWaveletDelta delta = 3;
-  // Wavelet channel associated with submission.
-  required string channelId = 4;
-}
-
-message SubmitDeltaResponse {
-  required ResponseStatus status = 1;
-
-  // Number of ops applied from the delta.
-  required int32 operationsApplied = 2;
-  // Wavelet hashed version after the delta.
-  optional federation.ProtocolHashedVersion hashedVersionAfterApplication = 3;
-  // Timestamp of delta application.
-  optional int64 timestampAfterApplication = 4;
-} 
-
-
-/*
- *** Transport authentication service. ***
- * Authenticates the underlying transport.
- * This service is required only to work around a bug in some browsers'
- * websocket implementations that fail to set cookies containing authentication
- * tokens.
- * If the client's authentication is invalid the server should close the
- * transport.
- * See: http://code.google.com/p/wave-protocol/issues/detail?id=119
- */
-service TransportAuthenticationService {
-  rpc Authenticate (TransportAuthenticationRequest) returns (EmptyResponse);
-}
-
-message TransportAuthenticationRequest {
-  // Authentication token.
-  required string token = 1;
-}
-
-
-/*** An empty message for services which have no application-level result. ***/
-message EmptyResponse {
-}
-
-/*** Response status for all services ***/
-message ResponseStatus {
-  enum ResponseCode {
-  // All good.
-  OK = 0;
-
-  // Request was ill-formed.
-  BAD_REQUEST = 1;
-
-  // An unspecified internal error occurred.
-  INTERNAL_ERROR = 2;
-
-  // The request was not authorized.
-  NOT_AUTHORIZED = 3;
-
-  // Hashed version didn't match a point in history.
-  VERSION_ERROR = 4;
-
-  // A delta contained an invalid operation (before or after transformation).
-  INVALID_OPERATION = 5;
-
-  // An operation didn't preserve a document schema.
-  SCHEMA_VIOLATION = 6;
-
-  // A delta is too big or the resulting document count or size is too large.
-  SIZE_LIMIT_EXCEEDED = 7;
-
-  // An operation was rejected by a server policy.
-  POLICY_VIOLATION = 8;
-
-  // An object is unavailable because it has been quarantined.
-  QUARANTINED = 9;
-
-  // A request was made against a version older than the server was willing
-  // to satisfy. Transform and retry.
-  TOO_OLD = 10;
-  }
-  
-  required ResponseCode status = 1;
-  // Reason must be provided if status != OK.
-  optional string failureReason = 2; 
-}

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/wave/diff/build.xml
----------------------------------------------------------------------
diff --git a/wave-proto/src/main/proto/org/waveprotocol/wave/diff/build.xml 
b/wave-proto/src/main/proto/org/waveprotocol/wave/diff/build.xml
deleted file mode 100644
index 0b2ffc0..0000000
--- a/wave-proto/src/main/proto/org/waveprotocol/wave/diff/build.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version='1.0'?>
-<!--
-
- 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.
-
--->
-<project name="diff">
-  <import file="${build.common.path}"/>
-  <property name="libname" value="diff"/>
-  <patternset id="srcs">
-    <include name="org/waveprotocol/wave/diff/**"/>
-  </patternset>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/wave/diff/diff.proto
----------------------------------------------------------------------
diff --git a/wave-proto/src/main/proto/org/waveprotocol/wave/diff/diff.proto 
b/wave-proto/src/main/proto/org/waveprotocol/wave/diff/diff.proto
deleted file mode 100644
index 1178a0b..0000000
--- a/wave-proto/src/main/proto/org/waveprotocol/wave/diff/diff.proto
+++ /dev/null
@@ -1,114 +0,0 @@
-// 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.
-//
-// The wave diff-on-open fetch service.
-//
-// Author: [email protected] (David Hearnden)
-//         [email protected] (Alex North)
-
-syntax = "proto2";
-
-import "org/waveprotocol/box/server/rpc/rpc.proto";
-import "org/waveprotocol/wave/concurrencycontrol/clientserver.proto";
-import "org/waveprotocol/wave/federation/federation.protodevel";
-import "org/waveprotocol/protobuf/extensions.proto";
-
-package diff;
-
-option java_package = "org.waveprotocol.wave.diff";
-option java_outer_classname = "Diff";
-
-
-/*
- *** Fetch service. ***
- * Provides snapshots describing a client's view of a wave, in diff format.
- * As a bandwidth optimization, the client may specify that it already has
- * snapshots of some wavelets at some version (such as from a previous fetch).
- * If the server's current version matches the version the client provides
- * then the snapshot is omitted from the response.
- */
-service FetchDiffService {
-  rpc Fetch(FetchDiffRequest) returns (FetchDiffResponse);
-}
-
-message FetchDiffRequest {
-  // Wave to open, URI path format.
-  required string waveId = 1;
-  // Wavelet versions the client already knows.
-  // At most one version per wavelet.
-  repeated concurrencycontrol.WaveletVersion knownWavelet = 2;
-}
-
-message FetchDiffResponse {
-  required concurrencycontrol.ResponseStatus status = 1;
-  
-  message WaveletDiff {
-    // The wavelet in view, URI path format.
-    required string waveletId = 1;
-    // Snapshot of the wavelet; omitted if the client already knew it.
-    optional WaveletDiffSnapshot snapshot = 2;
-  }
-  repeated WaveletDiff wavelet = 2;
-}
-
-/* A wavelet and associated metadata. */
-message WaveletDiffSnapshot {
-  // Wavelet's id, URI path format.
-  required string waveletId = 1;
-
-  // Participants of this wavelet.
-  repeated string participant = 2;
-  // Added participants of this wavelet;
-  repeated string addedParticipant = 21;
-  // Removed participants of this wavelet;
-  repeated string removedParticipant = 22;
-
-  // Snapshots of all the documents in the wavelet.
-  repeated DocumentDiffSnapshot document = 3;
-
-  //// Metadata ////
-  // Current version and modification timestamp of the wavelet.
-  required federation.ProtocolHashedVersion version = 4;
-  required int64 lastModifiedTime = 5 [(int52) = true];
-  // Participant and time of creation for the wavelet.
-  required string creator = 6;
-  required int64 creationTime = 7 [(int52) = true];
-}
-
-/* A document and associated metadata. */
-message DocumentDiffSnapshot {
-  // Id of the document.
-  required string documentId = 1;
-  // Operation that transforms an empty document the last-read document state.
-  optional federation.ProtocolDocumentOperation state = 2;
-
-  // Operation that transforms the last-read document state to the current 
state.
-  optional federation.ProtocolDocumentOperation diff = 21;
-
-  //// Metadata ////
-  // Participant who submitted the first operation to the document.
-  required string author = 3;
-  // All participants who have submitted operations to the document.
-  repeated string contributor = 4;
-  // Added participants who have submitted operations to the document.
-  repeated string addedContributor = 22;
-  // Removed participants who have submitted operations to the document.
-  repeated string removedContributor = 23;
-  // Wavelet version and timestamp when the document was last modified.
-  required int64 lastModifiedVersion = 5 [(int52) = true];
-  required int64 lastModifiedTime = 6 [(int52) = true];
-}

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/wave/federation/federation.protodevel
----------------------------------------------------------------------
diff --git 
a/wave-proto/src/main/proto/org/waveprotocol/wave/federation/federation.protodevel
 
b/wave-proto/src/main/proto/org/waveprotocol/wave/federation/federation.protodevel
deleted file mode 100644
index f5944ec..0000000
--- 
a/wave-proto/src/main/proto/org/waveprotocol/wave/federation/federation.protodevel
+++ /dev/null
@@ -1,247 +0,0 @@
-// 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.
-//
-// Google Wave Federation Protocol data structures.
-//
-// They are intended to be equivalent to the data structures in the
-// draft "Google Wave Federation Protocol Over XMPP" at
-// http://code.google.com/p/wave-protocol/source
-//
-// Author: [email protected] (Sam Thorogood), [email protected] (Soren 
Lassen)
-
-syntax = "proto2";
-
-package federation;
-
-import "org/waveprotocol/protobuf/extensions.proto";
-
-option java_package = "org.waveprotocol.wave.federation";
-option java_outer_classname = "Proto";
-
-/**
- * An immutable list of operations for contribution to a wavelet.
- * Specifies the contributor and the wavelet version that the
- * operations are intended to be applied to.  The host wave server
- * may apply the operations to the wavelet at the specified wavelet version
- * or it may accept them at a later version after operational transformation
- * against the operations at the intermediate wavelet versions.
- */
-message ProtocolWaveletDelta {
-  // Wavelet version that the delta is intended to be applied to.
-  required ProtocolHashedVersion hashed_version = 1;
-
-  // Wave address of the contributor. Must be an explicit wavelet participant,
-  // and may be different from the originator of this delta.
-  required string author = 2;
-
-  // Operations included in this delta.
-  repeated ProtocolWaveletOperation operation = 3;
-
-  /*
-   * The nodes on the "overt" path from the originator through the address
-   * access graph leading up to (but excluding) the author. The path excludes
-   * any initial segments of the complete path which come before a WRITE edge
-   * in the graph. This field is empty if the author is either the originator's
-   * entry point into the address graph or is accessed by a WRITE edge.
-   *
-   * For example, "[email protected]" may be the explicit participant 
of
-   * a wavelet, and is set as the author of a delta. However, this group is
-   * being asked to act on behalf of "[email protected]", who is a member
-   * of "wave-authors", which is in turn a member of "wave-discuss". In this
-   * example, the delta would be configured as such:
-   *  delta.author = "[email protected]"
-   *  delta.addressPath = ["[email protected]", 
"[email protected]"]
-   */
-  repeated string address_path = 4;
-}
-
-/**
- * Describes a wavelet version and the wavelet's history hash at that version.
- */
-message ProtocolHashedVersion {
-  required int64 version = 1 [(int52) = true];
-  required bytes history_hash = 2;
-}
-
-/**
- * An operation within a delta. Exactly one of the following seven fields must 
be set
- * for this operation to be valid.
- */
-message ProtocolWaveletOperation {
-
-  // A document operation. Mutates the contents of the specified document.
-  message MutateDocument {
-    required string document_id = 1;
-    required ProtocolDocumentOperation document_operation = 2;
-  }
-
-  // Adds a new participant (canonicalized wave address) to the wavelet.
-  optional string add_participant = 1;
-
-  // Removes an existing participant (canonicalized wave address) from the 
wavelet.
-  optional string remove_participant = 2;
-
-  // Mutates a document.
-  optional MutateDocument mutate_document = 3;
-
-  // Does nothing. True if set.
-  optional bool no_op = 4;
-}
-
-/**
- * A list of mutation components.
- */
-message ProtocolDocumentOperation {
-
-  /**
-   * A component of a document operation.  One (and only one) of the component
-   * types must be set.
-   */
-  message Component {
-
-    message KeyValuePair {
-      required string key = 1;
-      required string value = 2;
-    }
-
-    message KeyValueUpdate {
-      required string key = 1;
-      // Absent field means that the attribute was absent/the annotation
-      // was null.
-      optional string old_value = 2;
-      // Absent field means that the attribute should be removed/the annotation
-      // should be set to null.
-      optional string new_value = 3;
-    }
-
-    message ElementStart {
-      required string type = 1;
-      // MUST NOT have two pairs with the same key.
-      repeated KeyValuePair attribute = 2;
-    }
-
-    message ReplaceAttributes {
-      // This field is set to true if and only if both oldAttributes and
-      // newAttributes are empty.  It is needed to ensure that the optional
-      // replaceAttributes component field is not dropped during serialization.
-      optional bool empty = 1;
-      // MUST NOT have two pairs with the same key.
-      repeated KeyValuePair old_attribute = 2;
-      // MUST NOT have two pairs with the same key.
-      repeated KeyValuePair new_attribute = 3;
-    }
-
-    message UpdateAttributes {
-      // This field is set to true if and only if attributeUpdates are empty.
-      // It is needed to ensure that the optional updateAttributes
-      // component field is not dropped during serialization.
-      optional bool empty = 1;
-      // MUST NOT have two updates with the same key.
-      repeated KeyValueUpdate attribute_update = 2;
-    }
-
-    message AnnotationBoundary {
-      // This field is set to true if and only if both ends and changes are
-      // empty.  It is needed to ensure that the optional annotationBoundary
-      // component field is not dropped during serialization.
-      optional bool empty = 1;
-      // MUST NOT have the same string twice.
-      repeated string end = 2;
-      // MUST NOT have two updates with the same key.  MUST NOT
-      // contain any of the strings listed in the 'end' field.
-      repeated KeyValueUpdate change = 3;
-    }
-
-    optional AnnotationBoundary annotation_boundary = 1;
-    optional string characters = 2;
-    optional ElementStart element_start = 3;
-    optional bool element_end = 4;
-    optional int32 retain_item_count = 5;
-    optional string delete_characters = 6;
-    optional ElementStart delete_element_start = 7;
-    optional bool delete_element_end = 8;
-    optional ReplaceAttributes replace_attributes = 9;
-    optional UpdateAttributes update_attributes = 10;
-  }
-
-  repeated Component component = 1;
-}
-
-/**
- * Information generated about this delta post-applicaton. Used in
- * ProtocolUpdate and ProtocolHistoryResponse.
- */
-message ProtocolAppliedWaveletDelta {
-  required ProtocolSignedDelta signed_original_delta = 1;
-  optional ProtocolHashedVersion hashed_version_applied_at = 2;
-  required int32 operations_applied = 3;
-  required int64 application_timestamp = 4 [(int52) = true];
-}
-
-/**
- * A canonicalised delta signed with a number of domain signatures.
- */
-message ProtocolSignedDelta {
-  required bytes delta = 1;
-  repeated ProtocolSignature signature = 2;
-}
-
-/**
- * A signature for a delta. It contains the actual bytes of the signature,
- * an identifier of the signer (usually the hash of a certificate chain),
- * and an enum identifying the signature algorithm used.
- */
-message ProtocolSignature {
-
-  enum SignatureAlgorithm {
-    SHA1_RSA = 1;
-  }
-
-  required bytes signature_bytes = 1;
-  required bytes signer_id = 2;
-  required SignatureAlgorithm signature_algorithm = 3;
-}
-
-/**
- * A certificate chain that a sender will refer to in subsequent signatures.
- *
- * The signer_id field in a ProtocolSignature refers to a ProtocolSignerInfo
- * as follows: The certificates present in a ProtocolSignerInfo are encoded
- * in PkiPath format, and then hashed using the hash algorithm indicated in the
- * ProtocolSignerInfo.
- */
-message ProtocolSignerInfo {
-
-  enum HashAlgorithm {
-    SHA256 = 1;
-    SHA512 = 2;
-  }
-
-  // The hash algorithm senders will use to generate an id that will refer to
-  // this certificate chain in the future
-  required HashAlgorithm hash_algorithm = 1;
-
-  // The domain that this certificate chain was issued to. Receivers of this
-  // ProtocolSignerInfo SHOULD reject the ProtocolSignerInfo if the target
-  // certificate (the first one in the list) is not issued to this domain.
-  required string domain = 2;
-
-  // The certificate chain. The target certificate (i.e., the certificate 
issued
-  // to the signer) is first, and the CA certificate (or one issued directly
-  // by the CA) is last.
-  repeated bytes certificate = 3;
-}

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave-proto/src/main/proto/org/waveprotocol/wave/federation/federation_error.protodevel
----------------------------------------------------------------------
diff --git 
a/wave-proto/src/main/proto/org/waveprotocol/wave/federation/federation_error.protodevel
 
b/wave-proto/src/main/proto/org/waveprotocol/wave/federation/federation_error.protodevel
deleted file mode 100644
index f6fbcb7..0000000
--- 
a/wave-proto/src/main/proto/org/waveprotocol/wave/federation/federation_error.protodevel
+++ /dev/null
@@ -1,81 +0,0 @@
-// 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.
-//
-// Google Wave Federation Protocol error codes.
-//
-// Author: [email protected] (Benjamin Kalman)
-
-syntax = "proto2";
-
-option java_package = "org.waveprotocol.wave.federation";
-option java_outer_classname = "FederationErrorProto";
-
-package federation;
-
-/**
- * Container for a Federation error, containing the error code (as per the
- * specification) and an optional description for debugging etc.
- *
- * The internal enum has codes which must map directly to XMPP error stanzas,
- * as defined in RFC 3920 (9.3.3).
- *
- * TODO(arb): Once the error codes have been audited and standardised, merge 
into federation.proto.
- */
-message FederationError {
-  enum Code {
-    // Should only be used for internal success.
-    OK = 0;
-
-    // Response for a completely broken request.
-    BAD_REQUEST = 1;
-
-    // Either the wavelet does not exist, or the request is not authorised and
-    // thus should not reveal the existence of the target wavelet.
-    ITEM_NOT_FOUND = 2;
-
-    // Revealable error conditions; including, but not limited to:
-    //  + submit failed due to invalid delta
-    //  + invalid signer info post
-    NOT_ACCEPTABLE = 3;
-
-    // Signer info not available for delta submit.
-    NOT_AUTHORIZED = 4;
-
-    // Generic 'back-off' message.
-    RESOURCE_CONSTRAINT = 5;
-
-    // Undefined condition. This error will be generated if an error condition
-    // not otherwise contained within this protobuf is received over-the-wire.
-    UNDEFINED_CONDITION = 6;
-
-    // Timeout error condition. Note that this may be generated internally
-    // as well as being valid on-the-wire.
-    REMOTE_SERVER_TIMEOUT = 7;
-
-    // Request unexpected, wait requested. Note that this may be generated
-    // internally, notably if an in-flight ID is re-used.
-    UNEXPECTED_REQUEST = 8;
-
-    // Internal server error, wait requested.
-    INTERNAL_SERVER_ERROR = 9;
-  }
-
-  required Code error_code = 1;
-  optional string error_message = 2;
-
-  // TODO(thorogood): Optional source of message field (i.e. wire/internal) 
for internal use?
-}

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave/build.gradle
----------------------------------------------------------------------
diff --git a/wave/build.gradle b/wave/build.gradle
index 9d57241..fcb199a 100644
--- a/wave/build.gradle
+++ b/wave/build.gradle
@@ -1,202 +1,243 @@
+// 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.
+
+//=============================================================================
 // Plugins
+//=============================================================================
 plugins {
     id 'java'
     id 'application'
 }
+apply plugin: 'com.google.protobuf'
 
+//=============================================================================
+// Project Level Settings
+//=============================================================================
 /* Meta Data Info */
 def title = 'Apache Wave Server'
 def vendor = 'The Apache Software Foundation'
-
-/* 3rd Part Repositories */
-repositories {
-    mavenCentral()
-    maven {
-        url 'http://archiva.comunes.org/repository/comunes-snapshots/'
-    }
-    maven {
-        url 'https://oauth.googlecode.com/svn/code/maven/'
-    }
-    maven {
-        url 'https://oss.sonatype.org/content/repositories/google-snapshots/'
-    }
-
-}
-
+version = 0.4
 mainClassName = "org.waveprotocol.box.server.ServerMain"
 applicationDefaultJvmArgs = [
         "-Xmx1024M",
         "-Dorg.eclipse.jetty.LEVEL=DEBUG",
         "-Djava.security.auth.login.config=config/jaas.config"
 ]
+sourceCompatibility = 1.7
+targetCompatibility = 1.7
+compileJava {
+    options.incremental = true
+}
 
+//=============================================================================
+// Extra Configurations (used for separation of dependencies)
+//=============================================================================
 configurations {
-    compile {
-        description = 'compile classpath'
+    generateMessages
+    generateGXP
+    gwt
+}
+
+//=============================================================================
+// Source's
+//=============================================================================
+sourceSets {
+    main {
+        java {
+            srcDirs = [
+                    'src/main/java',
+                    'generated/main/java',
+                    'generated/proto/java'
+            ]
+        }
+        resources {
+            srcDir 'src/main/resources'
+        }
     }
-    generateGXP {
-        description = 'classpath for generating GXP files'
+    proto {
+        proto {
+            srcDir 'src/proto/proto'
+            include '**/*.protodevel'
+        }
     }
-    gwt {
-        description = 'classpath for compiling the gwt sources'
+    test {
+        java {
+            srcDir 'src/test/java'
+        }
+        resources {
+            srcDir 'src/test/resources'
+        }
     }
 }
 
-sonarqube {
-    properties {
-        property "sonar.exclusions", "src/generated/**/*.java"
+//=============================================================================
+// Dependencies
+// Note: next to each dependency is a review stamp [last review, next review].
+//       If a dependency is past its review date pls create a jira issue.
+//       https://issues.apache.org/jira/browse/WAVE
+//=============================================================================
+repositories {
+    mavenCentral()
+    maven {
+        url 'http://archiva.comunes.org/repository/comunes-snapshots/'
+    }
+    maven {
+        url 'https://oauth.googlecode.com/svn/code/maven/'
+    }
+    maven {
+        url 'https://oss.sonatype.org/content/repositories/google-snapshots/'
     }
 }
 
-/* Project Dependencies */
 dependencies {
-    // code-gen
-    compile(
-            [group: "org.antlr", name: "antlr", version: "3.2"],
-            //TODO(wisebaldone) renable when gwt using jetty 9
-            //[group: "com.google.gwt", name: "gwt-dev", version: "2.8.0"],
-            //[group: "com.google.gwt", name: "gwt-user", version: "2.8.0"],
-            //[group: "com.google.gwt", name: "gwt-codeserver", version: 
"2.8.0"],
-            [group: "org.apache.velocity", name: "velocity", version: "1.6.3"]
-    )
-
     gwt(
-            [group: "org.antlr", name: "antlr", version: "3.2"],
-            [group: "org.apache.velocity", name: "velocity", version: "1.6.3"],
-            [group: "javax.validation", name: "validation-api", version: 
"1.1.0.Final"],
-            [group: "javax.validation", name: "validation-api", version: 
"1.1.0.Final", classifier: "sources"]
+            [group: "javax.validation", name: "validation-api", version: 
"1.1.0.Final"],                        // [?, ?]
+            [group: "javax.validation", name: "validation-api", version: 
"1.1.0.Final", classifier: "sources"]  // [?, ?]
     )
-    // compile
     compile (
-            [group: "aopalliance", name: "aopalliance", version: "1.0"],
-            [group: "org.bouncycastle", name: "bcprov-jdk16", version: "1.45"],
-            [group: "commons-fileupload", name: "commons-fileupload", version: 
"1.2.2"],
-            [group: "commons-cli", name: "commons-cli", version: "1.2"],
-            [group: "commons-codec", name: "commons-codec", version: "1.4"],
-            [group: "commons-io", name: "commons-io", version: "2.4"],
-            [group: "commons-collections", name: "commons-collections", 
version: "3.2.1"],
-            [group: "commons-configuration", name: "commons-configuration", 
version: "1.6"],
-            [group: "commons-httpclient", name: "commons-httpclient", version: 
"3.1"],
-            [group: "commons-lang", name: "commons-lang", version: "2.5"],
-            [group: "commons-logging", name: "commons-logging-api", version: 
"1.1"],
-            [group: "commons-logging", name: "commons-logging", version: 
"1.1.1"],
-            [group: "dom4j", name: "dom4j", version: "1.6.1"],
-            [group: "com.google.code.gson", name: "gson", version: "2.2.4"],
-            [group: "com.google.guava", name: "guava", version: "15.0"],
-            [group: "com.google.guava", name: "guava-gwt", version: "15.0"],
-            [group: "com.google.inject.extensions", name: 
"guice-assistedinject", version: "3.0"],
-            [group: "com.google.inject.extensions", name: "guice-servlet", 
version: "3.0"],
-            [group: "com.google.inject", name: "guice", version: "3.0"],
-            [group: "javax.inject", name: "javax.inject", version: "1"],
-            [group: "com.google.gxp", name: "google-gxp", version: 
"0.2.4-beta"],
-            [group: "javax.jdo", name: "jdo2-api", version: "2.1"],
-            [group: "org.jdom", name: "jdom", version: "1.1.3"],
-            [group: "com.google.code.findbugs", name: "jsr305", version: 
"2.0.1"],
-            [group: "jline", name: "jline", version: "0.9.94"],
-            [group: "joda-time", name: "joda-time", version: "1.6"],
-            [group: "org.apache.lucene", name: "lucene-core", version: 
"3.5.0"],
-            [group: "org.mongodb", name: "mongo-java-driver", version: 
"2.11.2"],
-            [group: "net.oauth.core", name: "oauth-provider", version: 
"20100527"],
-            [group: "net.oauth.core", name: "oauth", version: "20100527"],
-            [group: "net.oauth.core", name: "oauth-consumer", version: 
"20100527"],
-            [group: "com.google.protobuf", name: "protobuf-java", version: 
"2.5.0"],
-            [group: "com.googlecode.protobuf-java-format", name: 
"protobuf-java-format", version: "1.2"],
-            [group: "org.igniterealtime", name: "tinder", version: "1.2.1"],
-            [group: "xpp3", name: "xpp3", version: "1.1.4c"],
-            [group: "xpp3", name: "xpp3_xpath", version: "1.1.4c"],
-            [group: "org.gnu.inet", name: "libidn", version: "1.15"],
-            [group: "cc.kune", name: "gwt-initials-avatars-shared", version: 
"1.0-SNAPSHOT"],
-            [group: "cc.kune", name: "gwt-initials-avatars-server", version: 
"1.0-SNAPSHOT"],
-            [group: "com.typesafe", name: "config", version: "1.2.1"],
-            [group: "xerces", name: "xerces", version: "2.4.0"],
-            [group: "org.slf4j", name: "slf4j-api", version: "1.6.1"],
-            [group: "org.slf4j", name: "slf4j-simple", version: "1.6.1"],
-            [group: "org.eclipse.jetty", name: "jetty-annotations", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty", name: "jetty-client", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty", name: "jetty-continuation", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty", name: "jetty-http", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty", name: "jetty-io", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty", name: "jetty-proxy", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty", name: "jetty-security", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty", name: "jetty-server", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty", name: "jetty-servlet", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty", name: "jetty-servlets", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty", name: "jetty-util", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty", name: "jetty-webapp", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty", name: "jetty-xml", version: 
"9.1.1.v20140108"],
-            [group: "org.eclipse.jetty.websocket", name: "websocket-api", 
version: "9.1.1.v20140108"],
-            [group: "org.eclipse.jetty.websocket", name: "websocket-client", 
version: "9.1.1.v20140108"],
-            [group: "org.eclipse.jetty.websocket", name: "websocket-common", 
version: "9.1.1.v20140108"],
-            [group: "org.eclipse.jetty.websocket", name: "websocket-server", 
version: "9.1.1.v20140108"],
-            [group: "org.eclipse.jetty.websocket", name: "websocket-servlet", 
version: "9.1.1.v20140108"],
+            [group: "aopalliance", name: "aopalliance", version: "1.0"],       
                                 // [?, ?]
+            [group: "cc.kune", name: "gwt-initials-avatars-shared", version: 
"1.0-SNAPSHOT"],                   // [?, ?]
+            [group: "cc.kune", name: "gwt-initials-avatars-server", version: 
"1.0-SNAPSHOT"],                   // [?, ?]
+            [group: "commons-fileupload", name: "commons-fileupload", version: 
"1.2.2"],                        // [?, ?]
+            [group: "commons-cli", name: "commons-cli", version: "1.2"],       
                                 // [?, ?]
+            [group: "commons-codec", name: "commons-codec", version: "1.4"],   
                                 // [?, ?]
+            [group: "commons-io", name: "commons-io", version: "2.4"],         
                                 // [?, ?]
+            [group: "commons-collections", name: "commons-collections", 
version: "3.2.1"],                      // [?, ?]
+            [group: "commons-configuration", name: "commons-configuration", 
version: "1.6"],                    // [?, ?]
+            [group: "commons-httpclient", name: "commons-httpclient", version: 
"3.1"],                          // [?, ?]
+            [group: "commons-lang", name: "commons-lang", version: "2.5"],     
                                 // [?, ?]
+            [group: "commons-logging", name: "commons-logging-api", version: 
"1.1"],                            // [?, ?]
+            [group: "commons-logging", name: "commons-logging", version: 
"1.1.1"],                              // [?, ?]
+            [group: "com.google.code.findbugs", name: "jsr305", version: 
"2.0.1"],                              // [?, ?]
+            [group: "com.google.code.gson", name: "gson", version: "2.2.4"],   
                                 // [?, ?]
+            [group: "com.google.guava", name: "guava", version: "15.0"],       
                                 // [?, ?]
+            [group: "com.google.guava", name: "guava-gwt", version: "15.0"],   
                                 // [?, ?]
+            [group: "com.google.gxp", name: "google-gxp", version: 
"0.2.4-beta"],                               // [?, ?]
+            [group: "com.google.inject.extensions", name: 
"guice-assistedinject", version: "3.0"],              // [?, ?]
+            [group: "com.google.inject.extensions", name: "guice-servlet", 
version: "3.0"],                     // [?, ?]
+            [group: "com.google.inject", name: "guice", version: "3.0"],       
                                 // [?, ?]
+            [group: "com.google.protobuf", name: "protobuf-java", version: 
"2.6.1"],                            // [?, ?]
+            [group: "com.googlecode.protobuf-java-format", name: 
"protobuf-java-format", version: "1.2"],       // [?, ?]
+            [group: "com.typesafe", name: "config", version: "1.2.1"],         
                                 // [?, ?]
+            [group: "dom4j", name: "dom4j", version: "1.6.1"],                 
                                 // [?, ?]
+            [group: "eu.infomas", name: "annotation-detector", version: 
"3.0.0"],                               // [?, ?]
+            [group: "org.antlr", name: "antlr", version: "3.2"],               
                                 // [?, ?]
+            [group: "org.apache.velocity", name: "velocity", version: 
"1.6.3"],                                 // [?, ?]
+            [group: "org.apache.lucene", name: "lucene-core", version: 
"3.5.0"],                                // [?, ?]
+            [group: "org.atmosphere", name: "atmosphere-guice", version: 
"0.8.3"],                              // [?, ?]
+            [group: "org.atmosphere", name: "atmosphere-runtime", version: 
"2.1.0"],                            // [?, ?]
+            [group: "org.bouncycastle", name: "bcprov-jdk16", version: 
"1.45"],                                 // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-annotations", version: 
"9.1.1.v20140108"],                // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-client", version: 
"9.1.1.v20140108"],                     // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-continuation", version: 
"9.1.1.v20140108"],               // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-http", version: 
"9.1.1.v20140108"],                       // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-io", version: 
"9.1.1.v20140108"],                         // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-proxy", version: 
"9.1.1.v20140108"],                      // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-security", version: 
"9.1.1.v20140108"],                   // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-server", version: 
"9.1.1.v20140108"],                     // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-servlet", version: 
"9.1.1.v20140108"],                    // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-servlets", version: 
"9.1.1.v20140108"],                   // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-util", version: 
"9.1.1.v20140108"],                       // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-webapp", version: 
"9.1.1.v20140108"],                     // [?, ?]
+            [group: "org.eclipse.jetty", name: "jetty-xml", version: 
"9.1.1.v20140108"],                        // [?, ?]
+            [group: "org.eclipse.jetty.websocket", name: "websocket-api", 
version: "9.1.1.v20140108"],          // [?, ?]
+            [group: "org.eclipse.jetty.websocket", name: "websocket-client", 
version: "9.1.1.v20140108"],       // [?, ?]
+            [group: "org.eclipse.jetty.websocket", name: "websocket-common", 
version: "9.1.1.v20140108"],       // [?, ?]
+            [group: "org.eclipse.jetty.websocket", name: "websocket-server", 
version: "9.1.1.v20140108"],       // [?, ?]
+            [group: "org.eclipse.jetty.websocket", name: "websocket-servlet", 
version: "9.1.1.v20140108"],      // [?, ?]
+            [group: "org.gnu.inet", name: "libidn", version: "1.15"],          
                                 // [?, ?]
+            [group: "org.igniterealtime", name: "tinder", version: "1.2.3"],   
                                 // [1/2016, 6/2016]
+            [group: "org.igniterealtime.whack", name: "core", version: 
"2.0.0"],                                // [1/2016, 6/2016]
+            [group: "org.jdom", name: "jdom", version: "1.1.3"],               
                                 // [?, ?]
+            [group: "org.mongodb", name: "mongo-java-driver", version: 
"2.11.2"],                               // [?, ?]
+            [group: "org.slf4j", name: "slf4j-api", version: "1.6.1"],         
                                 // [?, ?]
+            [group: "org.slf4j", name: "slf4j-simple", version: "1.6.1"],      
                                 // [?, ?]
+            [group: "javax.inject", name: "javax.inject", version: "1"],       
                                 // [?, ?]
+            [group: "javax.servlet", name: "javax.servlet-api", version: 
"3.1.0"],                              // [?, ?]
+            [group: "javax.jdo", name: "jdo2-api", version: "2.1"],            
                                 // [?, ?]
+            [group: "jline", name: "jline", version: "0.9.94"],                
                                 // [?, ?]
+            [group: "joda-time", name: "joda-time", version: "1.6"],           
                                 // [?, ?]
+            [group: "net.oauth.core", name: "oauth-provider", version: 
"20100527"],                             // [?, ?]
+            [group: "net.oauth.core", name: "oauth", version: "20100527"],     
                                 // [?, ?]
+            [group: "net.oauth.core", name: "oauth-consumer", version: 
"20100527"],                             // [?, ?]
+            [group: "xerces", name: "xerces", version: "2.4.0"],               
                                 // [?, ?]
+            [group: "xpp3", name: "xpp3", version: "1.1.4c"],                  
                                 // [?, ?]
+            [group: "xpp3", name: "xpp3_xpath", version: "1.1.4c"],            
                                 // [?, ?]
             //TODO: Following are included due to tests being in the main src 
directory
-            [group: "org.mockito", name: "mockito-all", version: "1.9.5"],
-            [group: "org.hamcrest", name: "hamcrest-all", version: "1.3"]
+            [group: "org.mockito", name: "mockito-all", version: "1.9.5"],     
                                 // [?, ?]
+            [group: "org.hamcrest", name: "hamcrest-all", version: "1.3"]      
                                 // [?, ?]
 
     )
-    compile fileTree(dir: 'dependencies/compile', include: "**/*.jar")
-    compile fileTree(dir: '../wave-proto/build/libs', include: "**/*.jar")
-
+    compile fileTree(dir: 'dependencies/compile', include: "**/*.jar")         
                                 // [?, ?]
+    compile fileTree(dir: '../pst/build/libs', include: '**/*.jar')            
                                 // [?, ?]
     generateGXP (
-        [group: "com.google.gxp", name: "google-gxp", version: "0.2.4-beta"]
+        [group: "com.google.gxp", name: "google-gxp", version: "0.2.4-beta"]   
                                 // [?, ?]
+    )
+    protoCompile (
+        [group: "com.google.protobuf", name: "protobuf-java", version: 
"2.6.1"],                                // [?, ?]
+        fileTree(dir: '../pst/build/libs', include: '**/*.jar')                
                                 // [?, ?]
+    )
+    generateMessages (
+         fileTree(dir: '../pst/build/libs', include: '**/*.jar')               
                                 // [?, ?]
     )
-
-    // tests
     testCompile(
-            [group: 'junit', name: 'junit', version: '4.11'],
-            [group: "org.ow2.asm", name: "asm", version: "5.0.4"],
-            [group: "cglib", name: "cglib", version: "2.2"],
-            [group: "com.novocode", name: "junit-interface", version: "0.11"],
-            [group: "emma", name: "emma", version: "2.0.5312"],
-            [group: "emma", name: "emma_ant", version: "2.1.5320"],
-            [group: "org.hamcrest", name: "hamcrest-all", version: "1.3"],
-            [group: "org.jmock", name: "jmock-junit3", version: "2.6.0"],
-            [group: "org.jmock", name: "jmock", version: "2.6.0"],
-            [group: "org.mockito", name: "mockito-all", version: "1.9.5"]
+            [group: 'junit', name: 'junit', version: '4.12'],                  
                                 // [?, ?]
+            [group: "org.ow2.asm", name: "asm", version: "5.0.4"],             
                                 // [?, ?]
+            [group: "cglib", name: "cglib", version: "2.2"],                   
                                 // [?, ?]
+            [group: "com.novocode", name: "junit-interface", version: "0.11"], 
                                 // [?, ?]
+            [group: "emma", name: "emma", version: "2.0.5312"],                
                                 // [?, ?]
+            [group: "emma", name: "emma_ant", version: "2.1.5320"],            
                                 // [?, ?]
+            [group: "org.hamcrest", name: "hamcrest-all", version: "1.3"],     
                                 // [?, ?]
+            [group: "org.jmock", name: "jmock-junit3", version: "2.6.0"],      
                                 // [?, ?]
+            [group: "org.jmock", name: "jmock", version: "2.6.0"],             
                                 // [?, ?]
+            [group: "org.mockito", name: "mockito-all", version: "1.9.5"]      
                                 // [?, ?]
     )
 }
 
-/* Source Sets */
-sourceSets {
-    main {
-        java {
-            srcDirs = [
-                    'src/main/java',
-                    'src/generated/gxp',
-                    'src/generated/messages'
-            ]
-        }
-        resources {
-            srcDir 'src/main/resources'
-        }
-    }
-
-    test {
-        java {
-            srcDir 'src/test/java'
-        }
-        resources {
-            srcDir 'src/test/resources'
-        }
+//=============================================================================
+// Protobuf Config
+//=============================================================================
+protobuf {
+    protoc {
+        artifact = 'com.google.protobuf:protoc:2.6.1'
     }
+    generatedFilesBaseDir = "$projectDir/generated"
 }
 
+//=============================================================================
+// Task - Generation Tasks (External Compilers)
+//=============================================================================
+
 task generateMessages {
     description = 'Generates source files from Antlr String types and protobuf'
-    FileTree inputFiles = fileTree(dir: '../wave-proto/build/classes/main/', 
include: '**/*.class')
+    FileTree inputFiles = fileTree(dir: 'generated/src/main/java', include: 
'**/*.java')
     inputs.property "files", inputFiles
-    File outputDir = file("src/generated/messages")
+    File outputDir = file("generated/main/java")
     outputs.dir outputDir
     doLast {
         List<String> proto_classes = [
-                
"../wave-proto/build/classes/main/org/waveprotocol/box/common/comms/WaveClientRpc.class",
-                
"../wave-proto/build/classes/main/org/waveprotocol/box/search/SearchProto.class",
-                
"../wave-proto/build/classes/main/org/waveprotocol/box/profile/ProfilesProto.class",
-                
"../wave-proto/build/classes/main/org/waveprotocol/box/server/rpc/Rpc.class",
-                
"../wave-proto/build/classes/main/org/waveprotocol/box/attachment/AttachmentProto.class",
-                
"../wave-proto/build/classes/main/org/waveprotocol/wave/federation/Proto.class",
-                
"../wave-proto/build/classes/main/org/waveprotocol/wave/concurrencycontrol/ClientServer.class",
-                
"../wave-proto/build/classes/main/org/waveprotocol/wave/diff/Diff.class"
+                
"build/classes/proto/org/waveprotocol/box/common/comms/WaveClientRpc.class",
+                
"build/classes/proto/org/waveprotocol/box/search/SearchProto.class",
+                
"build/classes/proto/org/waveprotocol/box/profile/ProfilesProto.class",
+                
"build/classes/proto/org/waveprotocol/box/server/rpc/Rpc.class",
+                
"build/classes/proto/org/waveprotocol/box/attachment/AttachmentProto.class",
+                
"build/classes/proto/org/waveprotocol/wave/federation/Proto.class",
+                
"build/classes/proto/org/waveprotocol/wave/concurrencycontrol/ClientServer.class",
+                "build/classes/proto/org/waveprotocol/wave/diff/Diff.class"
         ]
         List<String> templates = [
                 "src/main/java/org/waveprotocol/pst/templates/api/api.st",
@@ -209,13 +250,13 @@ task generateMessages {
         ]
         proto_classes.each { proto ->
             javaexec {
-                main = "org.waveprotocol.pst.PstMain"
-                classpath += configurations.compile
+                main = "org.apache.wave.pst.PstMain"
+                classpath += configurations.generateMessages
                 args = [
                         '-s',
                         'pst',
                         '-d',
-                        'src/generated/messages',
+                        'generated/main/java',
                         '-f',
                         proto
                 ]
@@ -225,13 +266,13 @@ task generateMessages {
     }
 }
 
-generateMessages.dependsOn ":pst:jar"
+generateMessages.dependsOn ":pst:shadowJar", "compileProtoJava"
 
 task generateGXP {
     description = 'Generate source files from GXP prototypes'
     FileTree inputFiles = fileTree(dir: 'src/main/gxp', include: '**/*.gxp')
     inputs.property "files", inputFiles
-    File outputDir = file("src/generated/gxp")
+    File outputDir = file("generated/main/java")
     outputs.dir outputDir
     doLast {
         javaexec {
@@ -239,7 +280,7 @@ task generateGXP {
             classpath += configurations.generateGXP
             args = [
                     "--dir",
-                    "src/generated/gxp",
+                    "generated/main/java",
                     "--source",
                     "src/main/gxp",
                     "--output_language",
@@ -250,6 +291,9 @@ task generateGXP {
     }
 }
 
+//=============================================================================
+// Gwt Compilation Options
+//=============================================================================
 task compileGwt {
     description = 'Compiles the GWT sources for production'
     doLast {
@@ -326,14 +370,7 @@ task compileGwtDev {
     }
 }
 
-task extractApi(type: Copy) {
-    from (configurations.compile.collect { zipTree(it) }) {
-        //Note: readonly files which get overwritten crash windows.
-        exclude "LICENSE"
-    } into "$buildDir/api"
-}
 
-extractApi.mustRunAfter compileJava
 
 compileJava.dependsOn = [generateMessages, generateGXP]
 
@@ -372,7 +409,9 @@ task gwtDev {
     }
 }
 
-/* Test Tasks */
+//=============================================================================
+// Tests
+//=============================================================================
 
 test {
     include "**/*Test*"
@@ -460,6 +499,19 @@ testLarge.mustRunAfter test
 
 ant.importBuild 'config/server-config.xml'
 
+//=============================================================================
+// Custom UberJar Implementation
+// Author Note: this custom implementation should be replaced by the shadow
+//              plugin as shown in the pst project.
+//=============================================================================
+task extractApi(type: Copy) {
+    from (configurations.compile.collect { zipTree(it) }) {
+        //Note: readonly files which get overwritten crash windows.
+        exclude "LICENSE"
+    } into "$buildDir/api"
+}
+
+extractApi.mustRunAfter compileJava
 
 jar {
     manifest {
@@ -506,6 +558,7 @@ jar {
     include "org/apache/lucene/**/*"
     include "org/apache/commons/io/**/*"
     include "org/apache/xerces/**/*"
+    include "org/apache/wave/**/*"
     include "org/bson/**/*"
     include "org/dom4j/**/*"
     include "org/eclipse/**/*"
@@ -545,7 +598,11 @@ jar {
 
 jar.dependsOn compileJava, compileGwt, extractApi
 
-/* Distribution Tasks */
+//=============================================================================
+// Binary Distribution
+//=============================================================================
+
+def binName = this.group + "-bin"
 
 task createPropertiesFile(type: Copy) {
     from 'src/main/configs'
@@ -557,7 +614,7 @@ task createPropertiesFile(type: Copy) {
 }
 
 task createDistBinZip(type: Zip) {
-    baseName = this.group + "-bin"
+    baseName = binName
     destinationDir = file('../distributions')
     from(jar) {
         into 'apache-wave/bin'
@@ -586,7 +643,9 @@ task createDistBinZip(type: Zip) {
 }
 
 task createDistBinTar(type: Tar) {
-    baseName = this.group + "-bin"
+    compression = Compression.GZIP
+    extension = 'tar.gz'
+    baseName = binName
     destinationDir = file('../distributions')
     from(jar) {
         into 'apache-wave/bin'
@@ -617,6 +676,9 @@ task createDistBinTar(type: Tar) {
 createDistBinZip.dependsOn jar, createPropertiesFile
 createDistBinTar.dependsOn jar, createPropertiesFile
 
+//=============================================================================
+// Distribution's
+//=============================================================================
 task createDistBin() {
     doFirst {
         println ''
@@ -633,6 +695,6 @@ createDistBin.dependsOn createDistBinZip, createDistBinTar
 clean {
     delete "war/WEB-INF"
     delete "war/webclient"
-    delete "src/generated"
+    delete "generated/"
     delete "gwt-unitCache"
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/36445930/wave/src/proto/proto/org/waveprotocol/box/attachment/attachment.proto
----------------------------------------------------------------------
diff --git 
a/wave/src/proto/proto/org/waveprotocol/box/attachment/attachment.proto 
b/wave/src/proto/proto/org/waveprotocol/box/attachment/attachment.proto
new file mode 100644
index 0000000..78c95cc
--- /dev/null
+++ b/wave/src/proto/proto/org/waveprotocol/box/attachment/attachment.proto
@@ -0,0 +1,50 @@
+// 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.
+//
+// The image attachment metadata.
+//
+// Author: [email protected] (Kaplanov A.)
+
+syntax = "proto2";
+
+package attachment;
+
+option java_package = "org.waveprotocol.box.attachment";
+option java_outer_classname = "AttachmentProto";
+
+message AttachmentsResponse {
+  repeated AttachmentMetadata attachment = 1;
+}
+
+message AttachmentMetadata {
+  required string attachmentId = 1;
+  required string waveRef = 2;
+  required string fileName = 3;
+  required string mimeType = 4;
+  required int64 size = 5;
+  required string creator = 6;
+  required string attachmentUrl = 7;
+  required string thumbnailUrl = 8;
+  optional ImageMetadata imageMetadata = 9;
+  optional ImageMetadata thumbnailMetadata = 10;
+  optional bool malware = 11;
+}
+
+message ImageMetadata {
+  required int32 width = 1;
+  required int32 height = 2;
+}

Reply via email to