Merge lp:~mandel/ubuntuone-windows-installer/remove_syncdaemon_shit_the_second into lp:ubuntuone-windows-installer/beta
- remove_syncdaemon_shit_the_second
- Merge into beta
Proposed by
Manuel de la Peña
Status: | Merged |
---|---|
Approved by: | Vincenzo Di Somma |
Approved revision: | 57 |
Merged at revision: | 69 |
Proposed branch: | lp:~mandel/ubuntuone-windows-installer/remove_syncdaemon_shit_the_second |
Merge into: | lp:ubuntuone-windows-installer/beta |
Prerequisite: | lp:~mandel/ubuntuone-windows-installer/remove_syncdaemon_shit_the_first |
Diff against target: |
4058 lines (+21/-3809) 32 files modified
main.build (+1/-63) src/Canonical.UbuntuOne.Common/DataContracts/AccountData.cs (+1/-1) src/Canonical.UbuntuOne.Common/DataContracts/DownloadData.cs (+1/-1) src/Canonical.UbuntuOne.Common/DataContracts/ShareData.cs (+18/-17) src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Canonical.UbuntuOne.ProcessDispatcher.Tests.csproj (+0/-5) src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/ConvertFixture.cs (+0/-714) src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncConfigurationMessageFactoryFixture.cs (+0/-82) src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncDaemonMessageFactoryFixture.cs (+0/-107) src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncFolderMessageFactoryFixture.cs (+0/-147) src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncShareMessageFactoryFixture.cs (+0/-138) src/Canonical.UbuntuOne.ProcessDispatcher/Canonical.UbuntuOne.ProcessDispatcher.csproj (+0/-20) src/Canonical.UbuntuOne.ProcessDispatcher/EventNotifier.cs (+0/-11) src/Canonical.UbuntuOne.ProcessDispatcher/IEventDispatcher.cs (+0/-40) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Configuration.cs (+0/-107) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Convert.cs (+0/-473) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Folder.cs (+0/-140) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/FolderMessageExtensions.cs (+0/-36) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/IProtobufSerializer.cs (+0/-46) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncConfigurationMessageFactory.cs (+0/-56) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncDaemonMessageFactory.cs (+0/-87) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncFolderMessageFactory.cs (+0/-71) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncShareMessageFactory.cs (+0/-68) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ProtobufSerializer.cs (+0/-56) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ShareMessageExtensions.cs (+0/-38) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Shares.cs (+0/-212) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncConfigurationMessageFactory.cs (+0/-67) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemon.cs (+0/-282) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemonClient.cs (+0/-362) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemonMessageExtensions.cs (+0/-60) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemonMessageFactory.cs (+0/-114) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncFolderMessageFactory.cs (+0/-90) src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncShareMessageFactory.cs (+0/-98) |
To merge this branch: | bzr merge lp:~mandel/ubuntuone-windows-installer/remove_syncdaemon_shit_the_second |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vincenzo Di Somma (community) | Approve | ||
John Lenton (community) | Approve | ||
Review via email: mp+33543@code.launchpad.net |
Commit message
Description of the change
Removes the use of the protobuf from ipc as well as the auto-generated code that is used.
To post a comment you must log in.
Revision history for this message
John Lenton (chipaca) : | # |
review:
Approve
Revision history for this message
Vincenzo Di Somma (vds) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'main.build' |
2 | --- main.build 2010-08-24 15:59:03 +0000 |
3 | +++ main.build 2010-08-24 15:59:04 +0000 |
4 | @@ -78,65 +78,6 @@ |
5 | |
6 | </target> |
7 | |
8 | - <target name="generate_protos" description="Generates the code that is used to talk with the python process using protobuffer."> |
9 | - <delete file="src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemon.cs" /> |
10 | - <copy todir="lib/Protobuf-net" flatten="true"> |
11 | - <fileset basedir="proto"> |
12 | - <include name="sync_daemon.proto" /> |
13 | - <include name="configuration.proto" /> |
14 | - <include name="sync_daemon_client.proto" /> |
15 | - <include name="folder.proto" /> |
16 | - <include name="shares.proto" /> |
17 | - </fileset> |
18 | - </copy> |
19 | - |
20 | - <!-- execute the proto-gen tool to generate the code of the c# project --> |
21 | - <exec basedir="lib/Protobuf-net" |
22 | - managed="true" |
23 | - workingdir="lib/Protobuf-net" |
24 | - program="protogen.exe" |
25 | - commandline="-i:sync_daemon.proto -o:SyncDaemon.cs -ns:Canonical.UbuntuOne.ProcessDispatcher -p:fixCase=true"/> |
26 | - |
27 | - <exec basedir="lib/Protobuf-net" |
28 | - managed="true" |
29 | - workingdir="lib/Protobuf-net" |
30 | - program="protogen.exe" |
31 | - commandline="-i:configuration.proto -o:Configuration.cs -ns:Canonical.UbuntuOne.ProcessDispatcher -p:fixCase=true"/> |
32 | - |
33 | - <exec basedir="lib/Protobuf-net" |
34 | - managed="true" |
35 | - workingdir="lib/Protobuf-net" |
36 | - program="protogen.exe" |
37 | - commandline="-i:sync_daemon_client.proto -o:SyncDaemonClient.cs -ns:Canonical.UbuntuOne.ProcessDispatcher -p:fixCase=true"/> |
38 | - |
39 | - <exec basedir="lib/Protobuf-net" |
40 | - managed="true" |
41 | - workingdir="lib/Protobuf-net" |
42 | - program="protogen.exe" |
43 | - commandline="-i:folder.proto -o:Folder.cs -ns:Canonical.UbuntuOne.ProcessDispatcher -p:fixCase=true"/> |
44 | - |
45 | - <exec basedir="lib/Protobuf-net" |
46 | - managed="true" |
47 | - workingdir="lib/Protobuf-net" |
48 | - program="protogen.exe" |
49 | - commandline="-i:shares.proto -o:Shares.cs -ns:Canonical.UbuntuOne.ProcessDispatcher -p:fixCase=true"/> |
50 | - |
51 | - <!-- move the generated code --> |
52 | - <move file="./lib/Protobuf-net/SyncDaemon.cs" todir="./src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/"/> |
53 | - <move file="./lib/Protobuf-net/Configuration.cs" todir="./src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/"/> |
54 | - <move file="./lib/Protobuf-net/SyncDaemonClient.cs" todir="./src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/"/> |
55 | - <move file="./lib/Protobuf-net/Folder.cs" todir="./src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/"/> |
56 | - <move file="./lib/Protobuf-net/Shares.cs" todir="./src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/"/> |
57 | - |
58 | - <!-- delete the files we have copied --> |
59 | - <delete file="lib/Protobuf-net/sync_daemon.proto" /> |
60 | - <delete file="lib/Protobuf-net/configuration.proto" /> |
61 | - <delete file="lib/Protobuf-net/sync_daemon_client.proto" /> |
62 | - <delete file="lib/Protobuf-net/folder.proto" /> |
63 | - <delete file="lib/Protobuf-net/shares.proto" /> |
64 | - |
65 | - </target> |
66 | - |
67 | <target name="generate-versionnumber" |
68 | description="Generates a new version number according to the number of builds done in the continuous integration" > |
69 | <attrib readonly="false"> |
70 | @@ -162,7 +103,7 @@ |
71 | |
72 | <target name="build" |
73 | description="Compiles all the different projects that form part of the solution." |
74 | - depends="clean, generate_protos, generate-versionnumber"> |
75 | + depends="clean, generate-versionnumber"> |
76 | <!-- use the msbuild action to compile the solution --> |
77 | <msbuild project="src/UbuntuOne.sln"> |
78 | <property name="Configuration" value="${enviroment}" /> |
79 | @@ -384,9 +325,6 @@ |
80 | |
81 | <copy file="lib/log4net/log4net.dll" |
82 | tofile="${docs_api}/log4net.dll" /> |
83 | - |
84 | - <copy file="lib/Protobuf-net/protobuf-net.dll" |
85 | - tofile="${docs_api}/protobuf-net.dll" /> |
86 | |
87 | <!-- generate the xml from the reflection of the code --> |
88 | |
89 | |
90 | === modified file 'src/Canonical.UbuntuOne.Common/DataContracts/AccountData.cs' |
91 | --- src/Canonical.UbuntuOne.Common/DataContracts/AccountData.cs 2010-08-05 08:01:59 +0000 |
92 | +++ src/Canonical.UbuntuOne.Common/DataContracts/AccountData.cs 2010-08-24 15:59:04 +0000 |
93 | @@ -1,4 +1,4 @@ |
94 | -/** |
95 | +/* |
96 | * Copyright 2010 Canonical Ltd. |
97 | * |
98 | * This file is part of UbuntuOne on Windows. |
99 | |
100 | === modified file 'src/Canonical.UbuntuOne.Common/DataContracts/DownloadData.cs' |
101 | --- src/Canonical.UbuntuOne.Common/DataContracts/DownloadData.cs 2010-07-07 10:41:49 +0000 |
102 | +++ src/Canonical.UbuntuOne.Common/DataContracts/DownloadData.cs 2010-08-24 15:59:04 +0000 |
103 | @@ -1,4 +1,4 @@ |
104 | -/** |
105 | +/* |
106 | * Copyright 2010 Canonical Ltd. |
107 | * |
108 | * This file is part of UbuntuOne on Windows. |
109 | |
110 | === modified file 'src/Canonical.UbuntuOne.Common/DataContracts/ShareData.cs' |
111 | --- src/Canonical.UbuntuOne.Common/DataContracts/ShareData.cs 2010-08-05 08:15:00 +0000 |
112 | +++ src/Canonical.UbuntuOne.Common/DataContracts/ShareData.cs 2010-08-24 15:59:04 +0000 |
113 | @@ -1,20 +1,21 @@ |
114 | -// Copyright 2010 Canonical Ltd. |
115 | -// |
116 | -// This file is part of UbuntuOne on Windows. |
117 | -// |
118 | -// UbuntuOne on Windows is free software: you can redistribute it and/or modify |
119 | -// it under the terms of the GNU Lesser General Public License version |
120 | -// as published by the Free Software Foundation. |
121 | -// |
122 | -// Ubuntu One on Windows is distributed in the hope that it will be useful, |
123 | -// but WITHOUT ANY WARRANTY; without even the implied warranty of |
124 | -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
125 | -// GNU Lesser General Public License for more details. |
126 | -// |
127 | -// You should have received a copy of the GNU Lesser General Public License |
128 | -// along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
129 | -// |
130 | -// Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
131 | +/* Copyright 2010 Canonical Ltd. |
132 | + * |
133 | + * This file is part of UbuntuOne on Windows. |
134 | + * |
135 | + * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
136 | + * it under the terms of the GNU Lesser General Public License version |
137 | + * as published by the Free Software Foundation. |
138 | + * |
139 | + * Ubuntu One on Windows is distributed in the hope that it will be useful, |
140 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
141 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
142 | + * GNU Lesser General Public License for more details. |
143 | + * |
144 | + * You should have received a copy of the GNU Lesser General Public License |
145 | + * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
146 | + * |
147 | + * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
148 | + */ |
149 | using System.Runtime.Serialization; |
150 | |
151 | namespace Canonical.UbuntuOne.Common |
152 | |
153 | === modified file 'src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Canonical.UbuntuOne.ProcessDispatcher.Tests.csproj' |
154 | --- src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Canonical.UbuntuOne.ProcessDispatcher.Tests.csproj 2010-08-24 15:59:03 +0000 |
155 | +++ src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Canonical.UbuntuOne.ProcessDispatcher.Tests.csproj 2010-08-24 15:59:04 +0000 |
156 | @@ -57,11 +57,6 @@ |
157 | </Compile> |
158 | <Compile Include="EventNotifierFixture.cs" /> |
159 | <Compile Include="Properties\AssemblyInfo.cs" /> |
160 | - <Compile Include="Protobuf\ConvertFixture.cs" /> |
161 | - <Compile Include="Protobuf\SyncConfigurationMessageFactoryFixture.cs" /> |
162 | - <Compile Include="Protobuf\SyncDaemonMessageFactoryFixture.cs" /> |
163 | - <Compile Include="Protobuf\SyncFolderMessageFactoryFixture.cs" /> |
164 | - <Compile Include="Protobuf\SyncShareMessageFactoryFixture.cs" /> |
165 | <Compile Include="SetUpClass.cs" /> |
166 | <Compile Include="SyncConfigurationServiceFixture.cs" /> |
167 | <Compile Include="SyncDaemonServiceFixture.cs" /> |
168 | |
169 | === removed directory 'src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf' |
170 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/ConvertFixture.cs' |
171 | --- src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/ConvertFixture.cs 2010-08-11 08:05:19 +0000 |
172 | +++ src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/ConvertFixture.cs 1970-01-01 00:00:00 +0000 |
173 | @@ -1,714 +0,0 @@ |
174 | -/* |
175 | - * Copyright 2010 Canonical Ltd. |
176 | - * |
177 | - * This file is part of UbuntuOne on Windows. |
178 | - * |
179 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
180 | - * it under the terms of the GNU Lesser General Public License version |
181 | - * as published by the Free Software Foundation. |
182 | - * |
183 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
184 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
185 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
186 | - * GNU Lesser General Public License for more details. |
187 | - * |
188 | - * You should have received a copy of the GNU Lesser General Public License |
189 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
190 | - * |
191 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
192 | - */ |
193 | -using System.Collections.Generic; |
194 | -using Canonical.UbuntuOne.Common.Validation; |
195 | -using NUnit.Framework; |
196 | - |
197 | -namespace Canonical.UbuntuOne.ProcessDispatcher.Tests |
198 | -{ |
199 | - /// <summary> |
200 | - /// Fixture used to ensure that the convert class performs the correct operations. |
201 | - /// </summary> |
202 | - [TestFixture] |
203 | - public class ConvertFixture |
204 | - { |
205 | - |
206 | - [Test] |
207 | - [ExpectedException(typeof(ValidationException))] |
208 | - public void ToStateDataWrongMessageTest() |
209 | - { |
210 | - var message = new SyncDaemonMessage |
211 | - { |
212 | - Type = SyncDaemonMessage.MessageType.CONNECT |
213 | - }; |
214 | - Convert.ToStateData(message); |
215 | - } |
216 | - |
217 | - [Test] |
218 | - [ExpectedException(typeof(ValidationException))] |
219 | - public void ToStateDataNullPointerTest() |
220 | - { |
221 | - var message = new SyncDaemonMessage |
222 | - { |
223 | - Type = SyncDaemonMessage.MessageType.STATUS, |
224 | - State = null |
225 | - }; |
226 | - Convert.ToStateData(message); |
227 | - } |
228 | - |
229 | - [Test] |
230 | - [TestCase("firstDescription", true, true, true, "name")] |
231 | - [TestCase("firstDescription", true, true, false, "name")] |
232 | - [TestCase("firstDescription", true, false, true, "name")] |
233 | - [TestCase("firstDescription", true, false, false, "name")] |
234 | - public void ToStateDataTest(string description, bool isConnected, bool isError, |
235 | - bool isOnline, string name) |
236 | - { |
237 | - var message = new SyncDaemonMessage |
238 | - { |
239 | - Type = SyncDaemonMessage.MessageType.STATUS, |
240 | - State = new SyncDaemonMessage.StateMessage |
241 | - { |
242 | - Description = description, |
243 | - IsConnected = isConnected, |
244 | - IsError = isError, |
245 | - IsOnline = isOnline, |
246 | - Name = name |
247 | - } |
248 | - }; |
249 | - var state = Convert.ToStateData(message); |
250 | - Assert.AreEqual(description, state.Description); |
251 | - Assert.AreEqual(isConnected, state.IsConnected); |
252 | - Assert.AreEqual(isError, state.IsError); |
253 | - Assert.AreEqual(isOnline, state.IsOnline); |
254 | - Assert.AreEqual(name, state.Name); |
255 | - } |
256 | - |
257 | - [Test] |
258 | - [ExpectedException(typeof(ValidationException))] |
259 | - public void ToCurrentDownloadsWrongMessageTest() |
260 | - { |
261 | - var message = new SyncDaemonMessage |
262 | - { |
263 | - Type = SyncDaemonMessage.MessageType.SCHEDULENEXT |
264 | - }; |
265 | - Convert.ToCurrentDownloads(message); |
266 | - } |
267 | - |
268 | - |
269 | - [TestCase("first", 3, "second", 5)] |
270 | - [TestCase("thrid", 65, "last", 45)] |
271 | - public void ToCurrentDownloadsTest(string firstData, int firstRead, string secondData, int secondRead) |
272 | - { |
273 | - var message = new SyncDaemonMessage(new List<SyncDaemonMessage.DownloadMessage>()) |
274 | - { |
275 | - Type = SyncDaemonMessage.MessageType.DOWNLOADS, |
276 | - }; |
277 | - message.Downloads.Add(new SyncDaemonMessage.DownloadMessage |
278 | - { |
279 | - NumberOfBytesRead = firstRead, |
280 | - Node = new SyncDaemonMessage.NodeMessage |
281 | - { |
282 | - Path = firstData, |
283 | - VolumeId = firstData, |
284 | - NodeId = firstData |
285 | - } |
286 | - }); |
287 | - message.Downloads.Add(new SyncDaemonMessage.DownloadMessage |
288 | - { |
289 | - NumberOfBytesRead = secondRead, |
290 | - Node = new SyncDaemonMessage.NodeMessage |
291 | - { |
292 | - Path = secondData, |
293 | - VolumeId = secondData, |
294 | - NodeId = secondData |
295 | - } |
296 | - }); |
297 | - var converted = Convert.ToCurrentDownloads(message); |
298 | - Assert.AreEqual(message.Downloads.Count, converted.Count); |
299 | - foreach (var downloadData in converted) |
300 | - { |
301 | - Assert.IsTrue(downloadData.NodeId.Equals(firstData) |
302 | - || downloadData.NodeId.Equals(secondData)); |
303 | - if (downloadData.NodeId.Equals(firstData)) |
304 | - { |
305 | - Assert.AreEqual(firstData, downloadData.Path); |
306 | - Assert.AreEqual(firstData, downloadData.VolumeId); |
307 | - Assert.AreEqual(firstRead, downloadData.NumberOfBytesRead); |
308 | - } |
309 | - else |
310 | - { |
311 | - // if it is different from secondData we would have a fail assertion before |
312 | - Assert.AreEqual(secondData, downloadData.Path); |
313 | - Assert.AreEqual(secondData, downloadData.VolumeId); |
314 | - Assert.AreEqual(secondRead, downloadData.NumberOfBytesRead); |
315 | - } |
316 | - } |
317 | - } |
318 | - |
319 | - [Test] |
320 | - [ExpectedException(typeof(ValidationException))] |
321 | - public void ToCurrentWaitingWrongMessageTest() |
322 | - { |
323 | - var message = new SyncDaemonMessage |
324 | - { |
325 | - Type = SyncDaemonMessage.MessageType.CONNECT |
326 | - }; |
327 | - Convert.ToCurrentWaiting(message); |
328 | - } |
329 | - |
330 | - [TestCase("firstData", "secondData")] |
331 | - [TestCase("lastData", "thridData")] |
332 | - public void ToCurrentWaitingTest(string firstData, string secondData) |
333 | - { |
334 | - var message = new SyncDaemonMessage(new List<SyncDaemonMessage.QueuItemMessage>()) |
335 | - { |
336 | - Type = SyncDaemonMessage.MessageType.WAITING |
337 | - }; |
338 | - message.WaitingItems.Add(new SyncDaemonMessage.QueuItemMessage |
339 | - { |
340 | - Node = new SyncDaemonMessage.NodeMessage |
341 | - { |
342 | - NodeId = firstData, |
343 | - Path = firstData, |
344 | - VolumeId = firstData |
345 | - }, |
346 | - Operation = firstData, |
347 | - }); |
348 | - message.WaitingItems.Add(new SyncDaemonMessage.QueuItemMessage |
349 | - { |
350 | - Node = new SyncDaemonMessage.NodeMessage |
351 | - { |
352 | - NodeId = secondData, |
353 | - Path = secondData, |
354 | - VolumeId = secondData |
355 | - }, |
356 | - Operation = secondData, |
357 | - }); |
358 | - var converted = Convert.ToCurrentWaiting(message); |
359 | - foreach (var queueItemData in converted) |
360 | - { |
361 | - Assert.IsTrue(queueItemData.NodeId.Equals(firstData) |
362 | - || queueItemData.NodeId.Equals(secondData)); |
363 | - if (queueItemData.NodeId.Equals(firstData)) |
364 | - { |
365 | - Assert.AreEqual(firstData, queueItemData.Path); |
366 | - Assert.AreEqual(firstData, queueItemData.Path); |
367 | - Assert.AreEqual(firstData, queueItemData.Operation); |
368 | - } |
369 | - else |
370 | - { |
371 | - // do not worry, other possible values will have thrown a fail assertion |
372 | - Assert.AreEqual(secondData, queueItemData.Path); |
373 | - Assert.AreEqual(secondData, queueItemData.Path); |
374 | - Assert.AreEqual(secondData, queueItemData.Operation); |
375 | - } |
376 | - } |
377 | - } |
378 | - |
379 | - [Test] |
380 | - [ExpectedException(typeof(ValidationException))] |
381 | - public void ToCurrentUploadsWrongMessage() |
382 | - { |
383 | - var message = new SyncDaemonMessage |
384 | - { |
385 | - Type = SyncDaemonMessage.MessageType.QUERYROOT |
386 | - }; |
387 | - Convert.ToCurrentUploads(message); |
388 | - } |
389 | - |
390 | - [TestCase("firstData", 54, "secondData", 56)] |
391 | - [TestCase("data", 4, "lastData", 34)] |
392 | - public void ToCurrentUploadsTest(string firstData, int firstWrite, string secondData, int secondWrite) |
393 | - { |
394 | - var message = new SyncDaemonMessage(new List<SyncDaemonMessage.UploadMessage>()) |
395 | - { |
396 | - Type = SyncDaemonMessage.MessageType.UPLOADS |
397 | - }; |
398 | - message.Uploads.Add(new SyncDaemonMessage.UploadMessage |
399 | - { |
400 | - Node = new SyncDaemonMessage.NodeMessage |
401 | - { |
402 | - Path = firstData, |
403 | - NodeId = firstData, |
404 | - VolumeId = firstData |
405 | - }, |
406 | - NumberOfBytesWritten = firstWrite |
407 | - }); |
408 | - message.Uploads.Add(new SyncDaemonMessage.UploadMessage |
409 | - { |
410 | - Node = new SyncDaemonMessage.NodeMessage |
411 | - { |
412 | - Path = secondData, |
413 | - NodeId = secondData, |
414 | - VolumeId = secondData |
415 | - }, |
416 | - NumberOfBytesWritten = secondWrite |
417 | - }); |
418 | - var converted = Convert.ToCurrentUploads(message); |
419 | - foreach (var uploadData in converted) |
420 | - { |
421 | - Assert.IsTrue(uploadData.NodeId.Equals(firstData) |
422 | - || uploadData.NodeId.Equals(secondData)); |
423 | - if (uploadData.NodeId.Equals(firstData)) |
424 | - { |
425 | - Assert.AreEqual(firstWrite, uploadData.NumberOfBytesWritten); |
426 | - Assert.AreEqual(firstData, uploadData.Path); |
427 | - Assert.AreEqual(firstData, uploadData.VolumeId); |
428 | - } |
429 | - else |
430 | - { |
431 | - // do not worry about other values we would have had a fail assertion. |
432 | - Assert.AreEqual(secondWrite, uploadData.NumberOfBytesWritten); |
433 | - Assert.AreEqual(secondData, uploadData.Path); |
434 | - Assert.AreEqual(secondData, uploadData.VolumeId); |
435 | - } |
436 | - } |
437 | - } |
438 | - |
439 | - [Test] |
440 | - [ExpectedException(typeof(ValidationException))] |
441 | - public void ToRootDirectoryWrongMessageTest() |
442 | - { |
443 | - var message = new SyncDaemonMessage |
444 | - { |
445 | - Type = SyncDaemonMessage.MessageType.CONNECT |
446 | - }; |
447 | - Convert.ToRootDirectory(message); |
448 | - } |
449 | - |
450 | - [TestCase("firstRoot")] |
451 | - [TestCase("secondRoot")] |
452 | - public void ToRootDirecotryTest(string root) |
453 | - { |
454 | - var message = new SyncDaemonMessage |
455 | - { |
456 | - Type = SyncDaemonMessage.MessageType.ROOT, |
457 | - Root = root |
458 | - }; |
459 | - var converted = Convert.ToRootDirectory(message); |
460 | - Assert.AreEqual(root, converted); |
461 | - } |
462 | - |
463 | - [Test] |
464 | - [ExpectedException(typeof(ValidationException))] |
465 | - public void ToThrottlingDataWrongMessageTest() |
466 | - { |
467 | - var message = new ConfigurationMessage |
468 | - { |
469 | - Type = ConfigurationMessage.MessageType.ENABLEAUTOSUBSCRIBE |
470 | - }; |
471 | - Convert.ToThrottlingData(message); |
472 | - } |
473 | - |
474 | - [Test] |
475 | - [ExpectedException(typeof(ValidationException))] |
476 | - public void ToThrottlingDataNullPointerTest() |
477 | - { |
478 | - var message = new ConfigurationMessage |
479 | - { |
480 | - Type = ConfigurationMessage.MessageType.THROTTLING, |
481 | - Throttling = null |
482 | - }; |
483 | - Convert.ToThrottlingData(message); |
484 | - } |
485 | - |
486 | - [TestCase(34, 45)] |
487 | - [TestCase(45, 32)] |
488 | - public void ToThrottlingDataTest(int download, int upload) |
489 | - { |
490 | - var message = new ConfigurationMessage |
491 | - { |
492 | - Type = ConfigurationMessage.MessageType.THROTTLING, |
493 | - Throttling = new ConfigurationMessage.ThrottlingLimitsMessage |
494 | - { |
495 | - Download = download, |
496 | - Upload = upload |
497 | - } |
498 | - }; |
499 | - var converted = Convert.ToThrottlingData(message); |
500 | - Assert.AreEqual(download, converted.Download); |
501 | - Assert.AreEqual(upload, converted.Upload); |
502 | - } |
503 | - |
504 | - [Test] |
505 | - [ExpectedException(typeof(ValidationException))] |
506 | - public void ToIsEnabledThrottlingWrongMessageTest() |
507 | - { |
508 | - var message = new ConfigurationMessage |
509 | - { |
510 | - Type = ConfigurationMessage.MessageType.QUERYAUTOSUBSCRIBEENABLED |
511 | - }; |
512 | - Convert.ToIsEnabledThrottling(message); |
513 | - } |
514 | - |
515 | - [TestCase(true)] |
516 | - [TestCase(false)] |
517 | - public void ToIsEnabledThrottlingTest(bool isEnabled) |
518 | - { |
519 | - var message = new ConfigurationMessage |
520 | - { |
521 | - Type = ConfigurationMessage.MessageType.ENABLETHROTTLING, |
522 | - ThrottlingEnabled = isEnabled |
523 | - }; |
524 | - var converted = Convert.ToIsEnabledThrottling(message); |
525 | - Assert.AreEqual(isEnabled, converted); |
526 | - } |
527 | - |
528 | - [Test] |
529 | - [ExpectedException(typeof(ValidationException))] |
530 | - public void ToIsAutosubscribeWrongMessage() |
531 | - { |
532 | - var message = new ConfigurationMessage |
533 | - { |
534 | - Type = ConfigurationMessage.MessageType.THROTTLING |
535 | - }; |
536 | - Convert.ToIsAutosubscribe(message); |
537 | - } |
538 | - |
539 | - [TestCase(true)] |
540 | - [TestCase(false)] |
541 | - public void ToIsAutosubscribeTest(bool isEnabled) |
542 | - { |
543 | - var message = new ConfigurationMessage |
544 | - { |
545 | - Type = ConfigurationMessage.MessageType.ENABLEAUTOSUBSCRIBE, |
546 | - AutosubscribeEnabled = isEnabled |
547 | - }; |
548 | - var converted = Convert.ToIsAutosubscribe(message); |
549 | - Assert.AreEqual(isEnabled, converted); |
550 | - } |
551 | - |
552 | - |
553 | - [Test] |
554 | - [ExpectedException(typeof(ValidationException))] |
555 | - public void ToAllFoldesWrongMessage() |
556 | - { |
557 | - var message = new FolderMessage |
558 | - { |
559 | - Type = FolderMessage.MessageType.CREATEFOLDER |
560 | - }; |
561 | - Convert.ToAllFolders(message); |
562 | - } |
563 | - |
564 | - [TestCase("firstData", true, "secondData", false)] |
565 | - [TestCase("oldData", false, "data", false)] |
566 | - public void ToAllFoldersTest(string firstData, bool firstSubscribed, |
567 | - string secondData, bool secondSubscribed) |
568 | - { |
569 | - var message = new FolderMessage(new List<FolderMessage.UdfDataMessage>()) |
570 | - { |
571 | - Type = FolderMessage.MessageType.FOLDERS |
572 | - }; |
573 | - message.Udfs.Add(new FolderMessage.UdfDataMessage |
574 | - { |
575 | - IsSubscribed = firstSubscribed, |
576 | - SuggestedPath = firstData, |
577 | - Node = new FolderMessage.NodeMessage |
578 | - { |
579 | - NodeId = firstData, |
580 | - VolumeId = firstData, |
581 | - Path = firstData |
582 | - } |
583 | - }); |
584 | - message.Udfs.Add(new FolderMessage.UdfDataMessage |
585 | - { |
586 | - IsSubscribed = secondSubscribed, |
587 | - SuggestedPath = secondData, |
588 | - Node = new FolderMessage.NodeMessage |
589 | - { |
590 | - NodeId = secondData, |
591 | - VolumeId = secondData, |
592 | - Path = secondData |
593 | - } |
594 | - }); |
595 | - var convert = Convert.ToAllFolders(message); |
596 | - Assert.AreEqual(message.Udfs.Count, convert.Count); |
597 | - foreach (var udfData in convert) |
598 | - { |
599 | - Assert.IsTrue(udfData.NodeId.Equals(firstData) |
600 | - || udfData.NodeId.Equals(secondData)); |
601 | - if (udfData.NodeId.Equals(firstData)) |
602 | - { |
603 | - Assert.AreEqual(firstSubscribed, udfData.IsSubscribed); |
604 | - Assert.AreEqual(firstData, udfData.Path); |
605 | - Assert.AreEqual(firstData, udfData.SuggestedPath); |
606 | - Assert.AreEqual(firstData, udfData.VolumeId); |
607 | - } |
608 | - else |
609 | - { |
610 | - Assert.AreEqual(secondSubscribed, udfData.IsSubscribed); |
611 | - Assert.AreEqual(secondData, udfData.Path); |
612 | - Assert.AreEqual(secondData, udfData.SuggestedPath); |
613 | - Assert.AreEqual(secondData, udfData.VolumeId); |
614 | - } |
615 | - } |
616 | - } |
617 | - |
618 | - [Test] |
619 | - [ExpectedException(typeof(ValidationException))] |
620 | - public void TestToUdfDataWrongMessage() |
621 | - { |
622 | - var message = new FolderMessage |
623 | - { |
624 | - Type = FolderMessage.MessageType.CREATEFOLDER |
625 | - }; |
626 | - Convert.ToUdfData(message); |
627 | - } |
628 | - |
629 | - [Test] |
630 | - [ExpectedException(typeof(ValidationException))] |
631 | - public void ToUdfDataWrongNumberUdfs() |
632 | - { |
633 | - var message = new FolderMessage |
634 | - { |
635 | - Type = FolderMessage.MessageType.INFO |
636 | - }; |
637 | - Convert.ToUdfData(message); |
638 | - } |
639 | - |
640 | - [Test] |
641 | - [ExpectedException(typeof(ValidationException))] |
642 | - public void ToUdfDataWrongNumber() |
643 | - { |
644 | - var message = new FolderMessage(new List<FolderMessage.UdfDataMessage>()) |
645 | - { |
646 | - Type = FolderMessage.MessageType.INFO |
647 | - }; |
648 | - Convert.ToUdfData(message); |
649 | - } |
650 | - |
651 | - [TestCase("firstData", true)] |
652 | - [TestCase("oldData", false)] |
653 | - public void ToUdfDataTest(string data, bool isSubscribed) |
654 | - { |
655 | - var message = new FolderMessage(new List<FolderMessage.UdfDataMessage>()) |
656 | - { |
657 | - Type = FolderMessage.MessageType.INFO |
658 | - }; |
659 | - message.Udfs.Add(new FolderMessage.UdfDataMessage |
660 | - { |
661 | - IsSubscribed = isSubscribed, |
662 | - SuggestedPath = data, |
663 | - Node = new FolderMessage.NodeMessage |
664 | - { |
665 | - NodeId = data, |
666 | - VolumeId = data, |
667 | - Path = data |
668 | - } |
669 | - }); |
670 | - var converted = Convert.ToUdfData(message); |
671 | - Assert.AreEqual(data, converted.NodeId); |
672 | - Assert.AreEqual(data, converted.Path); |
673 | - Assert.AreEqual(data, converted.SuggestedPath); |
674 | - Assert.AreEqual(data, converted.VolumeId); |
675 | - Assert.AreEqual(isSubscribed, converted.IsSubscribed); |
676 | - } |
677 | - |
678 | - [Test] |
679 | - [ExpectedException(typeof(ValidationException))] |
680 | - public void ToGetSharesWrongMessageTest() |
681 | - { |
682 | - var message = new ShareMessage |
683 | - { |
684 | - Type = ShareMessage.MessageType.REJECTSHARE |
685 | - }; |
686 | - Convert.ToGetShares(message); |
687 | - } |
688 | - |
689 | - [TestCase("firstData", ShareMessage.AccessLevel.MODIFY, true, 43, |
690 | - "secondData", ShareMessage.AccessLevel.VIEW, false, 23)] |
691 | - [TestCase("oldData", ShareMessage.AccessLevel.VIEW, false, 3, |
692 | - "data", ShareMessage.AccessLevel.VIEW, false, 234)] |
693 | - public void ToGetSharesTest(string firstData, ShareMessage.AccessLevel firstAccess, bool firstAccepted, |
694 | - int firstFreeBytes, string secondData, ShareMessage.AccessLevel secondAccess, bool secondAccepted, |
695 | - int secondFreeBytes) |
696 | - { |
697 | - var message = new ShareMessage(new List<ShareMessage.ShareDataMessage>()) |
698 | - { |
699 | - Type = ShareMessage.MessageType.OTHERSHARES |
700 | - }; |
701 | - message.Shares.Add(new ShareMessage.ShareDataMessage |
702 | - { |
703 | - Access = firstAccess, |
704 | - FreeBytes = firstFreeBytes, |
705 | - IsAccepted = firstAccepted, |
706 | - Name = firstData, |
707 | - Node = new ShareMessage.NodeMessage |
708 | - { |
709 | - Path = firstData, |
710 | - NodeId = firstData, |
711 | - VolumeId = firstData |
712 | - }, |
713 | - OtherUsername = firstData, |
714 | - OtherVisibleName = firstData |
715 | - }); |
716 | - message.Shares.Add(new ShareMessage.ShareDataMessage |
717 | - { |
718 | - Access = secondAccess, |
719 | - FreeBytes = secondFreeBytes, |
720 | - IsAccepted = secondAccepted, |
721 | - Name = secondData, |
722 | - Node = new ShareMessage.NodeMessage |
723 | - { |
724 | - Path = secondData, |
725 | - NodeId = secondData, |
726 | - VolumeId = secondData |
727 | - }, |
728 | - OtherUsername = secondData, |
729 | - OtherVisibleName = secondData |
730 | - }); |
731 | - var converted = Convert.ToGetShares(message); |
732 | - Assert.AreEqual(message.Shares.Count, converted.Count); |
733 | - foreach (var shareData in converted) |
734 | - { |
735 | - Assert.IsTrue(shareData.NodeId.Equals(firstData) |
736 | - || shareData.NodeId.Equals(secondData)); |
737 | - if(shareData.NodeId.Equals(firstData)) |
738 | - { |
739 | - Assert.AreEqual(firstData, shareData.Name); |
740 | - Assert.AreEqual(firstData, shareData.OtherUserName); |
741 | - Assert.AreEqual(firstData, shareData.OtherVisisbleName); |
742 | - Assert.AreEqual(firstData, shareData.Path); |
743 | - Assert.AreEqual(firstData, shareData.VolumeId); |
744 | - Assert.AreEqual(firstAccess.ToString(), shareData.AccessLevel.ToString()); |
745 | - Assert.AreEqual(firstFreeBytes, shareData.FreeBytes); |
746 | - Assert.AreEqual(firstAccepted, shareData.IsAccepted); |
747 | - } |
748 | - else |
749 | - { |
750 | - Assert.AreEqual(secondData, shareData.Name); |
751 | - Assert.AreEqual(secondData, shareData.OtherUserName); |
752 | - Assert.AreEqual(secondData, shareData.OtherVisisbleName); |
753 | - Assert.AreEqual(secondData, shareData.Path); |
754 | - Assert.AreEqual(secondData, shareData.VolumeId); |
755 | - Assert.AreEqual(secondAccess.ToString(), shareData.AccessLevel.ToString()); |
756 | - Assert.AreEqual(secondFreeBytes, shareData.FreeBytes); |
757 | - Assert.AreEqual(secondAccepted, shareData.IsAccepted); |
758 | - } |
759 | - } |
760 | - } |
761 | - |
762 | - |
763 | - #region ISyncDaemonClient conversions |
764 | - |
765 | - [Test] |
766 | - [ExpectedException(typeof(ValidationException))] |
767 | - public void ToDownloadDataWrongMessage() |
768 | - { |
769 | - var message = new SyncDaemonClientMessage |
770 | - { |
771 | - Type = SyncDaemonClientMessage.MessageType.NEWSHARE |
772 | - }; |
773 | - Convert.ToDownloadData(message); |
774 | - } |
775 | - |
776 | - [TestCase("firstData", 43, SyncDaemonClientMessage.MessageType.DOWNLOADSTARTED)] |
777 | - [TestCase("secondData", 2, SyncDaemonClientMessage.MessageType.DOWNLOADFINISHED)] |
778 | - public void ToDownloadDataTest(string data, int numberOfBytes, SyncDaemonClientMessage.MessageType messageType) |
779 | - { |
780 | - var message = new SyncDaemonClientMessage |
781 | - { |
782 | - Type = SyncDaemonClientMessage.MessageType.DOWNLOADSTARTED, |
783 | - Download = new SyncDaemonClientMessage.DownloadMessage |
784 | - { |
785 | - Node = new SyncDaemonClientMessage.NodeMessage |
786 | - { |
787 | - Path = data, |
788 | - VolumeId = data, |
789 | - NodeId = data |
790 | - }, |
791 | - NumberOfBytesRead = numberOfBytes |
792 | - } |
793 | - }; |
794 | - var converted = Convert.ToDownloadData(message); |
795 | - Assert.AreEqual(data, converted.NodeId); |
796 | - Assert.AreEqual(data, converted.Path); |
797 | - Assert.AreEqual(data, converted.VolumeId); |
798 | - Assert.AreEqual(numberOfBytes, converted.NumberOfBytesRead); |
799 | - } |
800 | - |
801 | - [Test] |
802 | - [ExpectedException(typeof(ValidationException))] |
803 | - public void ToUploadDataWrongMessageTest() |
804 | - { |
805 | - var message = new SyncDaemonClientMessage |
806 | - { |
807 | - Type = SyncDaemonClientMessage.MessageType.DOWNLOADSTARTED |
808 | - }; |
809 | - Convert.ToUploadData(message); |
810 | - } |
811 | - |
812 | - [TestCase("firstData", 23, SyncDaemonClientMessage.MessageType.UPLOADSTARTED)] |
813 | - [TestCase("secondData", 255, SyncDaemonClientMessage.MessageType.UPLOADFINISHED)] |
814 | - public void ToUploadDataTest(string data, int bytesWritten, SyncDaemonClientMessage.MessageType messageType) |
815 | - { |
816 | - var message = new SyncDaemonClientMessage |
817 | - { |
818 | - Type = messageType, |
819 | - Upload = new SyncDaemonClientMessage.UploadMessage |
820 | - { |
821 | - Node = new SyncDaemonClientMessage.NodeMessage |
822 | - { |
823 | - Path = data, |
824 | - NodeId = data, |
825 | - VolumeId = data |
826 | - }, |
827 | - NumberOfBytesWritten = bytesWritten |
828 | - } |
829 | - }; |
830 | - var convert = Convert.ToUploadData(message); |
831 | - Assert.AreEqual(data, convert.NodeId); |
832 | - Assert.AreEqual(data, convert.Path); |
833 | - Assert.AreEqual(data, convert.VolumeId); |
834 | - Assert.AreEqual(bytesWritten, convert.NumberOfBytesWritten); |
835 | - } |
836 | - |
837 | - [Test] |
838 | - [ExpectedException(typeof(ValidationException))] |
839 | - public void ToShareDataWrongMessageType() |
840 | - { |
841 | - var message = new SyncDaemonClientMessage |
842 | - { |
843 | - Type = SyncDaemonClientMessage.MessageType.REJECTSHARESUCCESS |
844 | - }; |
845 | - Convert.ToShareData(message); |
846 | - } |
847 | - |
848 | - [TestCase(SyncDaemonClientMessage.MessageType.NEWSHARE, SyncDaemonClientMessage.AccessLevel.MODIFY, |
849 | - 34, true, "firstData")] |
850 | - [TestCase(SyncDaemonClientMessage.MessageType.SHARECHANGED, SyncDaemonClientMessage.AccessLevel.MODIFY, |
851 | - 345, false, "secondData")] |
852 | - public void ToShareDataTest(SyncDaemonClientMessage.MessageType messageType, |
853 | - SyncDaemonClientMessage.AccessLevel access, int freeBytes, bool isAccepted, string data) |
854 | - { |
855 | - var message = new SyncDaemonClientMessage |
856 | - { |
857 | - Type = messageType, |
858 | - Share = new SyncDaemonClientMessage.ShareMessage |
859 | - { |
860 | - AccessLevel = access, |
861 | - FreeBytes = freeBytes, |
862 | - IsAccepted = isAccepted, |
863 | - Name = data, |
864 | - Node = new SyncDaemonClientMessage.NodeMessage |
865 | - { |
866 | - NodeId = data, |
867 | - VolumeId = data, |
868 | - Path = data |
869 | - }, |
870 | - OtherUsername = data, |
871 | - OtherVisibleName = data |
872 | - } |
873 | - }; |
874 | - var convert = Convert.ToShareData(message); |
875 | - Assert.AreEqual(freeBytes, convert.FreeBytes); |
876 | - Assert.AreEqual(isAccepted, convert.IsAccepted); |
877 | - Assert.AreEqual(data, convert.Name); |
878 | - Assert.AreEqual(data, convert.NodeId); |
879 | - Assert.AreEqual(data, convert.OtherUserName); |
880 | - Assert.AreEqual(data, convert.OtherVisisbleName); |
881 | - Assert.AreEqual(data, convert.Path); |
882 | - Assert.AreEqual(data, convert.VolumeId); |
883 | - } |
884 | - |
885 | - #endregion |
886 | - } |
887 | -} |
888 | |
889 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncConfigurationMessageFactoryFixture.cs' |
890 | --- src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncConfigurationMessageFactoryFixture.cs 2010-07-13 09:12:00 +0000 |
891 | +++ src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncConfigurationMessageFactoryFixture.cs 1970-01-01 00:00:00 +0000 |
892 | @@ -1,82 +0,0 @@ |
893 | -/** |
894 | - * Copyright 2010 Canonical Ltd. |
895 | - * |
896 | - * This file is part of UbuntuOne on Windows. |
897 | - * |
898 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
899 | - * it under the terms of the GNU Lesser General Public License version |
900 | - * as published by the Free Software Foundation. |
901 | - * |
902 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
903 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
904 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
905 | - * GNU Lesser General Public License for more details. |
906 | - * |
907 | - * You should have received a copy of the GNU Lesser General Public License |
908 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
909 | - * |
910 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
911 | - */ |
912 | -using Canonical.UbuntuOne.Common; |
913 | -using NUnit.Framework; |
914 | - |
915 | -namespace Canonical.UbuntuOne.ProcessDispatcher.Tests.Protobuf |
916 | -{ |
917 | - [TestFixture] |
918 | - public class SyncConfigurationMessageFactoryFixture |
919 | - { |
920 | - |
921 | - #region Setup |
922 | - |
923 | - private SyncConfigurationMessageFactory _factory; |
924 | - |
925 | - [SetUp] |
926 | - public void Setup() |
927 | - { |
928 | - _factory = new SyncConfigurationMessageFactory(); |
929 | - } |
930 | - |
931 | - #endregion |
932 | - |
933 | - #region Tests |
934 | - |
935 | - [Test] |
936 | - public void QueryThrottlingTest() |
937 | - { |
938 | - var message = _factory.QueryThrottling(); |
939 | - Assert.AreEqual(ConfigurationMessage.MessageType.QUERYTHROTTLING, message.Type); |
940 | - } |
941 | - |
942 | - [TestCase(4, 5)] |
943 | - [TestCase(5, 4)] |
944 | - public void SetThrottlingLimitsTest(int upload, int download) |
945 | - { |
946 | - var data = new ThrottlingData {Upload = upload, Download = download}; |
947 | - var message = _factory.SetThrottlingLimits(data); |
948 | - Assert.AreEqual(ConfigurationMessage.MessageType.SETTHROTTLING, message.Type); |
949 | - Assert.AreEqual(upload, message.Throttling.Upload); |
950 | - Assert.AreEqual(download, message.Throttling.Download); |
951 | - } |
952 | - |
953 | - [TestCase(true)] |
954 | - [TestCase(false)] |
955 | - public void EnableThrottlingTest(bool isEnabled) |
956 | - { |
957 | - var message = _factory.EnableThrottling(isEnabled); |
958 | - Assert.AreEqual(ConfigurationMessage.MessageType.ENABLETHROTTLING, message.Type); |
959 | - Assert.AreEqual(isEnabled, message.ThrottlingEnabled); |
960 | - } |
961 | - |
962 | - [TestCase(true)] |
963 | - [TestCase(false)] |
964 | - public void EnablesAutosubscribeTest(bool isEnabled) |
965 | - { |
966 | - var message = _factory.EnablesAutosubscribe(isEnabled); |
967 | - Assert.AreEqual(ConfigurationMessage.MessageType.ENABLEAUTOSUBSCRIBE, message.Type); |
968 | - Assert.AreEqual(isEnabled, message.AutosubscribeEnabled); |
969 | - } |
970 | - |
971 | - #endregion |
972 | - |
973 | - } |
974 | -} |
975 | |
976 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncDaemonMessageFactoryFixture.cs' |
977 | --- src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncDaemonMessageFactoryFixture.cs 2010-08-10 08:54:30 +0000 |
978 | +++ src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncDaemonMessageFactoryFixture.cs 1970-01-01 00:00:00 +0000 |
979 | @@ -1,107 +0,0 @@ |
980 | -/** |
981 | - * Copyright 2010 Canonical Ltd. |
982 | - * |
983 | - * This file is part of UbuntuOne on Windows. |
984 | - * |
985 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
986 | - * it under the terms of the GNU Lesser General Public License version |
987 | - * as published by the Free Software Foundation. |
988 | - * |
989 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
990 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
991 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
992 | - * GNU Lesser General Public License for more details. |
993 | - * |
994 | - * You should have received a copy of the GNU Lesser General Public License |
995 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
996 | - * |
997 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
998 | - */ |
999 | -using NUnit.Framework; |
1000 | - |
1001 | -namespace Canonical.UbuntuOne.ProcessDispatcher.Tests.Protobuf |
1002 | -{ |
1003 | - |
1004 | - [TestFixture] |
1005 | - public class SyncDaemonMessageFactoryFixture |
1006 | - { |
1007 | - #region Setup |
1008 | - |
1009 | - private SyncDaemonMessageFactory _factory; |
1010 | - |
1011 | - [SetUp] |
1012 | - public void Setup() |
1013 | - { |
1014 | - _factory = new SyncDaemonMessageFactory(); |
1015 | - } |
1016 | - |
1017 | - #endregion |
1018 | - |
1019 | - [Test] |
1020 | - public void QueryStateTest() |
1021 | - { |
1022 | - var message = _factory.QueryState(); |
1023 | - Assert.AreEqual(SyncDaemonMessage.MessageType.QUERYSTATUS, message.Type); |
1024 | - } |
1025 | - |
1026 | - [Test] |
1027 | - public void QueryRootTest() |
1028 | - { |
1029 | - var message = _factory.QueryRoot(); |
1030 | - Assert.AreEqual(SyncDaemonMessage.MessageType.QUERYROOT, message.Type); |
1031 | - } |
1032 | - |
1033 | - [Test] |
1034 | - public void QueryDownloadsTest() |
1035 | - { |
1036 | - var message = _factory.QueryDownloads(); |
1037 | - Assert.AreEqual(SyncDaemonMessage.MessageType.QUERYDOWNLOADS, message.Type); |
1038 | - } |
1039 | - |
1040 | - [Test] |
1041 | - public void QueryWaitingTest() |
1042 | - { |
1043 | - var message = _factory.QueryWaiting(); |
1044 | - Assert.AreEqual(SyncDaemonMessage.MessageType.QUERYWAITING, message.Type); |
1045 | - } |
1046 | - |
1047 | - [Test] |
1048 | - public void QueryUploadsTest() |
1049 | - { |
1050 | - var message = _factory.QueryUploads(); |
1051 | - Assert.AreEqual(SyncDaemonMessage.MessageType.QUERYUPLOADS, message.Type); |
1052 | - } |
1053 | - |
1054 | - [TestCase("NodeId1", "ShareId1")] |
1055 | - [TestCase("NodeId2", "ShareId2")] |
1056 | - [TestCase("NodeId3", "ShareId3")] |
1057 | - public void ScheduleAsNextTest(string shareId, string nodeId) |
1058 | - { |
1059 | - var message = _factory.ScheduleAsNext(shareId, nodeId); |
1060 | - Assert.AreEqual(SyncDaemonMessage.MessageType.SCHEDULENEXT, message.Type); |
1061 | - Assert.AreEqual(nodeId, message.NextNodeId); |
1062 | - Assert.AreEqual(shareId, message.NextShareId); |
1063 | - } |
1064 | - |
1065 | - [Test] |
1066 | - public void ConnectTest() |
1067 | - { |
1068 | - var message = _factory.Connect(); |
1069 | - Assert.AreEqual(SyncDaemonMessage.MessageType.CONNECT, message.Type); |
1070 | - } |
1071 | - |
1072 | - [Test] |
1073 | - public void DisconnectTest() |
1074 | - { |
1075 | - var message = _factory.Disconnect(); |
1076 | - Assert.AreEqual(SyncDaemonMessage.MessageType.DISCONNECT, message.Type); |
1077 | - } |
1078 | - |
1079 | - [Test] |
1080 | - public void QuitTest() |
1081 | - { |
1082 | - var message = _factory.Quit(); |
1083 | - Assert.AreEqual(SyncDaemonMessage.MessageType.QUIT, message.Type); |
1084 | - } |
1085 | - } |
1086 | -} |
1087 | |
1088 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncFolderMessageFactoryFixture.cs' |
1089 | --- src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncFolderMessageFactoryFixture.cs 2010-08-11 08:05:19 +0000 |
1090 | +++ src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncFolderMessageFactoryFixture.cs 1970-01-01 00:00:00 +0000 |
1091 | @@ -1,147 +0,0 @@ |
1092 | -/** |
1093 | - * Copyright 2010 Canonical Ltd. |
1094 | - * |
1095 | - * This file is part of UbuntuOne on Windows. |
1096 | - * |
1097 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
1098 | - * it under the terms of the GNU Lesser General Public License version |
1099 | - * as published by the Free Software Foundation. |
1100 | - * |
1101 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
1102 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1103 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1104 | - * GNU Lesser General Public License for more details. |
1105 | - * |
1106 | - * You should have received a copy of the GNU Lesser General Public License |
1107 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
1108 | - * |
1109 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
1110 | - */ |
1111 | -using Canonical.UbuntuOne.Common.Validation; |
1112 | -using NUnit.Framework; |
1113 | - |
1114 | -namespace Canonical.UbuntuOne.ProcessDispatcher.Tests.Protobuf |
1115 | -{ |
1116 | - [TestFixture] |
1117 | - public class SyncFolderMessageFactoryFixture |
1118 | - { |
1119 | - |
1120 | - #region Setup |
1121 | - |
1122 | - private SyncFolderMessageFactory _factory; |
1123 | - |
1124 | - [SetUp] |
1125 | - public void Setup() |
1126 | - { |
1127 | - _factory = new SyncFolderMessageFactory(); |
1128 | - } |
1129 | - |
1130 | - #endregion |
1131 | - |
1132 | - #region Tests |
1133 | - |
1134 | - [Test] |
1135 | - [ExpectedException(typeof(ValidationException))] |
1136 | - public void CreateFolderNullTest() |
1137 | - { |
1138 | - _factory.CreateFolder(null); |
1139 | - } |
1140 | - |
1141 | - [Test] |
1142 | - [ExpectedException(typeof(ValidationException))] |
1143 | - public void CreateFolderEmptyTest() |
1144 | - { |
1145 | - _factory.CreateFolder(""); |
1146 | - } |
1147 | - |
1148 | - [TestCase(@"/first/path")] |
1149 | - [TestCase(@"/second/path")] |
1150 | - public void CreateFolderTest(string path) |
1151 | - { |
1152 | - var message = _factory.CreateFolder(path); |
1153 | - Assert.AreEqual(FolderMessage.MessageType.CREATEFOLDER, message.Type); |
1154 | - Assert.AreEqual(path, message.Path); |
1155 | - } |
1156 | - |
1157 | - [Test] |
1158 | - [ExpectedException(typeof(ValidationException))] |
1159 | - public void DeleteFolderNullTest() |
1160 | - { |
1161 | - _factory.DeleteFolder(null); |
1162 | - } |
1163 | - |
1164 | - [Test] |
1165 | - [ExpectedException(typeof(ValidationException))] |
1166 | - public void DeleteFolderEmptyTest() |
1167 | - { |
1168 | - _factory.DeleteFolder(""); |
1169 | - } |
1170 | - |
1171 | - [TestCase(@"/first/path")] |
1172 | - [TestCase(@"/second/path")] |
1173 | - public void DeleteFolderTest(string path) |
1174 | - { |
1175 | - var message = _factory.DeleteFolder(path); |
1176 | - Assert.AreEqual(FolderMessage.MessageType.DELETEFOLDER, message.Type); |
1177 | - Assert.AreEqual(path, message.Path); |
1178 | - } |
1179 | - |
1180 | - [Test] |
1181 | - public void QueryFoldersTest() |
1182 | - { |
1183 | - var message = _factory.QueryFolders(); |
1184 | - Assert.AreEqual(FolderMessage.MessageType.QUERYFOLDERS, message.Type); |
1185 | - } |
1186 | - |
1187 | - [Test] |
1188 | - [ExpectedException(typeof(ValidationException))] |
1189 | - public void SubscribeNullTest() |
1190 | - { |
1191 | - _factory.Subscribe(null); |
1192 | - } |
1193 | - |
1194 | - [Test] |
1195 | - [ExpectedException(typeof(ValidationException))] |
1196 | - public void SubscribeEmptyTest() |
1197 | - { |
1198 | - _factory.Subscribe(""); |
1199 | - } |
1200 | - |
1201 | - [TestCase(@"/first/path")] |
1202 | - [TestCase(@"/second/path")] |
1203 | - public void SubscribeTest(string path) |
1204 | - { |
1205 | - var message = _factory.Subscribe(path); |
1206 | - Assert.AreEqual(FolderMessage.MessageType.SUBSCRIBE, message.Type); |
1207 | - Assert.AreEqual(path, message.Path); |
1208 | - } |
1209 | - |
1210 | - [Test] |
1211 | - public void RefreshFolders() |
1212 | - { |
1213 | - var message = _factory.RefreshVolumes(); |
1214 | - Assert.AreEqual(FolderMessage.MessageType.REFRESH, message.Type); |
1215 | - } |
1216 | - |
1217 | - [TestCase("firstPath")] |
1218 | - [TestCase("secondPath")] |
1219 | - public void QueryInfoTest(string path) |
1220 | - { |
1221 | - var message = _factory.QueryInfo(path); |
1222 | - Assert.AreEqual(path, message.Path); |
1223 | - Assert.AreEqual(FolderMessage.MessageType.QUERYINFO, message.Type); |
1224 | - } |
1225 | - |
1226 | - [TestCase("firstId")] |
1227 | - [TestCase("secondId")] |
1228 | - public void UnsubscribeTest(string id) |
1229 | - { |
1230 | - var message = _factory.Unsubscribe(id); |
1231 | - Assert.AreEqual(id, message.Path); |
1232 | - Assert.AreEqual(FolderMessage.MessageType.UNSUBSCRIBE, message.Type); |
1233 | - } |
1234 | - |
1235 | - #endregion |
1236 | - |
1237 | - } |
1238 | -} |
1239 | |
1240 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncShareMessageFactoryFixture.cs' |
1241 | --- src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncShareMessageFactoryFixture.cs 2010-07-13 09:12:00 +0000 |
1242 | +++ src/Canonical.UbuntuOne.ProcessDispatcher.Tests/Protobuf/SyncShareMessageFactoryFixture.cs 1970-01-01 00:00:00 +0000 |
1243 | @@ -1,138 +0,0 @@ |
1244 | -/** |
1245 | - * Copyright 2010 Canonical Ltd. |
1246 | - * |
1247 | - * This file is part of UbuntuOne on Windows. |
1248 | - * |
1249 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
1250 | - * it under the terms of the GNU Lesser General Public License version |
1251 | - * as published by the Free Software Foundation. |
1252 | - * |
1253 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
1254 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1255 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1256 | - * GNU Lesser General Public License for more details. |
1257 | - * |
1258 | - * You should have received a copy of the GNU Lesser General Public License |
1259 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
1260 | - * |
1261 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
1262 | - */ |
1263 | -using Canonical.UbuntuOne.Common; |
1264 | -using Canonical.UbuntuOne.Common.Validation; |
1265 | -using NUnit.Framework; |
1266 | - |
1267 | -namespace Canonical.UbuntuOne.ProcessDispatcher.Tests |
1268 | -{ |
1269 | - [TestFixture] |
1270 | - public class SyncShareMessageFactoryFixture |
1271 | - { |
1272 | - #region Setup |
1273 | - |
1274 | - private SyncShareMessageFactory _factory; |
1275 | - |
1276 | - [SetUp] |
1277 | - public void Setup() |
1278 | - { |
1279 | - _factory = new SyncShareMessageFactory(); |
1280 | - } |
1281 | - |
1282 | - |
1283 | - #endregion |
1284 | - |
1285 | - #region Tests |
1286 | - |
1287 | - [Test] |
1288 | - public void QuerySharesTest() |
1289 | - { |
1290 | - var message = _factory.QueryShares(); |
1291 | - Assert.AreEqual(ShareMessage.MessageType.QUERYOTHERSHARES, message.Type); |
1292 | - } |
1293 | - |
1294 | - [Test] |
1295 | - [ExpectedException(typeof(ValidationException))] |
1296 | - public void AcceptShareNullTest() |
1297 | - { |
1298 | - _factory.AcceptShare(null); |
1299 | - } |
1300 | - |
1301 | - [Test] |
1302 | - [ExpectedException(typeof(ValidationException))] |
1303 | - public void AcceptShareEmptyTest() |
1304 | - { |
1305 | - _factory.AcceptShare(""); |
1306 | - } |
1307 | - |
1308 | - |
1309 | - [TestCase(@"/first/path")] |
1310 | - [TestCase(@"/second/path")] |
1311 | - public void AcceptShareTest(string path) |
1312 | - { |
1313 | - var message = _factory.AcceptShare(path); |
1314 | - Assert.AreEqual(ShareMessage.MessageType.ACCEPTSHARE, message.Type); |
1315 | - Assert.AreEqual(path, message.ShareId); |
1316 | - } |
1317 | - |
1318 | - [Test] |
1319 | - [ExpectedException(typeof(ValidationException))] |
1320 | - public void RejectShareNullTest() |
1321 | - { |
1322 | - _factory.RejectShare(null); |
1323 | - } |
1324 | - |
1325 | - [Test] |
1326 | - [ExpectedException(typeof(ValidationException))] |
1327 | - public void RejectShareEmptyTest() |
1328 | - { |
1329 | - _factory.RejectShare(""); |
1330 | - } |
1331 | - |
1332 | - [TestCase(@"/first/path")] |
1333 | - [TestCase(@"/second/path")] |
1334 | - public void RejectShareTest(string path) |
1335 | - { |
1336 | - var message = _factory.RejectShare(path); |
1337 | - Assert.AreEqual(ShareMessage.MessageType.REJECTSHARE, message.Type); |
1338 | - Assert.AreEqual(path, message.ShareId); |
1339 | - } |
1340 | - |
1341 | - [TestCase(null, "username", "name", AccessLevel.VIEW)] |
1342 | - [TestCase("", "username", "name", AccessLevel.VIEW)] |
1343 | - [TestCase("path", null, "name", AccessLevel.VIEW)] |
1344 | - [TestCase("path", "", "name", AccessLevel.VIEW)] |
1345 | - [TestCase("path", "username", null, AccessLevel.VIEW)] |
1346 | - [TestCase("path", "username", "", AccessLevel.VIEW)] |
1347 | - [ExpectedException(typeof(ValidationException))] |
1348 | - public void CreatePathFailureTest(string path, string username, string name, AccessLevel level) |
1349 | - { |
1350 | - _factory.CreateShare(path, username, name, level); |
1351 | - } |
1352 | - |
1353 | - [TestCase("firstPath", "mandel", "myShare", ShareMessage.AccessLevel.MODIFY)] |
1354 | - [TestCase("secondPath", "beeita", "photos", ShareMessage.AccessLevel.VIEW)] |
1355 | - public void CreateShare(string path, string username, string name, AccessLevel level) |
1356 | - { |
1357 | - var message = _factory.CreateShare(path, username, name, level); |
1358 | - Assert.AreEqual(ShareMessage.MessageType.CREATESHARE, message.Type); |
1359 | - Assert.AreEqual(path, message.Path); |
1360 | - Assert.AreEqual(username, message.Username); |
1361 | - Assert.AreEqual(name, message.Name); |
1362 | - } |
1363 | - |
1364 | - [Test] |
1365 | - public void UpdateSharesTest() |
1366 | - { |
1367 | - var message = _factory.UpdateShares(); |
1368 | - Assert.AreEqual(ShareMessage.MessageType.UPDATESHARES, message.Type); |
1369 | - } |
1370 | - |
1371 | - [Test] |
1372 | - public void GetSharedTest() |
1373 | - { |
1374 | - var message = _factory.GetShared(); |
1375 | - Assert.AreEqual(ShareMessage.MessageType.QUERYSHARED, message.Type); |
1376 | - } |
1377 | - #endregion |
1378 | - } |
1379 | -} |
1380 | - |
1381 | - |
1382 | |
1383 | === modified file 'src/Canonical.UbuntuOne.ProcessDispatcher/Canonical.UbuntuOne.ProcessDispatcher.csproj' |
1384 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Canonical.UbuntuOne.ProcessDispatcher.csproj 2010-08-24 15:59:03 +0000 |
1385 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Canonical.UbuntuOne.ProcessDispatcher.csproj 2010-08-24 15:59:04 +0000 |
1386 | @@ -74,15 +74,10 @@ |
1387 | <Compile Include="CallerContext.cs" /> |
1388 | <Compile Include="EventNotifier.cs" /> |
1389 | <Compile Include="ICallerContext.cs" /> |
1390 | - <Compile Include="IEventDispatcher.cs" /> |
1391 | <Compile Include="Program.cs" /> |
1392 | <Compile Include="ProjectInstaller.cs"> |
1393 | <SubType>Component</SubType> |
1394 | </Compile> |
1395 | - <Compile Include="Protobuf\FolderMessageExtensions.cs" /> |
1396 | - <Compile Include="Protobuf\IProtobufSerializer.cs" /> |
1397 | - <Compile Include="Protobuf\ProtobufSerializer.cs" /> |
1398 | - <Compile Include="Protobuf\ShareMessageExtensions.cs" /> |
1399 | <Compile Include="SyncConfigurationService.cs" /> |
1400 | <Compile Include="SyncDaemonService.cs" /> |
1401 | <Compile Include="SyncDaemonWindowsService.cs"> |
1402 | @@ -92,21 +87,6 @@ |
1403 | <Compile Include="SyncFoldersService.cs" /> |
1404 | <Compile Include="SyncSharesService.cs" /> |
1405 | <Compile Include="Properties\AssemblyInfo.cs" /> |
1406 | - <Compile Include="Protobuf\Configuration.cs" /> |
1407 | - <Compile Include="Protobuf\Convert.cs" /> |
1408 | - <Compile Include="Protobuf\Folder.cs" /> |
1409 | - <Compile Include="Protobuf\ISyncConfigurationMessageFactory.cs" /> |
1410 | - <Compile Include="Protobuf\ISyncDaemonMessageFactory.cs" /> |
1411 | - <Compile Include="Protobuf\ISyncFolderMessageFactory.cs" /> |
1412 | - <Compile Include="Protobuf\ISyncShareMessageFactory.cs" /> |
1413 | - <Compile Include="Protobuf\Shares.cs" /> |
1414 | - <Compile Include="Protobuf\SyncConfigurationMessageFactory.cs" /> |
1415 | - <Compile Include="Protobuf\SyncDaemon.cs" /> |
1416 | - <Compile Include="Protobuf\SyncDaemonClient.cs" /> |
1417 | - <Compile Include="Protobuf\SyncDaemonMessageFactory.cs" /> |
1418 | - <Compile Include="Protobuf\SyncFolderMessageFactory.cs" /> |
1419 | - <Compile Include="Protobuf\SyncShareMessageFactory.cs" /> |
1420 | - <Compile Include="Protobuf\SyncDaemonMessageExtensions.cs" /> |
1421 | </ItemGroup> |
1422 | <ItemGroup> |
1423 | <Reference Include="Common.Logging.Log4Net, Version=1.2.0.2, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL"> |
1424 | |
1425 | === modified file 'src/Canonical.UbuntuOne.ProcessDispatcher/EventNotifier.cs' |
1426 | --- src/Canonical.UbuntuOne.ProcessDispatcher/EventNotifier.cs 2010-08-24 15:59:03 +0000 |
1427 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/EventNotifier.cs 2010-08-24 15:59:04 +0000 |
1428 | @@ -80,17 +80,6 @@ |
1429 | #region DI properties |
1430 | |
1431 | /// <summary> |
1432 | - /// Gets and sets the protobuf serializer that is used to deserialize the messages comming from python. |
1433 | - /// </summary> |
1434 | - internal IProtobufSerializer ProtobufSerializer { get; set; } |
1435 | - |
1436 | - /// <summary> |
1437 | - /// Gets and sets the event dispatcher that is used to notify the different clients about |
1438 | - /// an event. |
1439 | - /// </summary> |
1440 | - internal IEventDispatcher EventDispatcher { get; set; } |
1441 | - |
1442 | - /// <summary> |
1443 | /// Gets and sets the object that is used to retrieve the information of the object |
1444 | /// that performs the different WCF calls. |
1445 | /// </summary> |
1446 | |
1447 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/IEventDispatcher.cs' |
1448 | --- src/Canonical.UbuntuOne.ProcessDispatcher/IEventDispatcher.cs 2010-08-16 12:46:11 +0000 |
1449 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/IEventDispatcher.cs 1970-01-01 00:00:00 +0000 |
1450 | @@ -1,40 +0,0 @@ |
1451 | -/* |
1452 | - * Copyright 2010 Canonical Ltd. |
1453 | - * |
1454 | - * This file is part of UbuntuOne on Windows. |
1455 | - * |
1456 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
1457 | - * it under the terms of the GNU Lesser General Public License version |
1458 | - * as published by the Free Software Foundation. |
1459 | - * |
1460 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
1461 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1462 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1463 | - * GNU Lesser General Public License for more details. |
1464 | - * |
1465 | - * You should have received a copy of the GNU Lesser General Public License |
1466 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
1467 | - * |
1468 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
1469 | - */ |
1470 | -using System.Collections.Generic; |
1471 | -using Canonical.UbuntuOne.Common; |
1472 | - |
1473 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
1474 | -{ |
1475 | - /// <summary> |
1476 | - /// Interface to be implemented by an object that knows how to dispatch events froma protobuf message |
1477 | - /// to a collection of ISyncDaemonClients. |
1478 | - /// </summary> |
1479 | - internal interface IEventDispatcher |
1480 | - { |
1481 | - /// <summary> |
1482 | - /// Method that ensures that an event that is given in a particular protobuf message |
1483 | - /// is notified to all the different clients. |
1484 | - /// </summary> |
1485 | - /// <param name="clientMessage">The client message that was sent by the python code.</param> |
1486 | - /// <param name="clients">An enumerable that contains all those clients that have to be notified about the |
1487 | - /// particular event.</param> |
1488 | - void Dispatch(SyncDaemonClientMessage clientMessage, IEnumerable<ISyncDaemonClient> clients); |
1489 | - } |
1490 | -} |
1491 | |
1492 | === removed directory 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf' |
1493 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Configuration.cs' |
1494 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Configuration.cs 2010-07-13 09:12:00 +0000 |
1495 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Configuration.cs 1970-01-01 00:00:00 +0000 |
1496 | @@ -1,107 +0,0 @@ |
1497 | -//------------------------------------------------------------------------------ |
1498 | -// <auto-generated> |
1499 | -// This code was generated by a tool. |
1500 | -// |
1501 | -// Changes to this file may cause incorrect behavior and will be lost if |
1502 | -// the code is regenerated. |
1503 | -// </auto-generated> |
1504 | -//------------------------------------------------------------------------------ |
1505 | - |
1506 | -// Generated from: configuration.proto |
1507 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
1508 | -{ |
1509 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ConfigurationMessage")] |
1510 | - public partial class ConfigurationMessage : global::ProtoBuf.IExtensible |
1511 | - { |
1512 | - public ConfigurationMessage() {} |
1513 | - |
1514 | - private ConfigurationMessage.MessageType _type; |
1515 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
1516 | - public ConfigurationMessage.MessageType Type |
1517 | - { |
1518 | - get { return _type; } |
1519 | - set { _type = value; } |
1520 | - } |
1521 | - |
1522 | - private ConfigurationMessage.ThrottlingLimitsMessage _throttling = null; |
1523 | - [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"throttling", DataFormat = global::ProtoBuf.DataFormat.Default)] |
1524 | - [global::System.ComponentModel.DefaultValue(null)] |
1525 | - public ConfigurationMessage.ThrottlingLimitsMessage Throttling |
1526 | - { |
1527 | - get { return _throttling; } |
1528 | - set { _throttling = value; } |
1529 | - } |
1530 | - |
1531 | - private bool _throttlingEnabled = default(bool); |
1532 | - [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"throttling_enabled", DataFormat = global::ProtoBuf.DataFormat.Default)] |
1533 | - [global::System.ComponentModel.DefaultValue(default(bool))] |
1534 | - public bool ThrottlingEnabled |
1535 | - { |
1536 | - get { return _throttlingEnabled; } |
1537 | - set { _throttlingEnabled = value; } |
1538 | - } |
1539 | - |
1540 | - private bool _autosubscribeEnabled = default(bool); |
1541 | - [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"autosubscribe_enabled", DataFormat = global::ProtoBuf.DataFormat.Default)] |
1542 | - [global::System.ComponentModel.DefaultValue(default(bool))] |
1543 | - public bool AutosubscribeEnabled |
1544 | - { |
1545 | - get { return _autosubscribeEnabled; } |
1546 | - set { _autosubscribeEnabled = value; } |
1547 | - } |
1548 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ThrottlingLimitsMessage")] |
1549 | - public partial class ThrottlingLimitsMessage : global::ProtoBuf.IExtensible |
1550 | - { |
1551 | - public ThrottlingLimitsMessage() {} |
1552 | - |
1553 | - private int _upload; |
1554 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"upload", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
1555 | - public int Upload |
1556 | - { |
1557 | - get { return _upload; } |
1558 | - set { _upload = value; } |
1559 | - } |
1560 | - private int _download; |
1561 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"download", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
1562 | - public int Download |
1563 | - { |
1564 | - get { return _download; } |
1565 | - set { _download = value; } |
1566 | - } |
1567 | - private global::ProtoBuf.IExtension extensionObject; |
1568 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
1569 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
1570 | - } |
1571 | - |
1572 | - [global::ProtoBuf.ProtoContract(Name=@"MessageType")] |
1573 | - public enum MessageType |
1574 | - { |
1575 | - |
1576 | - [global::ProtoBuf.ProtoEnum(Name=@"QUERY_THROTTLING", Value=1)] |
1577 | - QUERYTHROTTLING = 1, |
1578 | - |
1579 | - [global::ProtoBuf.ProtoEnum(Name=@"THROTTLING", Value=2)] |
1580 | - THROTTLING = 2, |
1581 | - |
1582 | - [global::ProtoBuf.ProtoEnum(Name=@"SET_THROTTLING", Value=3)] |
1583 | - SETTHROTTLING = 3, |
1584 | - |
1585 | - [global::ProtoBuf.ProtoEnum(Name=@"ENABLE_THROTTLING", Value=4)] |
1586 | - ENABLETHROTTLING = 4, |
1587 | - |
1588 | - [global::ProtoBuf.ProtoEnum(Name=@"QUERY_THROTTLING_ENABLED", Value=5)] |
1589 | - QUERYTHROTTLINGENABLED = 5, |
1590 | - |
1591 | - [global::ProtoBuf.ProtoEnum(Name=@"ENABLE_AUTOSUBSCRIBE", Value=6)] |
1592 | - ENABLEAUTOSUBSCRIBE = 6, |
1593 | - |
1594 | - [global::ProtoBuf.ProtoEnum(Name=@"QUERY_AUTOSUBSCRIBE_ENABLED", Value=7)] |
1595 | - QUERYAUTOSUBSCRIBEENABLED = 7 |
1596 | - } |
1597 | - |
1598 | - private global::ProtoBuf.IExtension extensionObject; |
1599 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
1600 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
1601 | - } |
1602 | - |
1603 | -} |
1604 | \ No newline at end of file |
1605 | |
1606 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Convert.cs' |
1607 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Convert.cs 2010-08-11 08:05:19 +0000 |
1608 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Convert.cs 1970-01-01 00:00:00 +0000 |
1609 | @@ -1,473 +0,0 @@ |
1610 | -/* |
1611 | - * Copyright 2010 Canonical Ltd. |
1612 | - * |
1613 | - * This file is part of UbuntuOne on Windows. |
1614 | - * |
1615 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
1616 | - * it under the terms of the GNU Lesser General Public License version |
1617 | - * as published by the Free Software Foundation. |
1618 | - * |
1619 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
1620 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1621 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1622 | - * GNU Lesser General Public License for more details. |
1623 | - * |
1624 | - * You should have received a copy of the GNU Lesser General Public License |
1625 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
1626 | - * |
1627 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
1628 | - */ |
1629 | -using System.Collections.Generic; |
1630 | -using System.Linq; |
1631 | -using Canonical.UbuntuOne.Common; |
1632 | -using Canonical.UbuntuOne.Common.Validation; |
1633 | -using log4net; |
1634 | - |
1635 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
1636 | -{ |
1637 | - /// <summary> |
1638 | - /// This class provides a collection of method that allows to onvert a SyncDaemon message that |
1639 | - /// used protobuf to talk with the python process into a data contract that the .Net languages |
1640 | - /// can use. |
1641 | - /// </summary> |
1642 | - internal static class Convert |
1643 | - { |
1644 | - private static ILog _logger = LogManager.GetLogger(typeof(Convert)); |
1645 | - |
1646 | - #region ISycnDaemon related conversions |
1647 | - |
1648 | - /// <summary> |
1649 | - /// Allows to extract the required information from a sync daemon message and stored in |
1650 | - /// a data contract that can be consummed by the .Net languages. |
1651 | - /// </summary> |
1652 | - /// <param name="daemonMessage">The sync daemon message that was returned by the |
1653 | - /// python process.</param> |
1654 | - /// <returns>A sate data that can be consummed by the .Net languages.</returns> |
1655 | - public static StateData ToStateData(SyncDaemonMessage daemonMessage) |
1656 | - { |
1657 | - ValidateArgs.Begin() |
1658 | - .IsEqual(daemonMessage.Type, SyncDaemonMessage.MessageType.STATUS) |
1659 | - .IsNotNull(daemonMessage.State, "daemonMessage.state") |
1660 | - .Check(); |
1661 | - |
1662 | - return new StateData |
1663 | - { |
1664 | - Description = daemonMessage.State.Description, |
1665 | - IsConnected = daemonMessage.State.IsConnected, |
1666 | - IsError = daemonMessage.State.IsError, |
1667 | - IsOnline = daemonMessage.State.IsOnline, |
1668 | - Name = daemonMessage.State.Name |
1669 | - }; |
1670 | - } |
1671 | - |
1672 | - /// <summary> |
1673 | - /// Allows to perform the conversion between a download proto message and a dowload data |
1674 | - /// contract that can be consummed by .Net languages. |
1675 | - /// </summary> |
1676 | - /// <param name="downloadProto">The proto to be converted to a data contract.</param> |
1677 | - /// <returns>A data contract that has the smae data as the one provided by the proto.</returns> |
1678 | - private static DownloadData ToDownloadData(SyncDaemonMessage.DownloadMessage downloadProto) |
1679 | - { |
1680 | - ValidateArgs.Begin() |
1681 | - .IsNotNull(downloadProto) |
1682 | - .Check(); |
1683 | - |
1684 | - return new DownloadData |
1685 | - { |
1686 | - NodeId = downloadProto.Node.NodeId, |
1687 | - NumberOfBytesRead = downloadProto.NumberOfBytesRead, |
1688 | - Path = downloadProto.Node.Path, |
1689 | - VolumeId = downloadProto.Node.VolumeId |
1690 | - }; |
1691 | - } |
1692 | - |
1693 | - /// <summary> |
1694 | - /// Allows to convert a message that contains a collection of downloads to a |
1695 | - /// collection of data contracts that can be consummed by the .Net languages. |
1696 | - /// </summary> |
1697 | - /// <param name="daemonMessage">The message that contains the response of the |
1698 | - /// query to retrieve all the current downloads.</param> |
1699 | - /// <returns>A collection of data contracts with the information that the message has.</returns> |
1700 | - public static IList<DownloadData> ToCurrentDownloads (SyncDaemonMessage daemonMessage) |
1701 | - { |
1702 | - |
1703 | - ValidateArgs.Begin () |
1704 | - .IsEqual (daemonMessage.Type, SyncDaemonMessage.MessageType.DOWNLOADS) |
1705 | - .IsNotNull (daemonMessage.Downloads, "daemonMessage.download") |
1706 | - .Check (); |
1707 | - |
1708 | - return daemonMessage.Downloads.Select(proto => ToDownloadData(proto)).ToList(); |
1709 | - } |
1710 | - |
1711 | - /// <summary> |
1712 | - /// Allows to perform the conversion between a queue item proto and a data contract that |
1713 | - /// can be consummed by the .Net languages. |
1714 | - /// </summary> |
1715 | - /// <param name="queuItemProto">The proto whose information we are going to retrienve.</param> |
1716 | - /// <returns>A data contract that can be consummed by the .Net languages.</returns> |
1717 | - private static QueueItemData ToQueueItemData(SyncDaemonMessage.QueuItemMessage queuItemProto) |
1718 | - { |
1719 | - ValidateArgs.Begin() |
1720 | - .IsNotNull(queuItemProto) |
1721 | - .Check(); |
1722 | - |
1723 | - return new QueueItemData |
1724 | - { |
1725 | - NodeId = queuItemProto.Node.NodeId, |
1726 | - Operation = queuItemProto.Operation, |
1727 | - Path = queuItemProto.Node.Path, |
1728 | - VolumeId = queuItemProto.Node.VolumeId |
1729 | - }; |
1730 | - } |
1731 | - |
1732 | - /// <summary> |
1733 | - /// Allows to convert a sync daemon message to a collection of queue items. This allows |
1734 | - /// to convert the proto message to a list of contracts that can be consummed by the .Net |
1735 | - /// languages. |
1736 | - /// </summary> |
1737 | - /// <param name="daemonMessage">The message returned by the daemon.</param> |
1738 | - /// <returns>A list of data contract that can be consummed by .Net languages.</returns> |
1739 | - public static IList<QueueItemData> ToCurrentWaiting(SyncDaemonMessage daemonMessage) |
1740 | - { |
1741 | - ValidateArgs.Begin() |
1742 | - .IsEqual(daemonMessage.Type, SyncDaemonMessage.MessageType.WAITING) |
1743 | - .IsNotNull(daemonMessage.WaitingItems, "daemonMessage.waiting") |
1744 | - .Check(); |
1745 | - |
1746 | - return daemonMessage.WaitingItems.Select(proto => ToQueueItemData(proto)).ToList(); |
1747 | - } |
1748 | - |
1749 | - /// <summary> |
1750 | - /// Allows to convert an upload proto in a data contract that can be used by |
1751 | - /// the .Net languages. |
1752 | - /// </summary> |
1753 | - /// <param name="uploadProto">The upload proto that we are going to convert to a |
1754 | - /// data contract.</param> |
1755 | - /// <returns>A data contrac that represents the data of the proto and that can |
1756 | - /// be consummed by the .Net languages.</returns> |
1757 | - private static UploadData ToUploadData(SyncDaemonMessage.UploadMessage uploadProto) |
1758 | - { |
1759 | - ValidateArgs.Begin() |
1760 | - .IsNotNull(uploadProto) |
1761 | - .Check(); |
1762 | - return new UploadData |
1763 | - { |
1764 | - NodeId = uploadProto.Node.NodeId, |
1765 | - NumberOfBytesWritten = uploadProto.NumberOfBytesWritten, |
1766 | - Path = uploadProto.Node.Path, |
1767 | - VolumeId = uploadProto.Node.VolumeId |
1768 | - }; |
1769 | - } |
1770 | - |
1771 | - /// <summary> |
1772 | - /// Allows to convert an daemon message into a collection of data contrac that can |
1773 | - /// be consummed by the .Net languages. |
1774 | - /// </summary> |
1775 | - /// <param name="daemonMessage">The message comming from the daemon that we have |
1776 | - /// to convert.</param> |
1777 | - /// <returns>A collection of data contract that can be consummed by the .Net |
1778 | - /// languages.</returns> |
1779 | - public static IList<UploadData> ToCurrentUploads(SyncDaemonMessage daemonMessage) |
1780 | - { |
1781 | - ValidateArgs.Begin() |
1782 | - .IsEqual(daemonMessage.Type, SyncDaemonMessage.MessageType.UPLOADS) |
1783 | - .IsNotNull(daemonMessage.Uploads, "daemonMessage.upload") |
1784 | - .Check(); |
1785 | - return daemonMessage.Uploads.Select(proto => ToUploadData(proto)).ToList(); |
1786 | - } |
1787 | - |
1788 | - #endregion |
1789 | - |
1790 | - #region ISyncConfiguration related conversions |
1791 | - |
1792 | - /// <summary> |
1793 | - /// Allows to convert a daemon message into a string with the root directory |
1794 | - /// used by the daemon. |
1795 | - /// </summary> |
1796 | - /// <param name="daemonMessage">The message returned by the daemon that contains |
1797 | - /// the root directory used by the daemon.</param> |
1798 | - /// <returns>The root direcotry used by the daemon.</returns> |
1799 | - public static string ToRootDirectory(SyncDaemonMessage daemonMessage) |
1800 | - { |
1801 | - ValidateArgs.Begin() |
1802 | - .IsEqual(daemonMessage.Type, SyncDaemonMessage.MessageType.ROOT) |
1803 | - .IsNotNull(daemonMessage.Root, "daemon.root") |
1804 | - .Check(); |
1805 | - return daemonMessage.Root; |
1806 | - } |
1807 | - |
1808 | - /// <summary> |
1809 | - /// Allows to convert a configuration message into a Throlling data object that can |
1810 | - /// be consummed by the .Net languages. |
1811 | - /// </summary> |
1812 | - /// <param name="configurationMessage">The message whose data is going to be converted.</param> |
1813 | - /// <returns>A data contract that can be consummed by the .Net languages.</returns> |
1814 | - public static ThrottlingData ToThrottlingData(ConfigurationMessage configurationMessage) |
1815 | - { |
1816 | - ValidateArgs.Begin() |
1817 | - .IsEqual(configurationMessage.Type, ConfigurationMessage.MessageType.THROTTLING) |
1818 | - .IsNotNull(configurationMessage.Throttling) |
1819 | - .Check(); |
1820 | - return new ThrottlingData |
1821 | - { |
1822 | - Download = configurationMessage.Throttling.Download, |
1823 | - Upload = configurationMessage.Throttling.Upload |
1824 | - }; |
1825 | - } |
1826 | - |
1827 | - /// <summary> |
1828 | - /// Allows to convert a configuration message into a boolean that indicates if the throttling has been |
1829 | - /// ebabled in the application or not. |
1830 | - /// </summary> |
1831 | - /// <param name="configurationMessage">The message whose data we are going to convert.</param> |
1832 | - /// <returns>A boolean indicating if the throttling has been enabled in the daemon.</returns> |
1833 | - public static bool ToIsEnabledThrottling(ConfigurationMessage configurationMessage) |
1834 | - { |
1835 | - ValidateArgs.Begin() |
1836 | - .IsEqual(configurationMessage.Type, ConfigurationMessage.MessageType.ENABLETHROTTLING) |
1837 | - .Check(); |
1838 | - return configurationMessage.ThrottlingEnabled; |
1839 | - } |
1840 | - |
1841 | - /// <summary> |
1842 | - /// |
1843 | - /// </summary> |
1844 | - /// <param name="configurationMessage"></param> |
1845 | - /// <returns></returns> |
1846 | - public static bool ToIsAutosubscribe(ConfigurationMessage configurationMessage) |
1847 | - { |
1848 | - ValidateArgs.Begin() |
1849 | - .IsEqual(configurationMessage.Type, ConfigurationMessage.MessageType.ENABLEAUTOSUBSCRIBE) |
1850 | - .Check(); |
1851 | - return configurationMessage.AutosubscribeEnabled; |
1852 | - } |
1853 | - |
1854 | - #endregion |
1855 | - |
1856 | - #region ISyncFolder realted conversions |
1857 | - |
1858 | - /// <summary> |
1859 | - /// |
1860 | - /// </summary> |
1861 | - /// <param name="udfProto"></param> |
1862 | - /// <returns></returns> |
1863 | - private static UdfData ToUdfData(FolderMessage.UdfDataMessage udfProto) |
1864 | - { |
1865 | - ValidateArgs.Begin() |
1866 | - .IsNotNull(udfProto) |
1867 | - .IsNotNull(udfProto.Node) |
1868 | - .Check(); |
1869 | - return new UdfData |
1870 | - { |
1871 | - IsSubscribed = udfProto.IsSubscribed, |
1872 | - NodeId = udfProto.Node.NodeId, |
1873 | - Path = udfProto.Node.Path, |
1874 | - SuggestedPath = udfProto.SuggestedPath, |
1875 | - VolumeId = udfProto.Node.VolumeId |
1876 | - }; |
1877 | - } |
1878 | - |
1879 | - /// <summary> |
1880 | - /// |
1881 | - /// </summary> |
1882 | - /// <param name="folderMessage"></param> |
1883 | - /// <returns></returns> |
1884 | - public static IList<UdfData> ToAllFolders(FolderMessage folderMessage) |
1885 | - { |
1886 | - ValidateArgs.Begin() |
1887 | - .IsEqual(folderMessage.Type, FolderMessage.MessageType.FOLDERS) |
1888 | - .IsNotNull(folderMessage.Udfs) |
1889 | - .Check(); |
1890 | - return folderMessage.Udfs.Select(proto => ToUdfData(proto)).ToList(); |
1891 | - } |
1892 | - |
1893 | - /// <summary> |
1894 | - /// |
1895 | - /// </summary> |
1896 | - /// <param name="folderMessage"></param> |
1897 | - /// <returns></returns> |
1898 | - public static UdfData ToUdfData(FolderMessage folderMessage) |
1899 | - { |
1900 | - ValidateArgs.Begin() |
1901 | - .IsEqual(folderMessage.Type, FolderMessage.MessageType.INFO) |
1902 | - .IsNotNull(folderMessage.Udfs) |
1903 | - .IsGreaterOrEqualThan(folderMessage.Udfs.Count, 1, "udfs count") |
1904 | - .Check(); |
1905 | - var info = folderMessage.Udfs[0]; |
1906 | - return ToUdfData(info); |
1907 | - } |
1908 | - |
1909 | - #endregion |
1910 | - |
1911 | - #region ISyncFileManager conversions |
1912 | - |
1913 | - // TODO: expose the file manager interface |
1914 | - |
1915 | - #endregion |
1916 | - |
1917 | - #region ISyncShares conversions |
1918 | - |
1919 | - /// <summary> |
1920 | - /// |
1921 | - /// </summary> |
1922 | - /// <param name="message"> |
1923 | - /// </param> |
1924 | - /// <returns> |
1925 | - /// </returns> |
1926 | - private static ShareData ToShareData(ShareMessage.ShareDataMessage message) |
1927 | - { |
1928 | - |
1929 | - var data = new ShareData |
1930 | - { |
1931 | - FreeBytes = message.FreeBytes, |
1932 | - IsAccepted = message.IsAccepted, |
1933 | - Name = message.Name, |
1934 | - NodeId = message.Node.NodeId, |
1935 | - OtherUserName = message.OtherUsername, |
1936 | - OtherVisisbleName = message.OtherVisibleName, |
1937 | - Path = message.Node.Path, |
1938 | - VolumeId = message.Node.Path |
1939 | - }; |
1940 | - switch(message.Access) |
1941 | - { |
1942 | - case ShareMessage.AccessLevel.MODIFY: |
1943 | - data.AccessLevel = AccessLevel.MODIFY; |
1944 | - break; |
1945 | - default: |
1946 | - data.AccessLevel = AccessLevel.VIEW; |
1947 | - break; |
1948 | - } |
1949 | - return data; |
1950 | - } |
1951 | - |
1952 | - /// <summary> |
1953 | - /// |
1954 | - /// </summary> |
1955 | - /// <param name="message"> |
1956 | - /// </param> |
1957 | - /// <returns> |
1958 | - /// </returns> |
1959 | - public static IList<ShareData> ToGetShares(ShareMessage message) |
1960 | - { |
1961 | - ValidateArgs.Begin() |
1962 | - .IsEqual(ShareMessage.MessageType.OTHERSHARES, message.Type) |
1963 | - .IsNotNull(message.Shares) |
1964 | - .Check(); |
1965 | - return message.Shares.Select(proto => ToShareData(proto)).ToList(); |
1966 | - } |
1967 | - |
1968 | - /// <summary> |
1969 | - /// |
1970 | - /// </summary> |
1971 | - /// <param name="message"> |
1972 | - /// </param> |
1973 | - /// <returns> |
1974 | - /// </returns> |
1975 | - public static IList<ShareData> ToGetShared(ShareMessage message) |
1976 | - { |
1977 | - ValidateArgs.Begin() |
1978 | - .IsEqual(ShareMessage.MessageType.SHARED, message.Type) |
1979 | - .IsNotNull(message.Shares) |
1980 | - .Check(); |
1981 | - return message.Shares.Select(proto => ToShareData(proto)).ToList(); |
1982 | - } |
1983 | - |
1984 | - #endregion |
1985 | - |
1986 | - #region ISyncDaemonClient conversions |
1987 | - |
1988 | - /// <summary> |
1989 | - /// |
1990 | - /// </summary> |
1991 | - /// <param name="message"> |
1992 | - /// |
1993 | - /// </param> |
1994 | - /// <returns> |
1995 | - /// |
1996 | - /// </returns> |
1997 | - public static DownloadData ToDownloadData(SyncDaemonClientMessage message) |
1998 | - { |
1999 | - ValidateArgs.Begin() |
2000 | - .IsTrue(SyncDaemonClientMessage.MessageType.DOWNLOADSTARTED.Equals(message.Type) |
2001 | - || SyncDaemonClientMessage.MessageType.DOWNLOADFINISHED.Equals(message.Type), |
2002 | - "The message type is not correct.") |
2003 | - //.IsNotNull(message.Download) |
2004 | - .Check(); |
2005 | - return new DownloadData |
2006 | - { |
2007 | - NodeId = message.Download.Node.NodeId, |
2008 | - Path = message.Download.Node.Path, |
2009 | - NumberOfBytesRead = message.Download.NumberOfBytesRead, |
2010 | - VolumeId = message.Download.Node.VolumeId |
2011 | - }; |
2012 | - } |
2013 | - |
2014 | - /// <summary> |
2015 | - /// |
2016 | - /// </summary> |
2017 | - /// <param name="message"> |
2018 | - /// |
2019 | - /// </param> |
2020 | - /// <returns> |
2021 | - /// |
2022 | - /// </returns> |
2023 | - public static UploadData ToUploadData(SyncDaemonClientMessage message) |
2024 | - { |
2025 | - ValidateArgs.Begin() |
2026 | - .IsTrue(SyncDaemonClientMessage.MessageType.UPLOADSTARTED == message.Type |
2027 | - || SyncDaemonClientMessage.MessageType.UPLOADFINISHED == message.Type, |
2028 | - "The message type is not correct.") |
2029 | - .IsNotNull(message.Upload) |
2030 | - .Check(); |
2031 | - |
2032 | - return new UploadData |
2033 | - { |
2034 | - NodeId = message.Upload.Node.NodeId, |
2035 | - NumberOfBytesWritten = message.Upload.NumberOfBytesWritten, |
2036 | - Path = message.Upload.Node.Path, |
2037 | - VolumeId = message.Upload.Node.VolumeId |
2038 | - }; |
2039 | - } |
2040 | - |
2041 | - /// <summary> |
2042 | - /// |
2043 | - /// </summary> |
2044 | - /// <param name="message"> |
2045 | - /// |
2046 | - /// </param> |
2047 | - /// <returns> |
2048 | - /// |
2049 | - /// </returns> |
2050 | - public static ShareData ToShareData(SyncDaemonClientMessage message) |
2051 | - { |
2052 | - ValidateArgs.Begin() |
2053 | - .IsTrue(SyncDaemonClientMessage.MessageType.SHARECHANGED == message.Type |
2054 | - || SyncDaemonClientMessage.MessageType.NEWSHARE == message.Type, "The message type is not cor") |
2055 | - .Check(); |
2056 | - var data = new ShareData |
2057 | - { |
2058 | - FreeBytes = message.Share.FreeBytes, |
2059 | - IsAccepted = message.Share.IsAccepted, |
2060 | - Name = message.Share.Name, |
2061 | - NodeId = message.Share.Node.NodeId, |
2062 | - OtherUserName = message.Share.OtherUsername, |
2063 | - OtherVisisbleName = message.Share.OtherVisibleName, |
2064 | - Path = message.Share.Node.Path, |
2065 | - VolumeId = message.Share.Node.VolumeId |
2066 | - }; |
2067 | - switch(message.Share.AccessLevel) |
2068 | - { |
2069 | - case SyncDaemonClientMessage.AccessLevel.MODIFY: |
2070 | - data.AccessLevel = AccessLevel.MODIFY; |
2071 | - break; |
2072 | - default: |
2073 | - data.AccessLevel = AccessLevel.VIEW; |
2074 | - break; |
2075 | - } |
2076 | - return data; |
2077 | - } |
2078 | - |
2079 | - #endregion |
2080 | - |
2081 | - } |
2082 | -} |
2083 | |
2084 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Folder.cs' |
2085 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Folder.cs 2010-07-13 09:12:00 +0000 |
2086 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Folder.cs 1970-01-01 00:00:00 +0000 |
2087 | @@ -1,140 +0,0 @@ |
2088 | -//------------------------------------------------------------------------------ |
2089 | -// <auto-generated> |
2090 | -// This code was generated by a tool. |
2091 | -// |
2092 | -// Changes to this file may cause incorrect behavior and will be lost if |
2093 | -// the code is regenerated. |
2094 | -// </auto-generated> |
2095 | -//------------------------------------------------------------------------------ |
2096 | - |
2097 | -// Generated from: folder.proto |
2098 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
2099 | -{ |
2100 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"FolderMessage")] |
2101 | - public partial class FolderMessage : global::ProtoBuf.IExtensible |
2102 | - { |
2103 | - public FolderMessage() {} |
2104 | - |
2105 | - private FolderMessage.MessageType _type; |
2106 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
2107 | - public FolderMessage.MessageType Type |
2108 | - { |
2109 | - get { return _type; } |
2110 | - set { _type = value; } |
2111 | - } |
2112 | - |
2113 | - private string _path = ""; |
2114 | - [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"path", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2115 | - [global::System.ComponentModel.DefaultValue("")] |
2116 | - public string Path |
2117 | - { |
2118 | - get { return _path; } |
2119 | - set { _path = value; } |
2120 | - } |
2121 | - private readonly global::System.Collections.Generic.List<FolderMessage.UdfDataMessage> _udfs = new global::System.Collections.Generic.List<FolderMessage.UdfDataMessage>(); |
2122 | - [global::ProtoBuf.ProtoMember(3, Name=@"udfs", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2123 | - public global::System.Collections.Generic.List<FolderMessage.UdfDataMessage> Udfs |
2124 | - { |
2125 | - get { return _udfs; } |
2126 | - } |
2127 | - |
2128 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"NodeMessage")] |
2129 | - public partial class NodeMessage : global::ProtoBuf.IExtensible |
2130 | - { |
2131 | - public NodeMessage() {} |
2132 | - |
2133 | - private string _path; |
2134 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"path", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2135 | - public string Path |
2136 | - { |
2137 | - get { return _path; } |
2138 | - set { _path = value; } |
2139 | - } |
2140 | - private string _nodeId; |
2141 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"node_id", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2142 | - public string NodeId |
2143 | - { |
2144 | - get { return _nodeId; } |
2145 | - set { _nodeId = value; } |
2146 | - } |
2147 | - private string _volumeId; |
2148 | - [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"volume_id", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2149 | - public string VolumeId |
2150 | - { |
2151 | - get { return _volumeId; } |
2152 | - set { _volumeId = value; } |
2153 | - } |
2154 | - private global::ProtoBuf.IExtension extensionObject; |
2155 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
2156 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
2157 | - } |
2158 | - |
2159 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UdfDataMessage")] |
2160 | - public partial class UdfDataMessage : global::ProtoBuf.IExtensible |
2161 | - { |
2162 | - public UdfDataMessage() {} |
2163 | - |
2164 | - private FolderMessage.NodeMessage _node; |
2165 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"node", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2166 | - public FolderMessage.NodeMessage Node |
2167 | - { |
2168 | - get { return _node; } |
2169 | - set { _node = value; } |
2170 | - } |
2171 | - private string _suggestedPath; |
2172 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"suggested_path", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2173 | - public string SuggestedPath |
2174 | - { |
2175 | - get { return _suggestedPath; } |
2176 | - set { _suggestedPath = value; } |
2177 | - } |
2178 | - private bool _isSubscribed; |
2179 | - [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"is_subscribed", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2180 | - public bool IsSubscribed |
2181 | - { |
2182 | - get { return _isSubscribed; } |
2183 | - set { _isSubscribed = value; } |
2184 | - } |
2185 | - private global::ProtoBuf.IExtension extensionObject; |
2186 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
2187 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
2188 | - } |
2189 | - |
2190 | - [global::ProtoBuf.ProtoContract(Name=@"MessageType")] |
2191 | - public enum MessageType |
2192 | - { |
2193 | - |
2194 | - [global::ProtoBuf.ProtoEnum(Name=@"CREATE_FOLDER", Value=1)] |
2195 | - CREATEFOLDER = 1, |
2196 | - |
2197 | - [global::ProtoBuf.ProtoEnum(Name=@"DELETE_FOLDER", Value=2)] |
2198 | - DELETEFOLDER = 2, |
2199 | - |
2200 | - [global::ProtoBuf.ProtoEnum(Name=@"QUERY_FOLDERS", Value=3)] |
2201 | - QUERYFOLDERS = 3, |
2202 | - |
2203 | - [global::ProtoBuf.ProtoEnum(Name=@"FOLDERS", Value=4)] |
2204 | - FOLDERS = 4, |
2205 | - |
2206 | - [global::ProtoBuf.ProtoEnum(Name=@"SUBSCRIBE", Value=5)] |
2207 | - SUBSCRIBE = 5, |
2208 | - |
2209 | - [global::ProtoBuf.ProtoEnum(Name=@"UNSUBSCRIBE", Value=6)] |
2210 | - UNSUBSCRIBE = 6, |
2211 | - |
2212 | - [global::ProtoBuf.ProtoEnum(Name=@"QUERY_INFO", Value=7)] |
2213 | - QUERYINFO = 7, |
2214 | - |
2215 | - [global::ProtoBuf.ProtoEnum(Name=@"INFO", Value=8)] |
2216 | - INFO = 8, |
2217 | - |
2218 | - [global::ProtoBuf.ProtoEnum(Name=@"REFRESH", Value=9)] |
2219 | - REFRESH = 9 |
2220 | - } |
2221 | - |
2222 | - private global::ProtoBuf.IExtension extensionObject; |
2223 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
2224 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
2225 | - } |
2226 | - |
2227 | -} |
2228 | \ No newline at end of file |
2229 | |
2230 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/FolderMessageExtensions.cs' |
2231 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/FolderMessageExtensions.cs 2010-08-09 16:40:28 +0000 |
2232 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/FolderMessageExtensions.cs 1970-01-01 00:00:00 +0000 |
2233 | @@ -1,36 +0,0 @@ |
2234 | -/* |
2235 | - * Copyright 2010 Canonical Ltd. |
2236 | - * |
2237 | - * This file is part of UbuntuOne on Windows. |
2238 | - * |
2239 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
2240 | - * it under the terms of the GNU Lesser General Public License version |
2241 | - * as published by the Free Software Foundation. |
2242 | - * |
2243 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
2244 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2245 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2246 | - * GNU Lesser General Public License for more details. |
2247 | - * |
2248 | - * You should have received a copy of the GNU Lesser General Public License |
2249 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
2250 | - * |
2251 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
2252 | - */ |
2253 | -using System.Collections.Generic; |
2254 | - |
2255 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
2256 | -{ |
2257 | - public partial class FolderMessage |
2258 | - { |
2259 | - /// <summary> |
2260 | - /// Allows to create a new folder message with a collection of udfs. This constrcutor has been added |
2261 | - /// because the generated code does not provide a setter for the collections in the proto message. |
2262 | - /// </summary> |
2263 | - /// <param name="udfDataMessages">A collection of udfs messages</param> |
2264 | - internal FolderMessage(List<UdfDataMessage> udfDataMessages) |
2265 | - { |
2266 | - _udfs = udfDataMessages; |
2267 | - } |
2268 | - } |
2269 | -} |
2270 | |
2271 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/IProtobufSerializer.cs' |
2272 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/IProtobufSerializer.cs 2010-08-10 08:49:37 +0000 |
2273 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/IProtobufSerializer.cs 1970-01-01 00:00:00 +0000 |
2274 | @@ -1,46 +0,0 @@ |
2275 | -/* |
2276 | - * Copyright 2010 Canonical Ltd. |
2277 | - * |
2278 | - * This file is part of UbuntuOne on Windows. |
2279 | - * |
2280 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
2281 | - * it under the terms of the GNU Lesser General Public License version |
2282 | - * as published by the Free Software Foundation. |
2283 | - * |
2284 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
2285 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2286 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2287 | - * GNU Lesser General Public License for more details. |
2288 | - * |
2289 | - * You should have received a copy of the GNU Lesser General Public License |
2290 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
2291 | - * |
2292 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
2293 | - */ |
2294 | -using System.IO; |
2295 | - |
2296 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
2297 | -{ |
2298 | - /// <summary> |
2299 | - /// Interface to be implemented by a serializer that can serialize and deserialize the protobuf |
2300 | - /// messages that are used in the application for IPC. |
2301 | - /// </summary> |
2302 | - interface IProtobufSerializer |
2303 | - { |
2304 | - /// <summary> |
2305 | - /// Method that serializes a given message to the provided destination stream. |
2306 | - /// </summary> |
2307 | - /// <typeparam name="TMessage">A message type to serialize.</typeparam> |
2308 | - /// <param name="destinationStream">The destination stream that will contain the serialized version of the message.</param> |
2309 | - /// <param name="message">The message that will be serialize to its binary format.</param> |
2310 | - void Serialize<TMessage>(Stream destinationStream, TMessage message); |
2311 | - |
2312 | - /// <summary> |
2313 | - /// Method that deserializes an object from the given source stream. |
2314 | - /// </summary> |
2315 | - /// <typeparam name="TMessage">The type of the message that should be deserialized.</typeparam> |
2316 | - /// <param name="sourceStream">The source stream that contains the binary representation of the message.</param> |
2317 | - TMessage Deserialize<TMessage>(Stream sourceStream); |
2318 | - |
2319 | - } |
2320 | -} |
2321 | |
2322 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncConfigurationMessageFactory.cs' |
2323 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncConfigurationMessageFactory.cs 2010-08-05 08:15:00 +0000 |
2324 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncConfigurationMessageFactory.cs 1970-01-01 00:00:00 +0000 |
2325 | @@ -1,56 +0,0 @@ |
2326 | -// Copyright 2010 Canonical Ltd. |
2327 | -// |
2328 | -// This file is part of UbuntuOne on Windows. |
2329 | -// |
2330 | -// UbuntuOne on Windows is free software: you can redistribute it and/or modify |
2331 | -// it under the terms of the GNU Lesser General Public License version |
2332 | -// as published by the Free Software Foundation. |
2333 | -// |
2334 | -// Ubuntu One on Windows is distributed in the hope that it will be useful, |
2335 | -// but WITHOUT ANY WARRANTY; without even the implied warranty of |
2336 | -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2337 | -// GNU Lesser General Public License for more details. |
2338 | -// |
2339 | -// You should have received a copy of the GNU Lesser General Public License |
2340 | -// along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
2341 | -// |
2342 | -// Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
2343 | -using Canonical.UbuntuOne.Common; |
2344 | - |
2345 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
2346 | -{ |
2347 | - /// <summary> |
2348 | - /// Interface to be implemented by those factories that can creates a message to query data |
2349 | - /// about the configuration of the daemon. |
2350 | - /// </summary> |
2351 | - internal interface ISyncConfigurationMessageFactory |
2352 | - { |
2353 | - /// <summary> |
2354 | - /// Creates a new message that can be used to retrieve the trottling set up in the daemon. |
2355 | - /// </summary> |
2356 | - /// <returns>A message that can be used to retireve the throttling configuration of the |
2357 | - /// daemon.</returns> |
2358 | - ConfigurationMessage QueryThrottling(); |
2359 | - |
2360 | - /// <summary> |
2361 | - /// Creates a new message that an be used to set the trottling used in the daemon. |
2362 | - /// </summary> |
2363 | - /// <param name="data">The new throttling to be used in the configuration.</param> |
2364 | - /// <returns>A message that will allow to set the throttling.</returns> |
2365 | - ConfigurationMessage SetThrottlingLimits(ThrottlingData data); |
2366 | - |
2367 | - /// <summary> |
2368 | - /// Creates a new message that can be used to enable throttling in the daemon. |
2369 | - /// </summary> |
2370 | - /// <param name="isEnabled">A flag indicating if throttling is enabled.</param> |
2371 | - /// <returns>A message that can be used to enable or disable throttling.</returns> |
2372 | - ConfigurationMessage EnableThrottling(bool isEnabled); |
2373 | - |
2374 | - /// <summary> |
2375 | - /// Creates a new message thatn can be used to enable that autosubscribe in the daemon. |
2376 | - /// </summary> |
2377 | - /// <param name="isEnabled">A flag indicating if the autosubscribe should be enabled.</param> |
2378 | - /// <returns>A message that can be used to set the autosubscrive option of the daemon.</returns> |
2379 | - ConfigurationMessage EnablesAutosubscribe(bool isEnabled); |
2380 | - } |
2381 | -} |
2382 | \ No newline at end of file |
2383 | |
2384 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncDaemonMessageFactory.cs' |
2385 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncDaemonMessageFactory.cs 2010-08-10 08:52:14 +0000 |
2386 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncDaemonMessageFactory.cs 1970-01-01 00:00:00 +0000 |
2387 | @@ -1,87 +0,0 @@ |
2388 | -/** |
2389 | - * Copyright 2010 Canonical Ltd. |
2390 | - * |
2391 | - * This file is part of UbuntuOne on Windows. |
2392 | - * |
2393 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
2394 | - * it under the terms of the GNU Lesser General Public License version |
2395 | - * as published by the Free Software Foundation. |
2396 | - * |
2397 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
2398 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2399 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2400 | - * GNU Lesser General Public License for more details. |
2401 | - * |
2402 | - * You should have received a copy of the GNU Lesser General Public License |
2403 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
2404 | - * |
2405 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
2406 | - */ |
2407 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
2408 | -{ |
2409 | - /// <summary> |
2410 | - /// Interface to be implemented by those factories that can create messages to query the daemon. |
2411 | - /// </summary> |
2412 | - internal interface ISyncDaemonMessageFactory |
2413 | - { |
2414 | - /// <summary> |
2415 | - /// Creates a message that can be used to query the root of used by the sync daemon. |
2416 | - /// </summary> |
2417 | - /// <returns>A message that can be used to query the root of the daemon.</returns> |
2418 | - SyncDaemonMessage QueryRoot(); |
2419 | - |
2420 | - /// <summary> |
2421 | - /// Creates a message that can be used to query the state of the sync daemon. |
2422 | - /// </summary> |
2423 | - /// <returns>A message that can be used to query the sync daemon about its state.</returns> |
2424 | - SyncDaemonMessage QueryState(); |
2425 | - |
2426 | - /// <summary> |
2427 | - /// Creates a message that can be used to query the downloads that are currently in process |
2428 | - /// in the sycn daemon. |
2429 | - /// </summary> |
2430 | - /// <returns>A message that can be used to query the sync daemon about the current downloads.</returns> |
2431 | - SyncDaemonMessage QueryDownloads(); |
2432 | - |
2433 | - /// <summary> |
2434 | - /// Creates a message that can be used to query the sync daemon about the items that are in the |
2435 | - /// queue to be processed. |
2436 | - /// </summary> |
2437 | - /// <returns>A message to query the queue of the daemon.</returns> |
2438 | - SyncDaemonMessage QueryWaiting(); |
2439 | - |
2440 | - /// <summary> |
2441 | - /// Creates a message that can be used to query the sync daemon about the items that are currently |
2442 | - /// being uploaded. |
2443 | - /// </summary> |
2444 | - /// <returns>A message that queries the current uploads in the daemon.</returns> |
2445 | - SyncDaemonMessage QueryUploads(); |
2446 | - |
2447 | - /// <summary> |
2448 | - /// Creates a new message that can be used to place an specific share id with a node id as the |
2449 | - /// next node to be processed. |
2450 | - /// </summary> |
2451 | - /// <param name="shareId">The id of the share.</param> |
2452 | - /// <param name="nodeId">The node id.</param> |
2453 | - /// <returns>A message that can be used to schedule the nex share to be processed.</returns> |
2454 | - SyncDaemonMessage ScheduleAsNext(string shareId, string nodeId); |
2455 | - |
2456 | - /// <summary> |
2457 | - /// Creates a message that will tell the daemon to connect to the UbuntuOne server. |
2458 | - /// </summary> |
2459 | - /// <returns>A message that will tell the python code to connect to the Ubuntu One server.</returns> |
2460 | - SyncDaemonMessage Connect(); |
2461 | - |
2462 | - /// <summary> |
2463 | - /// Creates a message that will tell the daemon to disconnect from the UbuntuOne server. |
2464 | - /// </summary> |
2465 | - /// <returns>A message that will tell the python code to disconnect from the UbuntuOne server. </returns> |
2466 | - SyncDaemonMessage Disconnect(); |
2467 | - |
2468 | - /// <summary> |
2469 | - /// Creates a new message that will tell the daemon to quit. |
2470 | - /// </summary> |
2471 | - /// <returns>A message that will tell the python code to quit the sync daemon.</returns> |
2472 | - SyncDaemonMessage Quit(); |
2473 | - } |
2474 | -} |
2475 | \ No newline at end of file |
2476 | |
2477 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncFolderMessageFactory.cs' |
2478 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncFolderMessageFactory.cs 2010-08-11 08:05:19 +0000 |
2479 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncFolderMessageFactory.cs 1970-01-01 00:00:00 +0000 |
2480 | @@ -1,71 +0,0 @@ |
2481 | -/* |
2482 | - * Copyright 2010 Canonical Ltd. |
2483 | - * |
2484 | - * This file is part of UbuntuOne on Windows. |
2485 | - * |
2486 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
2487 | - * it under the terms of the GNU Lesser General Public License version |
2488 | - * as published by the Free Software Foundation. |
2489 | - * |
2490 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
2491 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2492 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2493 | - * GNU Lesser General Public License for more details. |
2494 | - * |
2495 | - * You should have received a copy of the GNU Lesser General Public License |
2496 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
2497 | - * |
2498 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
2499 | - */ |
2500 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
2501 | -{ |
2502 | - internal interface ISyncFolderMessageFactory |
2503 | - { |
2504 | - /// <summary> |
2505 | - /// Creates a new message that can be used to query the infor of a folder. |
2506 | - /// </summary> |
2507 | - /// <param name="folderId">The id of the folder whose info we are quering.</param> |
2508 | - /// <returns>A message that can be sent to the daemon to query the information of a folder.</returns> |
2509 | - FolderMessage QueryInfo(string folderId); |
2510 | - |
2511 | - /// <summary> |
2512 | - /// Creates a message that can be used to create a new folder in the given path. |
2513 | - /// </summary> |
2514 | - /// <param name="path">The path where the folder is going to be created.</param> |
2515 | - /// <returns>A message that can be sent to the daemon to create a folder.</returns> |
2516 | - FolderMessage CreateFolder(string path); |
2517 | - |
2518 | - /// <summary> |
2519 | - /// Creates a message that can be used to delete a folder in the givn path. |
2520 | - /// </summary> |
2521 | - /// <param name="path">The path to whcih the folder is going to be created.</param> |
2522 | - /// <returns>A message that can be sent to the daemon to delete a folder.</returns> |
2523 | - FolderMessage DeleteFolder(string path); |
2524 | - |
2525 | - /// <summary> |
2526 | - /// Creates a message that can be used to query all the folder that the daemon knows about. |
2527 | - /// </summary> |
2528 | - /// <returns>A message that can be used to query all the folder in the daemon.</returns> |
2529 | - FolderMessage QueryFolders(); |
2530 | - |
2531 | - /// <summary> |
2532 | - /// Creates a message that can be used to subscribe to a folder. |
2533 | - /// </summary> |
2534 | - /// <param name="folderId">The id that identifies the folder to whcih we want the daemon to subscribe.</param> |
2535 | - /// <returns>A message that tells the daemon to subcribe to a folder.</returns> |
2536 | - FolderMessage Subscribe(string folderId); |
2537 | - |
2538 | - /// <summary> |
2539 | - /// Creates a message that can be used to unsbscribe the daemon from a folder. |
2540 | - /// </summary> |
2541 | - /// <param name="folderId">The id that identifies the folder to unsubscribe.</param> |
2542 | - /// <returns>A message that tells the daemon to unsubscribe from a folder.</returns> |
2543 | - FolderMessage Unsubscribe(string folderId); |
2544 | - |
2545 | - /// <summary> |
2546 | - /// Creates a message that tells the daemon to refresh the folders. |
2547 | - /// </summary> |
2548 | - /// <returns>A message that tells the daemon to refresh the folders.</returns> |
2549 | - FolderMessage RefreshVolumes(); |
2550 | - } |
2551 | -} |
2552 | \ No newline at end of file |
2553 | |
2554 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncShareMessageFactory.cs' |
2555 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncShareMessageFactory.cs 2010-08-09 16:40:28 +0000 |
2556 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ISyncShareMessageFactory.cs 1970-01-01 00:00:00 +0000 |
2557 | @@ -1,68 +0,0 @@ |
2558 | -/* |
2559 | - * Copyright 2010 Canonical Ltd. |
2560 | - * |
2561 | - * This file is part of UbuntuOne on Windows. |
2562 | - * |
2563 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
2564 | - * it under the terms of the GNU Lesser General Public License version |
2565 | - * as published by the Free Software Foundation. |
2566 | - * |
2567 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
2568 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2569 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2570 | - * GNU Lesser General Public License for more details. |
2571 | - * |
2572 | - * You should have received a copy of the GNU Lesser General Public License |
2573 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
2574 | - * |
2575 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
2576 | - */ |
2577 | -using Canonical.UbuntuOne.Common; |
2578 | - |
2579 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
2580 | -{ |
2581 | - internal interface ISyncShareMessageFactory |
2582 | - { |
2583 | - /// <summary> |
2584 | - /// Creates a new message that can be used wot wuery the shares in the sync daemon. |
2585 | - /// </summary> |
2586 | - /// <returns>A message that can be used to query the shares in the daemon.</returns> |
2587 | - ShareMessage QueryShares(); |
2588 | - |
2589 | - /// <summary> |
2590 | - /// Creates a new message that will tell the sync daemon that a share has been accepted. |
2591 | - /// </summary> |
2592 | - /// <param name="shareId">The id of the share that has been accepted.</param> |
2593 | - /// <returns>A message that can be used to tell that a share has been accepted.</returns> |
2594 | - ShareMessage AcceptShare(string shareId); |
2595 | - |
2596 | - /// <summary> |
2597 | - /// Creates a message that will tell the sync daemong to reject a share with the given share id. |
2598 | - /// </summary> |
2599 | - /// <param name="shareId">The id of the share to reject.</param> |
2600 | - /// <returns>A message that lets the daemong know that we are rejecting a message.</returns> |
2601 | - ShareMessage RejectShare(string shareId); |
2602 | - |
2603 | - /// <summary> |
2604 | - /// Creates a new message that can be used to create a new share through the daemon. |
2605 | - /// </summary> |
2606 | - /// <param name="path">The path of the new share to create.</param> |
2607 | - /// <param name="username">The username that will be able to access the share.</param> |
2608 | - /// <param name="name">The name of the share.</param> |
2609 | - /// <param name="accessLevel">The access level to be used in the share.</param> |
2610 | - /// <returns>TA message that can be used to create a new share.</returns> |
2611 | - ShareMessage CreateShare(string path, string username, string name, AccessLevel accessLevel); |
2612 | - |
2613 | - /// <summary> |
2614 | - /// Creates a new message that will tell the sync daemon that has to update the shares. |
2615 | - /// </summary> |
2616 | - /// <returns>A message that can be used to tell the daemon to update the shares.</returns> |
2617 | - ShareMessage UpdateShares(); |
2618 | - |
2619 | - /// <summary> |
2620 | - /// Creates a new message that query for the shares that the user has done. |
2621 | - /// </summary> |
2622 | - /// <returns>A message to query the daemon for the shares of the user.</returns> |
2623 | - ShareMessage GetShared(); |
2624 | - } |
2625 | -} |
2626 | \ No newline at end of file |
2627 | |
2628 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ProtobufSerializer.cs' |
2629 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ProtobufSerializer.cs 2010-08-10 08:49:37 +0000 |
2630 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ProtobufSerializer.cs 1970-01-01 00:00:00 +0000 |
2631 | @@ -1,56 +0,0 @@ |
2632 | -/* |
2633 | - * Copyright 2010 Canonical Ltd. |
2634 | - * |
2635 | - * This file is part of UbuntuOne on Windows. |
2636 | - * |
2637 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
2638 | - * it under the terms of the GNU Lesser General Public License version |
2639 | - * as published by the Free Software Foundation. |
2640 | - * |
2641 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
2642 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2643 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2644 | - * GNU Lesser General Public License for more details. |
2645 | - * |
2646 | - * You should have received a copy of the GNU Lesser General Public License |
2647 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
2648 | - * |
2649 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
2650 | - */ |
2651 | -using System.IO; |
2652 | -using ProtoBuf; |
2653 | - |
2654 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
2655 | -{ |
2656 | - /// <summary> |
2657 | - /// Convenience class that wraps the static Serializer class that is used to serialize and |
2658 | - /// deserialize protobuf messages. |
2659 | - /// </summary> |
2660 | - internal class ProtobufSerializer : IProtobufSerializer |
2661 | - { |
2662 | - #region Implementation of IProtobufSerializer |
2663 | - |
2664 | - /// <summary> |
2665 | - /// Method that serializes a given message to the provided destination stream. |
2666 | - /// </summary> |
2667 | - /// <typeparam name="TMessage">A message type to serialize.</typeparam> |
2668 | - /// <param name="destinationStream">The destination stream that will contain the serialized version of the message.</param> |
2669 | - /// <param name="message">The message that will be serialize to its binary format.</param> |
2670 | - public void Serialize<TMessage>(Stream destinationStream, TMessage message) |
2671 | - { |
2672 | - Serializer.Serialize(destinationStream, message); |
2673 | - } |
2674 | - |
2675 | - /// <summary> |
2676 | - /// Method that deserializes an object from the given source stream. |
2677 | - /// </summary> |
2678 | - /// <typeparam name="TMessage">The type of the message that should be deserialized.</typeparam> |
2679 | - /// <param name="sourceStream">The source stream that contains the binary representation of the message.</param> |
2680 | - public TMessage Deserialize<TMessage>(Stream sourceStream) |
2681 | - { |
2682 | - return Serializer.Deserialize<TMessage>(sourceStream); |
2683 | - } |
2684 | - |
2685 | - #endregion |
2686 | - } |
2687 | -} |
2688 | |
2689 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ShareMessageExtensions.cs' |
2690 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ShareMessageExtensions.cs 2010-07-13 09:52:05 +0000 |
2691 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/ShareMessageExtensions.cs 1970-01-01 00:00:00 +0000 |
2692 | @@ -1,38 +0,0 @@ |
2693 | -/** |
2694 | - * Copyright 2010 Canonical Ltd. |
2695 | - * |
2696 | - * This file is part of UbuntuOne on Windows. |
2697 | - * |
2698 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
2699 | - * it under the terms of the GNU Lesser General Public License version |
2700 | - * as published by the Free Software Foundation. |
2701 | - * |
2702 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
2703 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2704 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2705 | - * GNU Lesser General Public License for more details. |
2706 | - * |
2707 | - * You should have received a copy of the GNU Lesser General Public License |
2708 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
2709 | - * |
2710 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
2711 | - */ |
2712 | -using System.Collections.Generic; |
2713 | - |
2714 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
2715 | -{ |
2716 | - public partial class ShareMessage |
2717 | - { |
2718 | - /// <summary> |
2719 | - /// Allows to create a new share message with the given collection of shares. |
2720 | - /// This constructor has been added because the generated code does not |
2721 | - /// provide setter for collections in the proto messages. |
2722 | - /// </summary> |
2723 | - /// <param name="shares">The collection of shares that will be used to init the |
2724 | - /// message.</param> |
2725 | - internal ShareMessage(List<ShareDataMessage> shares) |
2726 | - { |
2727 | - _shares = shares; |
2728 | - } |
2729 | - } |
2730 | -} |
2731 | |
2732 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Shares.cs' |
2733 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Shares.cs 2010-07-13 09:12:00 +0000 |
2734 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/Shares.cs 1970-01-01 00:00:00 +0000 |
2735 | @@ -1,212 +0,0 @@ |
2736 | -//------------------------------------------------------------------------------ |
2737 | -// <auto-generated> |
2738 | -// This code was generated by a tool. |
2739 | -// |
2740 | -// Changes to this file may cause incorrect behavior and will be lost if |
2741 | -// the code is regenerated. |
2742 | -// </auto-generated> |
2743 | -//------------------------------------------------------------------------------ |
2744 | - |
2745 | -// Generated from: shares.proto |
2746 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
2747 | -{ |
2748 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ShareMessage")] |
2749 | - public partial class ShareMessage : global::ProtoBuf.IExtensible |
2750 | - { |
2751 | - public ShareMessage() {} |
2752 | - |
2753 | - private ShareMessage.MessageType _type; |
2754 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
2755 | - public ShareMessage.MessageType Type |
2756 | - { |
2757 | - get { return _type; } |
2758 | - set { _type = value; } |
2759 | - } |
2760 | - private readonly global::System.Collections.Generic.List<ShareMessage.ShareDataMessage> _shares = new global::System.Collections.Generic.List<ShareMessage.ShareDataMessage>(); |
2761 | - [global::ProtoBuf.ProtoMember(2, Name=@"shares", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2762 | - public global::System.Collections.Generic.List<ShareMessage.ShareDataMessage> Shares |
2763 | - { |
2764 | - get { return _shares; } |
2765 | - } |
2766 | - |
2767 | - |
2768 | - private string _shareId = ""; |
2769 | - [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"share_id", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2770 | - [global::System.ComponentModel.DefaultValue("")] |
2771 | - public string ShareId |
2772 | - { |
2773 | - get { return _shareId; } |
2774 | - set { _shareId = value; } |
2775 | - } |
2776 | - |
2777 | - private string _path = ""; |
2778 | - [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"path", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2779 | - [global::System.ComponentModel.DefaultValue("")] |
2780 | - public string Path |
2781 | - { |
2782 | - get { return _path; } |
2783 | - set { _path = value; } |
2784 | - } |
2785 | - |
2786 | - private string _username = ""; |
2787 | - [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"username", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2788 | - [global::System.ComponentModel.DefaultValue("")] |
2789 | - public string Username |
2790 | - { |
2791 | - get { return _username; } |
2792 | - set { _username = value; } |
2793 | - } |
2794 | - |
2795 | - private string _name = ""; |
2796 | - [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2797 | - [global::System.ComponentModel.DefaultValue("")] |
2798 | - public string Name |
2799 | - { |
2800 | - get { return _name; } |
2801 | - set { _name = value; } |
2802 | - } |
2803 | - |
2804 | - private ShareMessage.AccessLevel _access = ShareMessage.AccessLevel.VIEW; |
2805 | - [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"access", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
2806 | - [global::System.ComponentModel.DefaultValue(ShareMessage.AccessLevel.VIEW)] |
2807 | - public ShareMessage.AccessLevel Access |
2808 | - { |
2809 | - get { return _access; } |
2810 | - set { _access = value; } |
2811 | - } |
2812 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"NodeMessage")] |
2813 | - public partial class NodeMessage : global::ProtoBuf.IExtensible |
2814 | - { |
2815 | - public NodeMessage() {} |
2816 | - |
2817 | - private string _path; |
2818 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"path", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2819 | - public string Path |
2820 | - { |
2821 | - get { return _path; } |
2822 | - set { _path = value; } |
2823 | - } |
2824 | - private string _nodeId; |
2825 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"node_id", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2826 | - public string NodeId |
2827 | - { |
2828 | - get { return _nodeId; } |
2829 | - set { _nodeId = value; } |
2830 | - } |
2831 | - private string _volumeId; |
2832 | - [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"volume_id", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2833 | - public string VolumeId |
2834 | - { |
2835 | - get { return _volumeId; } |
2836 | - set { _volumeId = value; } |
2837 | - } |
2838 | - private global::ProtoBuf.IExtension extensionObject; |
2839 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
2840 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
2841 | - } |
2842 | - |
2843 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ShareDataMessage")] |
2844 | - public partial class ShareDataMessage : global::ProtoBuf.IExtensible |
2845 | - { |
2846 | - public ShareDataMessage() {} |
2847 | - |
2848 | - private ShareMessage.NodeMessage _node; |
2849 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"node", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2850 | - public ShareMessage.NodeMessage Node |
2851 | - { |
2852 | - get { return _node; } |
2853 | - set { _node = value; } |
2854 | - } |
2855 | - private string _name; |
2856 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2857 | - public string Name |
2858 | - { |
2859 | - get { return _name; } |
2860 | - set { _name = value; } |
2861 | - } |
2862 | - private string _otherUsername; |
2863 | - [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"other_username", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2864 | - public string OtherUsername |
2865 | - { |
2866 | - get { return _otherUsername; } |
2867 | - set { _otherUsername = value; } |
2868 | - } |
2869 | - private string _otherVisibleName; |
2870 | - [global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"other_visible_name", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2871 | - public string OtherVisibleName |
2872 | - { |
2873 | - get { return _otherVisibleName; } |
2874 | - set { _otherVisibleName = value; } |
2875 | - } |
2876 | - private bool _isAccepted; |
2877 | - [global::ProtoBuf.ProtoMember(5, IsRequired = true, Name=@"is_accepted", DataFormat = global::ProtoBuf.DataFormat.Default)] |
2878 | - public bool IsAccepted |
2879 | - { |
2880 | - get { return _isAccepted; } |
2881 | - set { _isAccepted = value; } |
2882 | - } |
2883 | - private ShareMessage.AccessLevel _access; |
2884 | - [global::ProtoBuf.ProtoMember(6, IsRequired = true, Name=@"access", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
2885 | - public ShareMessage.AccessLevel Access |
2886 | - { |
2887 | - get { return _access; } |
2888 | - set { _access = value; } |
2889 | - } |
2890 | - private int _freeBytes; |
2891 | - [global::ProtoBuf.ProtoMember(7, IsRequired = true, Name=@"free_bytes", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
2892 | - public int FreeBytes |
2893 | - { |
2894 | - get { return _freeBytes; } |
2895 | - set { _freeBytes = value; } |
2896 | - } |
2897 | - private global::ProtoBuf.IExtension extensionObject; |
2898 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
2899 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
2900 | - } |
2901 | - |
2902 | - [global::ProtoBuf.ProtoContract(Name=@"MessageType")] |
2903 | - public enum MessageType |
2904 | - { |
2905 | - |
2906 | - [global::ProtoBuf.ProtoEnum(Name=@"QUERY_OTHER_SHARES", Value=1)] |
2907 | - QUERYOTHERSHARES = 1, |
2908 | - |
2909 | - [global::ProtoBuf.ProtoEnum(Name=@"ACCEPT_SHARE", Value=2)] |
2910 | - ACCEPTSHARE = 2, |
2911 | - |
2912 | - [global::ProtoBuf.ProtoEnum(Name=@"REJECT_SHARE", Value=3)] |
2913 | - REJECTSHARE = 3, |
2914 | - |
2915 | - [global::ProtoBuf.ProtoEnum(Name=@"CREATE_SHARE", Value=4)] |
2916 | - CREATESHARE = 4, |
2917 | - |
2918 | - [global::ProtoBuf.ProtoEnum(Name=@"UPDATE_SHARES", Value=5)] |
2919 | - UPDATESHARES = 5, |
2920 | - |
2921 | - [global::ProtoBuf.ProtoEnum(Name=@"QUERY_SHARED", Value=6)] |
2922 | - QUERYSHARED = 6, |
2923 | - |
2924 | - [global::ProtoBuf.ProtoEnum(Name=@"OTHER_SHARES", Value=7)] |
2925 | - OTHERSHARES = 7, |
2926 | - |
2927 | - [global::ProtoBuf.ProtoEnum(Name=@"SHARED", Value=8)] |
2928 | - SHARED = 8 |
2929 | - } |
2930 | - |
2931 | - [global::ProtoBuf.ProtoContract(Name=@"AccessLevel")] |
2932 | - public enum AccessLevel |
2933 | - { |
2934 | - |
2935 | - [global::ProtoBuf.ProtoEnum(Name=@"VIEW", Value=1)] |
2936 | - VIEW = 1, |
2937 | - |
2938 | - [global::ProtoBuf.ProtoEnum(Name=@"MODIFY", Value=2)] |
2939 | - MODIFY = 2 |
2940 | - } |
2941 | - |
2942 | - private global::ProtoBuf.IExtension extensionObject; |
2943 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
2944 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
2945 | - } |
2946 | - |
2947 | -} |
2948 | \ No newline at end of file |
2949 | |
2950 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncConfigurationMessageFactory.cs' |
2951 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncConfigurationMessageFactory.cs 2010-08-09 16:40:28 +0000 |
2952 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncConfigurationMessageFactory.cs 1970-01-01 00:00:00 +0000 |
2953 | @@ -1,67 +0,0 @@ |
2954 | -/* |
2955 | - * Copyright 2010 Canonical Ltd. |
2956 | - * |
2957 | - * This file is part of UbuntuOne on Windows. |
2958 | - * |
2959 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
2960 | - * it under the terms of the GNU Lesser General Public License version |
2961 | - * as published by the Free Software Foundation. |
2962 | - * |
2963 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
2964 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2965 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2966 | - * GNU Lesser General Public License for more details. |
2967 | - * |
2968 | - * You should have received a copy of the GNU Lesser General Public License |
2969 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
2970 | - * |
2971 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
2972 | - */ |
2973 | -using Canonical.UbuntuOne.Common; |
2974 | -using Canonical.UbuntuOne.Common.Validation; |
2975 | - |
2976 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
2977 | -{ |
2978 | - internal class SyncConfigurationMessageFactory : ISyncConfigurationMessageFactory |
2979 | - { |
2980 | - |
2981 | - public ConfigurationMessage QueryThrottling() |
2982 | - { |
2983 | - return new ConfigurationMessage { Type = ConfigurationMessage.MessageType.QUERYTHROTTLING }; |
2984 | - } |
2985 | - |
2986 | - public ConfigurationMessage SetThrottlingLimits(ThrottlingData data) |
2987 | - { |
2988 | - ValidateArgs.Begin() |
2989 | - .IsNotNull(data) |
2990 | - .Check(); |
2991 | - return new ConfigurationMessage |
2992 | - { |
2993 | - Type = ConfigurationMessage.MessageType.SETTHROTTLING, |
2994 | - Throttling = new ConfigurationMessage.ThrottlingLimitsMessage |
2995 | - { |
2996 | - Download = data.Download, |
2997 | - Upload = data.Upload |
2998 | - } |
2999 | - }; |
3000 | - } |
3001 | - |
3002 | - public ConfigurationMessage EnableThrottling(bool isEnabled) |
3003 | - { |
3004 | - return new ConfigurationMessage |
3005 | - { |
3006 | - Type = ConfigurationMessage.MessageType.ENABLETHROTTLING, |
3007 | - ThrottlingEnabled = isEnabled |
3008 | - }; |
3009 | - } |
3010 | - |
3011 | - public ConfigurationMessage EnablesAutosubscribe(bool isEnabled) |
3012 | - { |
3013 | - return new ConfigurationMessage |
3014 | - { |
3015 | - Type = ConfigurationMessage.MessageType.ENABLEAUTOSUBSCRIBE, |
3016 | - AutosubscribeEnabled = isEnabled |
3017 | - }; |
3018 | - } |
3019 | - } |
3020 | -} |
3021 | |
3022 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemon.cs' |
3023 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemon.cs 2010-07-13 09:12:00 +0000 |
3024 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemon.cs 1970-01-01 00:00:00 +0000 |
3025 | @@ -1,282 +0,0 @@ |
3026 | -//------------------------------------------------------------------------------ |
3027 | -// <auto-generated> |
3028 | -// This code was generated by a tool. |
3029 | -// |
3030 | -// Changes to this file may cause incorrect behavior and will be lost if |
3031 | -// the code is regenerated. |
3032 | -// </auto-generated> |
3033 | -//------------------------------------------------------------------------------ |
3034 | - |
3035 | -// Generated from: sync_daemon.proto |
3036 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
3037 | -{ |
3038 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"SyncDaemonMessage")] |
3039 | - public partial class SyncDaemonMessage : global::ProtoBuf.IExtensible |
3040 | - { |
3041 | - public SyncDaemonMessage() {} |
3042 | - |
3043 | - private SyncDaemonMessage.MessageType _type; |
3044 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
3045 | - public SyncDaemonMessage.MessageType Type |
3046 | - { |
3047 | - get { return _type; } |
3048 | - set { _type = value; } |
3049 | - } |
3050 | - |
3051 | - private SyncDaemonMessage.StateMessage _state = null; |
3052 | - [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"state", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3053 | - [global::System.ComponentModel.DefaultValue(null)] |
3054 | - public SyncDaemonMessage.StateMessage State |
3055 | - { |
3056 | - get { return _state; } |
3057 | - set { _state = value; } |
3058 | - } |
3059 | - private readonly global::System.Collections.Generic.List<SyncDaemonMessage.DownloadMessage> _downloads = new global::System.Collections.Generic.List<SyncDaemonMessage.DownloadMessage>(); |
3060 | - [global::ProtoBuf.ProtoMember(3, Name=@"downloads", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3061 | - public global::System.Collections.Generic.List<SyncDaemonMessage.DownloadMessage> Downloads |
3062 | - { |
3063 | - get { return _downloads; } |
3064 | - } |
3065 | - |
3066 | - private readonly global::System.Collections.Generic.List<SyncDaemonMessage.QueuItemMessage> _waitingItems = new global::System.Collections.Generic.List<SyncDaemonMessage.QueuItemMessage>(); |
3067 | - [global::ProtoBuf.ProtoMember(4, Name=@"waiting_items", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3068 | - public global::System.Collections.Generic.List<SyncDaemonMessage.QueuItemMessage> WaitingItems |
3069 | - { |
3070 | - get { return _waitingItems; } |
3071 | - } |
3072 | - |
3073 | - |
3074 | - private string _nextShareId = ""; |
3075 | - [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"next_share_id", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3076 | - [global::System.ComponentModel.DefaultValue("")] |
3077 | - public string NextShareId |
3078 | - { |
3079 | - get { return _nextShareId; } |
3080 | - set { _nextShareId = value; } |
3081 | - } |
3082 | - |
3083 | - private string _nextNodeId = ""; |
3084 | - [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"next_node_id", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3085 | - [global::System.ComponentModel.DefaultValue("")] |
3086 | - public string NextNodeId |
3087 | - { |
3088 | - get { return _nextNodeId; } |
3089 | - set { _nextNodeId = value; } |
3090 | - } |
3091 | - private readonly global::System.Collections.Generic.List<SyncDaemonMessage.UploadMessage> _uploads = new global::System.Collections.Generic.List<SyncDaemonMessage.UploadMessage>(); |
3092 | - [global::ProtoBuf.ProtoMember(7, Name=@"uploads", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3093 | - public global::System.Collections.Generic.List<SyncDaemonMessage.UploadMessage> Uploads |
3094 | - { |
3095 | - get { return _uploads; } |
3096 | - } |
3097 | - |
3098 | - |
3099 | - private string _root = ""; |
3100 | - [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"root", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3101 | - [global::System.ComponentModel.DefaultValue("")] |
3102 | - public string Root |
3103 | - { |
3104 | - get { return _root; } |
3105 | - set { _root = value; } |
3106 | - } |
3107 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"NodeMessage")] |
3108 | - public partial class NodeMessage : global::ProtoBuf.IExtensible |
3109 | - { |
3110 | - public NodeMessage() {} |
3111 | - |
3112 | - private string _path; |
3113 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"path", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3114 | - public string Path |
3115 | - { |
3116 | - get { return _path; } |
3117 | - set { _path = value; } |
3118 | - } |
3119 | - private string _nodeId; |
3120 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"node_id", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3121 | - public string NodeId |
3122 | - { |
3123 | - get { return _nodeId; } |
3124 | - set { _nodeId = value; } |
3125 | - } |
3126 | - private string _volumeId; |
3127 | - [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"volume_id", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3128 | - public string VolumeId |
3129 | - { |
3130 | - get { return _volumeId; } |
3131 | - set { _volumeId = value; } |
3132 | - } |
3133 | - private global::ProtoBuf.IExtension extensionObject; |
3134 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3135 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3136 | - } |
3137 | - |
3138 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"StateMessage")] |
3139 | - public partial class StateMessage : global::ProtoBuf.IExtensible |
3140 | - { |
3141 | - public StateMessage() {} |
3142 | - |
3143 | - private string _name; |
3144 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3145 | - public string Name |
3146 | - { |
3147 | - get { return _name; } |
3148 | - set { _name = value; } |
3149 | - } |
3150 | - private string _description; |
3151 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"description", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3152 | - public string Description |
3153 | - { |
3154 | - get { return _description; } |
3155 | - set { _description = value; } |
3156 | - } |
3157 | - private bool _isError; |
3158 | - [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"is_error", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3159 | - public bool IsError |
3160 | - { |
3161 | - get { return _isError; } |
3162 | - set { _isError = value; } |
3163 | - } |
3164 | - private bool _isConnected; |
3165 | - [global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"is_connected", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3166 | - public bool IsConnected |
3167 | - { |
3168 | - get { return _isConnected; } |
3169 | - set { _isConnected = value; } |
3170 | - } |
3171 | - private bool _isOnline; |
3172 | - [global::ProtoBuf.ProtoMember(5, IsRequired = true, Name=@"is_online", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3173 | - public bool IsOnline |
3174 | - { |
3175 | - get { return _isOnline; } |
3176 | - set { _isOnline = value; } |
3177 | - } |
3178 | - private global::ProtoBuf.IExtension extensionObject; |
3179 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3180 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3181 | - } |
3182 | - |
3183 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"DownloadMessage")] |
3184 | - public partial class DownloadMessage : global::ProtoBuf.IExtensible |
3185 | - { |
3186 | - public DownloadMessage() {} |
3187 | - |
3188 | - private SyncDaemonMessage.NodeMessage _node; |
3189 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"node", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3190 | - public SyncDaemonMessage.NodeMessage Node |
3191 | - { |
3192 | - get { return _node; } |
3193 | - set { _node = value; } |
3194 | - } |
3195 | - private int _numberOfBytesRead; |
3196 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"number_of_bytes_read", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
3197 | - public int NumberOfBytesRead |
3198 | - { |
3199 | - get { return _numberOfBytesRead; } |
3200 | - set { _numberOfBytesRead = value; } |
3201 | - } |
3202 | - private global::ProtoBuf.IExtension extensionObject; |
3203 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3204 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3205 | - } |
3206 | - |
3207 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"QueuItemMessage")] |
3208 | - public partial class QueuItemMessage : global::ProtoBuf.IExtensible |
3209 | - { |
3210 | - public QueuItemMessage() {} |
3211 | - |
3212 | - private SyncDaemonMessage.NodeMessage _node; |
3213 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"node", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3214 | - public SyncDaemonMessage.NodeMessage Node |
3215 | - { |
3216 | - get { return _node; } |
3217 | - set { _node = value; } |
3218 | - } |
3219 | - private string _operation; |
3220 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"operation", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3221 | - public string Operation |
3222 | - { |
3223 | - get { return _operation; } |
3224 | - set { _operation = value; } |
3225 | - } |
3226 | - private global::ProtoBuf.IExtension extensionObject; |
3227 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3228 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3229 | - } |
3230 | - |
3231 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UploadMessage")] |
3232 | - public partial class UploadMessage : global::ProtoBuf.IExtensible |
3233 | - { |
3234 | - public UploadMessage() {} |
3235 | - |
3236 | - private SyncDaemonMessage.NodeMessage _node; |
3237 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"node", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3238 | - public SyncDaemonMessage.NodeMessage Node |
3239 | - { |
3240 | - get { return _node; } |
3241 | - set { _node = value; } |
3242 | - } |
3243 | - private int _numberOfBytesWritten; |
3244 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"number_of_bytes_written", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
3245 | - public int NumberOfBytesWritten |
3246 | - { |
3247 | - get { return _numberOfBytesWritten; } |
3248 | - set { _numberOfBytesWritten = value; } |
3249 | - } |
3250 | - private global::ProtoBuf.IExtension extensionObject; |
3251 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3252 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3253 | - } |
3254 | - |
3255 | - [global::ProtoBuf.ProtoContract(Name=@"MessageType")] |
3256 | - public enum MessageType |
3257 | - { |
3258 | - |
3259 | - [global::ProtoBuf.ProtoEnum(Name=@"QUERY_STATUS", Value=1)] |
3260 | - QUERYSTATUS = 1, |
3261 | - |
3262 | - [global::ProtoBuf.ProtoEnum(Name=@"STATUS", Value=2)] |
3263 | - STATUS = 2, |
3264 | - |
3265 | - [global::ProtoBuf.ProtoEnum(Name=@"QUERY_DOWNLOADS", Value=3)] |
3266 | - QUERYDOWNLOADS = 3, |
3267 | - |
3268 | - [global::ProtoBuf.ProtoEnum(Name=@"DOWNLOADS", Value=4)] |
3269 | - DOWNLOADS = 4, |
3270 | - |
3271 | - [global::ProtoBuf.ProtoEnum(Name=@"QUERY_WAITING", Value=5)] |
3272 | - QUERYWAITING = 5, |
3273 | - |
3274 | - [global::ProtoBuf.ProtoEnum(Name=@"WAITING", Value=6)] |
3275 | - WAITING = 6, |
3276 | - |
3277 | - [global::ProtoBuf.ProtoEnum(Name=@"SCHEDULE_NEXT", Value=7)] |
3278 | - SCHEDULENEXT = 7, |
3279 | - |
3280 | - [global::ProtoBuf.ProtoEnum(Name=@"QUERY_UPLOADS", Value=8)] |
3281 | - QUERYUPLOADS = 8, |
3282 | - |
3283 | - [global::ProtoBuf.ProtoEnum(Name=@"UPLOADS", Value=9)] |
3284 | - UPLOADS = 9, |
3285 | - |
3286 | - [global::ProtoBuf.ProtoEnum(Name=@"CONNECT", Value=10)] |
3287 | - CONNECT = 10, |
3288 | - |
3289 | - [global::ProtoBuf.ProtoEnum(Name=@"DISCONNECT", Value=11)] |
3290 | - DISCONNECT = 11, |
3291 | - |
3292 | - [global::ProtoBuf.ProtoEnum(Name=@"QUERY_ROOT", Value=12)] |
3293 | - QUERYROOT = 12, |
3294 | - |
3295 | - [global::ProtoBuf.ProtoEnum(Name=@"ROOT", Value=13)] |
3296 | - ROOT = 13, |
3297 | - |
3298 | - [global::ProtoBuf.ProtoEnum(Name=@"QUIT", Value=14)] |
3299 | - QUIT = 14 |
3300 | - } |
3301 | - |
3302 | - private global::ProtoBuf.IExtension extensionObject; |
3303 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3304 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3305 | - } |
3306 | - |
3307 | -} |
3308 | \ No newline at end of file |
3309 | |
3310 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemonClient.cs' |
3311 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemonClient.cs 2010-07-13 09:12:00 +0000 |
3312 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemonClient.cs 1970-01-01 00:00:00 +0000 |
3313 | @@ -1,362 +0,0 @@ |
3314 | -//------------------------------------------------------------------------------ |
3315 | -// <auto-generated> |
3316 | -// This code was generated by a tool. |
3317 | -// |
3318 | -// Changes to this file may cause incorrect behavior and will be lost if |
3319 | -// the code is regenerated. |
3320 | -// </auto-generated> |
3321 | -//------------------------------------------------------------------------------ |
3322 | - |
3323 | -// Generated from: sync_daemon_client.proto |
3324 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
3325 | -{ |
3326 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"SyncDaemonClientMessage")] |
3327 | - public partial class SyncDaemonClientMessage : global::ProtoBuf.IExtensible |
3328 | - { |
3329 | - public SyncDaemonClientMessage() {} |
3330 | - |
3331 | - private SyncDaemonClientMessage.MessageType _type; |
3332 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
3333 | - public SyncDaemonClientMessage.MessageType Type |
3334 | - { |
3335 | - get { return _type; } |
3336 | - set { _type = value; } |
3337 | - } |
3338 | - |
3339 | - private SyncDaemonClientMessage.DownloadMessage _download = null; |
3340 | - [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"download", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3341 | - [global::System.ComponentModel.DefaultValue(null)] |
3342 | - public SyncDaemonClientMessage.DownloadMessage Download |
3343 | - { |
3344 | - get { return _download; } |
3345 | - set { _download = value; } |
3346 | - } |
3347 | - |
3348 | - private SyncDaemonClientMessage.UploadMessage _upload = null; |
3349 | - [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"upload", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3350 | - [global::System.ComponentModel.DefaultValue(null)] |
3351 | - public SyncDaemonClientMessage.UploadMessage Upload |
3352 | - { |
3353 | - get { return _upload; } |
3354 | - set { _upload = value; } |
3355 | - } |
3356 | - |
3357 | - private SyncDaemonClientMessage.StateMessage _state = null; |
3358 | - [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"state", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3359 | - [global::System.ComponentModel.DefaultValue(null)] |
3360 | - public SyncDaemonClientMessage.StateMessage State |
3361 | - { |
3362 | - get { return _state; } |
3363 | - set { _state = value; } |
3364 | - } |
3365 | - |
3366 | - private SyncDaemonClientMessage.ShareMessage _share = null; |
3367 | - [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"share", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3368 | - [global::System.ComponentModel.DefaultValue(null)] |
3369 | - public SyncDaemonClientMessage.ShareMessage Share |
3370 | - { |
3371 | - get { return _share; } |
3372 | - set { _share = value; } |
3373 | - } |
3374 | - |
3375 | - private SyncDaemonClientMessage.UdfDataMessage _udf = null; |
3376 | - [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"udf", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3377 | - [global::System.ComponentModel.DefaultValue(null)] |
3378 | - public SyncDaemonClientMessage.UdfDataMessage Udf |
3379 | - { |
3380 | - get { return _udf; } |
3381 | - set { _udf = value; } |
3382 | - } |
3383 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"NodeMessage")] |
3384 | - public partial class NodeMessage : global::ProtoBuf.IExtensible |
3385 | - { |
3386 | - public NodeMessage() {} |
3387 | - |
3388 | - private string _path; |
3389 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"path", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3390 | - public string Path |
3391 | - { |
3392 | - get { return _path; } |
3393 | - set { _path = value; } |
3394 | - } |
3395 | - private string _nodeId; |
3396 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"node_id", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3397 | - public string NodeId |
3398 | - { |
3399 | - get { return _nodeId; } |
3400 | - set { _nodeId = value; } |
3401 | - } |
3402 | - private string _volumeId; |
3403 | - [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"volume_id", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3404 | - public string VolumeId |
3405 | - { |
3406 | - get { return _volumeId; } |
3407 | - set { _volumeId = value; } |
3408 | - } |
3409 | - private global::ProtoBuf.IExtension extensionObject; |
3410 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3411 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3412 | - } |
3413 | - |
3414 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"DownloadMessage")] |
3415 | - public partial class DownloadMessage : global::ProtoBuf.IExtensible |
3416 | - { |
3417 | - public DownloadMessage() {} |
3418 | - |
3419 | - private SyncDaemonClientMessage.NodeMessage _node; |
3420 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"node", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3421 | - public SyncDaemonClientMessage.NodeMessage Node |
3422 | - { |
3423 | - get { return _node; } |
3424 | - set { _node = value; } |
3425 | - } |
3426 | - private int _numberOfBytesRead; |
3427 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"number_of_bytes_read", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
3428 | - public int NumberOfBytesRead |
3429 | - { |
3430 | - get { return _numberOfBytesRead; } |
3431 | - set { _numberOfBytesRead = value; } |
3432 | - } |
3433 | - private global::ProtoBuf.IExtension extensionObject; |
3434 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3435 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3436 | - } |
3437 | - |
3438 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UploadMessage")] |
3439 | - public partial class UploadMessage : global::ProtoBuf.IExtensible |
3440 | - { |
3441 | - public UploadMessage() {} |
3442 | - |
3443 | - private SyncDaemonClientMessage.NodeMessage _node; |
3444 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"node", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3445 | - public SyncDaemonClientMessage.NodeMessage Node |
3446 | - { |
3447 | - get { return _node; } |
3448 | - set { _node = value; } |
3449 | - } |
3450 | - private int _numberOfBytesWritten; |
3451 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"number_of_bytes_written", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
3452 | - public int NumberOfBytesWritten |
3453 | - { |
3454 | - get { return _numberOfBytesWritten; } |
3455 | - set { _numberOfBytesWritten = value; } |
3456 | - } |
3457 | - private global::ProtoBuf.IExtension extensionObject; |
3458 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3459 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3460 | - } |
3461 | - |
3462 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"StateMessage")] |
3463 | - public partial class StateMessage : global::ProtoBuf.IExtensible |
3464 | - { |
3465 | - public StateMessage() {} |
3466 | - |
3467 | - private string _name; |
3468 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3469 | - public string Name |
3470 | - { |
3471 | - get { return _name; } |
3472 | - set { _name = value; } |
3473 | - } |
3474 | - private string _description; |
3475 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"description", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3476 | - public string Description |
3477 | - { |
3478 | - get { return _description; } |
3479 | - set { _description = value; } |
3480 | - } |
3481 | - private bool _isError; |
3482 | - [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"is_error", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3483 | - public bool IsError |
3484 | - { |
3485 | - get { return _isError; } |
3486 | - set { _isError = value; } |
3487 | - } |
3488 | - private bool _isConnected; |
3489 | - [global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"is_connected", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3490 | - public bool IsConnected |
3491 | - { |
3492 | - get { return _isConnected; } |
3493 | - set { _isConnected = value; } |
3494 | - } |
3495 | - private bool _isOnline; |
3496 | - [global::ProtoBuf.ProtoMember(5, IsRequired = true, Name=@"is_online", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3497 | - public bool IsOnline |
3498 | - { |
3499 | - get { return _isOnline; } |
3500 | - set { _isOnline = value; } |
3501 | - } |
3502 | - private global::ProtoBuf.IExtension extensionObject; |
3503 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3504 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3505 | - } |
3506 | - |
3507 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ShareMessage")] |
3508 | - public partial class ShareMessage : global::ProtoBuf.IExtensible |
3509 | - { |
3510 | - public ShareMessage() {} |
3511 | - |
3512 | - private SyncDaemonClientMessage.NodeMessage _node; |
3513 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"node", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3514 | - public SyncDaemonClientMessage.NodeMessage Node |
3515 | - { |
3516 | - get { return _node; } |
3517 | - set { _node = value; } |
3518 | - } |
3519 | - private string _name; |
3520 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3521 | - public string Name |
3522 | - { |
3523 | - get { return _name; } |
3524 | - set { _name = value; } |
3525 | - } |
3526 | - private string _otherUsername; |
3527 | - [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"other_username", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3528 | - public string OtherUsername |
3529 | - { |
3530 | - get { return _otherUsername; } |
3531 | - set { _otherUsername = value; } |
3532 | - } |
3533 | - private string _otherVisibleName; |
3534 | - [global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"other_visible_name", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3535 | - public string OtherVisibleName |
3536 | - { |
3537 | - get { return _otherVisibleName; } |
3538 | - set { _otherVisibleName = value; } |
3539 | - } |
3540 | - private bool _isAccepted; |
3541 | - [global::ProtoBuf.ProtoMember(5, IsRequired = true, Name=@"is_accepted", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3542 | - public bool IsAccepted |
3543 | - { |
3544 | - get { return _isAccepted; } |
3545 | - set { _isAccepted = value; } |
3546 | - } |
3547 | - private SyncDaemonClientMessage.AccessLevel _accessLevel; |
3548 | - [global::ProtoBuf.ProtoMember(6, IsRequired = true, Name=@"access_level", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
3549 | - public SyncDaemonClientMessage.AccessLevel AccessLevel |
3550 | - { |
3551 | - get { return _accessLevel; } |
3552 | - set { _accessLevel = value; } |
3553 | - } |
3554 | - private int _freeBytes; |
3555 | - [global::ProtoBuf.ProtoMember(7, IsRequired = true, Name=@"free_bytes", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] |
3556 | - public int FreeBytes |
3557 | - { |
3558 | - get { return _freeBytes; } |
3559 | - set { _freeBytes = value; } |
3560 | - } |
3561 | - private global::ProtoBuf.IExtension extensionObject; |
3562 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3563 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3564 | - } |
3565 | - |
3566 | - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UdfDataMessage")] |
3567 | - public partial class UdfDataMessage : global::ProtoBuf.IExtensible |
3568 | - { |
3569 | - public UdfDataMessage() {} |
3570 | - |
3571 | - private SyncDaemonClientMessage.NodeMessage _node; |
3572 | - [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"node", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3573 | - public SyncDaemonClientMessage.NodeMessage Node |
3574 | - { |
3575 | - get { return _node; } |
3576 | - set { _node = value; } |
3577 | - } |
3578 | - private string _suggestedPath; |
3579 | - [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"suggested_path", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3580 | - public string SuggestedPath |
3581 | - { |
3582 | - get { return _suggestedPath; } |
3583 | - set { _suggestedPath = value; } |
3584 | - } |
3585 | - private bool _isSubscribed; |
3586 | - [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"is_subscribed", DataFormat = global::ProtoBuf.DataFormat.Default)] |
3587 | - public bool IsSubscribed |
3588 | - { |
3589 | - get { return _isSubscribed; } |
3590 | - set { _isSubscribed = value; } |
3591 | - } |
3592 | - private global::ProtoBuf.IExtension extensionObject; |
3593 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3594 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3595 | - } |
3596 | - |
3597 | - [global::ProtoBuf.ProtoContract(Name=@"MessageType")] |
3598 | - public enum MessageType |
3599 | - { |
3600 | - |
3601 | - [global::ProtoBuf.ProtoEnum(Name=@"DOWNLOAD_STARTED", Value=1)] |
3602 | - DOWNLOADSTARTED = 1, |
3603 | - |
3604 | - [global::ProtoBuf.ProtoEnum(Name=@"DOWNLOAD_FINISHED", Value=2)] |
3605 | - DOWNLOADFINISHED = 2, |
3606 | - |
3607 | - [global::ProtoBuf.ProtoEnum(Name=@"UPLOAD_STARTED", Value=3)] |
3608 | - UPLOADSTARTED = 3, |
3609 | - |
3610 | - [global::ProtoBuf.ProtoEnum(Name=@"UPLOAD_FINISHED", Value=4)] |
3611 | - UPLOADFINISHED = 4, |
3612 | - |
3613 | - [global::ProtoBuf.ProtoEnum(Name=@"STATUS_CHANGED", Value=5)] |
3614 | - STATUSCHANGED = 5, |
3615 | - |
3616 | - [global::ProtoBuf.ProtoEnum(Name=@"ACCOUNT_CHANGED", Value=6)] |
3617 | - ACCOUNTCHANGED = 6, |
3618 | - |
3619 | - [global::ProtoBuf.ProtoEnum(Name=@"SHARE_CHANGED", Value=7)] |
3620 | - SHARECHANGED = 7, |
3621 | - |
3622 | - [global::ProtoBuf.ProtoEnum(Name=@"CREATE_SHARE_RESPONSE", Value=8)] |
3623 | - CREATESHARERESPONSE = 8, |
3624 | - |
3625 | - [global::ProtoBuf.ProtoEnum(Name=@"NEW_SHARE", Value=9)] |
3626 | - NEWSHARE = 9, |
3627 | - |
3628 | - [global::ProtoBuf.ProtoEnum(Name=@"ACCEPT_SHARE_SUCCESS", Value=10)] |
3629 | - ACCEPTSHARESUCCESS = 10, |
3630 | - |
3631 | - [global::ProtoBuf.ProtoEnum(Name=@"ACCEPT_SHARE_FAILURE", Value=11)] |
3632 | - ACCEPTSHAREFAILURE = 11, |
3633 | - |
3634 | - [global::ProtoBuf.ProtoEnum(Name=@"REJECT_SHARE_SUCCESS", Value=12)] |
3635 | - REJECTSHARESUCCESS = 12, |
3636 | - |
3637 | - [global::ProtoBuf.ProtoEnum(Name=@"REJECT_SHARE_FAILURE", Value=13)] |
3638 | - REJECTSHAREFAILURE = 13, |
3639 | - |
3640 | - [global::ProtoBuf.ProtoEnum(Name=@"CREATE_SHARE_SUCCESS", Value=14)] |
3641 | - CREATESHARESUCCESS = 14, |
3642 | - |
3643 | - [global::ProtoBuf.ProtoEnum(Name=@"CREATE_SHARE_FAILURE", Value=15)] |
3644 | - CREATESHAREFAILURE = 15, |
3645 | - |
3646 | - [global::ProtoBuf.ProtoEnum(Name=@"CREATE_FOLDER_SUCESS", Value=16)] |
3647 | - CREATEFOLDERSUCESS = 16, |
3648 | - |
3649 | - [global::ProtoBuf.ProtoEnum(Name=@"CREATE_FOLDER_FAILURE", Value=17)] |
3650 | - CREATEFOLDERFAILURE = 17, |
3651 | - |
3652 | - [global::ProtoBuf.ProtoEnum(Name=@"DELETE_FOLDER_SUCCESS", Value=18)] |
3653 | - DELETEFOLDERSUCCESS = 18, |
3654 | - |
3655 | - [global::ProtoBuf.ProtoEnum(Name=@"DELETE_FOLDER_FAILURE", Value=19)] |
3656 | - DELETEFOLDERFAILURE = 19 |
3657 | - } |
3658 | - |
3659 | - [global::ProtoBuf.ProtoContract(Name=@"AccessLevel")] |
3660 | - public enum AccessLevel |
3661 | - { |
3662 | - |
3663 | - [global::ProtoBuf.ProtoEnum(Name=@"VIEW", Value=1)] |
3664 | - VIEW = 1, |
3665 | - |
3666 | - [global::ProtoBuf.ProtoEnum(Name=@"MODIFY", Value=2)] |
3667 | - MODIFY = 2 |
3668 | - } |
3669 | - |
3670 | - private global::ProtoBuf.IExtension extensionObject; |
3671 | - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) |
3672 | - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } |
3673 | - } |
3674 | - |
3675 | -} |
3676 | \ No newline at end of file |
3677 | |
3678 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemonMessageExtensions.cs' |
3679 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemonMessageExtensions.cs 2010-08-05 08:15:00 +0000 |
3680 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemonMessageExtensions.cs 1970-01-01 00:00:00 +0000 |
3681 | @@ -1,60 +0,0 @@ |
3682 | -// Copyright 2010 Canonical Ltd. |
3683 | -// |
3684 | -// This file is part of UbuntuOne on Windows. |
3685 | -// |
3686 | -// UbuntuOne on Windows is free software: you can redistribute it and/or modify |
3687 | -// it under the terms of the GNU Lesser General Public License version |
3688 | -// as published by the Free Software Foundation. |
3689 | -// |
3690 | -// Ubuntu One on Windows is distributed in the hope that it will be useful, |
3691 | -// but WITHOUT ANY WARRANTY; without even the implied warranty of |
3692 | -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3693 | -// GNU Lesser General Public License for more details. |
3694 | -// |
3695 | -// You should have received a copy of the GNU Lesser General Public License |
3696 | -// along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
3697 | -// |
3698 | -// Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
3699 | -using System.Collections.Generic; |
3700 | - |
3701 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
3702 | -{ |
3703 | - /// <summary> |
3704 | - /// Due to the fact that the SyncDaemonMessage is auto generated by the proto-gen tool we |
3705 | - /// would not be able to add code without loosing it. In order to allow the use of custom code |
3706 | - /// we use extension methods. |
3707 | - /// </summary> |
3708 | - public partial class SyncDaemonMessage |
3709 | - { |
3710 | - /// <summary> |
3711 | - /// Allows the creation of a new sync dameon message with a collection of downloads. This constructor |
3712 | - /// has been added because the generated code does not provide setter for collections in the proto messages. |
3713 | - /// </summary> |
3714 | - /// <param name="downloads">A collection of downloads to be added in the message.</param> |
3715 | - internal SyncDaemonMessage(List<DownloadMessage> downloads) |
3716 | - { |
3717 | - _downloads = downloads; |
3718 | - } |
3719 | - |
3720 | - /// <summary> |
3721 | - /// Allows the creation of a new sync daemon message with a collection of queued items. This constructor |
3722 | - /// has been added because the generated code does not provide a setter for collections in the proto messages. |
3723 | - /// </summary> |
3724 | - /// <param name="queuItemMessages">A collection of queued items added to the message.</param> |
3725 | - internal SyncDaemonMessage(List<QueuItemMessage> queuItemMessages) |
3726 | - { |
3727 | - _waitingItems = queuItemMessages; |
3728 | - } |
3729 | - |
3730 | - /// <summary> |
3731 | - /// Allows the creates of a new sync message with a collection of uploads. This constrcutor has been added |
3732 | - /// because the generated code does not provide a setter for the collections in the proto message. |
3733 | - /// </summary> |
3734 | - /// <param name="uploads">A collection of uploads.</param> |
3735 | - internal SyncDaemonMessage(List<UploadMessage> uploads) |
3736 | - { |
3737 | - _uploads = uploads; |
3738 | - } |
3739 | - } |
3740 | -} |
3741 | - |
3742 | |
3743 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemonMessageFactory.cs' |
3744 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemonMessageFactory.cs 2010-08-10 08:52:14 +0000 |
3745 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemonMessageFactory.cs 1970-01-01 00:00:00 +0000 |
3746 | @@ -1,114 +0,0 @@ |
3747 | -/* |
3748 | - * Copyright 2010 Canonical Ltd. |
3749 | - * |
3750 | - * This file is part of UbuntuOne on Windows. |
3751 | - * |
3752 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
3753 | - * it under the terms of the GNU Lesser General Public License version |
3754 | - * as published by the Free Software Foundation. |
3755 | - * |
3756 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
3757 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3758 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3759 | - * GNU Lesser General Public License for more details. |
3760 | - * |
3761 | - * You should have received a copy of the GNU Lesser General Public License |
3762 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
3763 | - * |
3764 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
3765 | - */ |
3766 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
3767 | -{ |
3768 | - /// <summary> |
3769 | - /// Implementation of the ISyncDaemonMessageFactory that generates the message to be sent to python. |
3770 | - /// </summary> |
3771 | - internal class SyncDaemonMessageFactory : ISyncDaemonMessageFactory |
3772 | - { |
3773 | - /// <summary> |
3774 | - /// Creates a message that can be used to query the root of used by the sync daemon. |
3775 | - /// </summary> |
3776 | - /// <returns>A message that can be used to query the root of the daemon.</returns> |
3777 | - public SyncDaemonMessage QueryRoot() |
3778 | - { |
3779 | - return new SyncDaemonMessage { Type = SyncDaemonMessage.MessageType.QUERYROOT }; |
3780 | - } |
3781 | - |
3782 | - /// <summary> |
3783 | - /// Creates a message that can be used to query the state of the sync daemon. |
3784 | - /// </summary> |
3785 | - /// <returns>A message that can be used to query the sync daemon about its state.</returns> |
3786 | - public SyncDaemonMessage QueryState() |
3787 | - { |
3788 | - return new SyncDaemonMessage { Type = SyncDaemonMessage.MessageType.QUERYSTATUS }; |
3789 | - } |
3790 | - |
3791 | - /// <summary> |
3792 | - /// Creates a message that can be used to query the downloads that are currently in process |
3793 | - /// in the sycn daemon. |
3794 | - /// </summary> |
3795 | - /// <returns>A message that can be used to query the sync daemon about the current downloads.</returns> |
3796 | - public SyncDaemonMessage QueryDownloads() |
3797 | - { |
3798 | - return new SyncDaemonMessage { Type = SyncDaemonMessage.MessageType.QUERYDOWNLOADS }; |
3799 | - } |
3800 | - |
3801 | - /// <summary> |
3802 | - /// Creates a message that can be used to query the sync daemon about the items that are in the |
3803 | - /// queue to be processed. |
3804 | - /// </summary> |
3805 | - /// <returns>A message to query the queue of the daemon.</returns> |
3806 | - public SyncDaemonMessage QueryWaiting() |
3807 | - { |
3808 | - return new SyncDaemonMessage { Type = SyncDaemonMessage.MessageType.QUERYWAITING }; |
3809 | - } |
3810 | - |
3811 | - /// <summary> |
3812 | - /// Creates a message that can be used to query the sync daemon about the items that are currently |
3813 | - /// being uploaded. |
3814 | - /// </summary> |
3815 | - /// <returns>A message that queries the current uploads in the daemon.</returns> |
3816 | - public SyncDaemonMessage QueryUploads() |
3817 | - { |
3818 | - return new SyncDaemonMessage { Type = SyncDaemonMessage.MessageType.QUERYUPLOADS }; |
3819 | - } |
3820 | - |
3821 | - /// <summary> |
3822 | - /// Creates a new message that can be used to place an specific share id with a node id as the |
3823 | - /// next node to be processed. |
3824 | - /// </summary> |
3825 | - /// <param name="shareId">The id of the share.</param> |
3826 | - /// <param name="nodeId">The node id.</param> |
3827 | - /// <returns>A message that can be used to schedule the nex share to be processed.</returns> |
3828 | - public SyncDaemonMessage ScheduleAsNext(string shareId, string nodeId) |
3829 | - { |
3830 | - return new SyncDaemonMessage {NextShareId = shareId, NextNodeId = nodeId, Type = SyncDaemonMessage.MessageType.SCHEDULENEXT}; |
3831 | - } |
3832 | - |
3833 | - /// <summary> |
3834 | - /// Creates a message that will tell the daemon to connect to the UbuntuOne server. |
3835 | - /// </summary> |
3836 | - /// <returns>A message that will tell the python code to connect to the UbuntuOne server.</returns> |
3837 | - public SyncDaemonMessage Connect() |
3838 | - { |
3839 | - return new SyncDaemonMessage {Type = SyncDaemonMessage.MessageType.CONNECT}; |
3840 | - } |
3841 | - |
3842 | - /// <summary> |
3843 | - /// Creates a message that will tell the daemon to disconnect from the UbuntuOne server. |
3844 | - /// </summary> |
3845 | - /// <returns>A message that will tell the python code to disconnect from the UbuntuOne server. </returns> |
3846 | - public SyncDaemonMessage Disconnect() |
3847 | - { |
3848 | - return new SyncDaemonMessage { Type = SyncDaemonMessage.MessageType.DISCONNECT}; |
3849 | - } |
3850 | - |
3851 | - /// <summary> |
3852 | - /// Creates a new message that will tell the daemon to quit. |
3853 | - /// </summary> |
3854 | - /// <returns>A message that will tell the python code to quit the sync daemon.</returns> |
3855 | - public SyncDaemonMessage Quit() |
3856 | - { |
3857 | - return new SyncDaemonMessage{Type = SyncDaemonMessage.MessageType.QUIT}; |
3858 | - } |
3859 | - } |
3860 | -} |
3861 | |
3862 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncFolderMessageFactory.cs' |
3863 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncFolderMessageFactory.cs 2010-08-11 08:05:19 +0000 |
3864 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncFolderMessageFactory.cs 1970-01-01 00:00:00 +0000 |
3865 | @@ -1,90 +0,0 @@ |
3866 | -/* |
3867 | - * Copyright 2010 Canonical Ltd. |
3868 | - * |
3869 | - * This file is part of UbuntuOne on Windows. |
3870 | - * |
3871 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
3872 | - * it under the terms of the GNU Lesser General Public License version |
3873 | - * as published by the Free Software Foundation. |
3874 | - * |
3875 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
3876 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3877 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3878 | - * GNU Lesser General Public License for more details. |
3879 | - * |
3880 | - * You should have received a copy of the GNU Lesser General Public License |
3881 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
3882 | - * |
3883 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
3884 | - */ |
3885 | -using Canonical.UbuntuOne.Common.Validation; |
3886 | - |
3887 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
3888 | -{ |
3889 | - internal class SyncFolderMessageFactory : ISyncFolderMessageFactory |
3890 | - { |
3891 | - public FolderMessage QueryInfo(string folderId) |
3892 | - { |
3893 | - return new FolderMessage { Type = FolderMessage.MessageType.QUERYINFO, Path = folderId }; |
3894 | - } |
3895 | - |
3896 | - public FolderMessage CreateFolder(string path) |
3897 | - { |
3898 | - ValidateArgs.Begin() |
3899 | - .IsNotNullOrEmpty(path, "path") |
3900 | - .Check(); |
3901 | - return new FolderMessage |
3902 | - { |
3903 | - Type = FolderMessage.MessageType.CREATEFOLDER, |
3904 | - Path = path |
3905 | - }; |
3906 | - } |
3907 | - |
3908 | - public FolderMessage DeleteFolder(string path) |
3909 | - { |
3910 | - ValidateArgs.Begin() |
3911 | - .IsNotNullOrEmpty(path, "path") |
3912 | - .Check(); |
3913 | - return new FolderMessage |
3914 | - { |
3915 | - Type = FolderMessage.MessageType.DELETEFOLDER, |
3916 | - Path = path |
3917 | - }; |
3918 | - } |
3919 | - |
3920 | - public FolderMessage QueryFolders() |
3921 | - { |
3922 | - return new FolderMessage { Type = FolderMessage.MessageType.QUERYFOLDERS }; |
3923 | - } |
3924 | - |
3925 | - public FolderMessage Subscribe(string folderId) |
3926 | - { |
3927 | - ValidateArgs.Begin() |
3928 | - .IsNotNullOrEmpty(folderId, "fodlerId") |
3929 | - .Check(); |
3930 | - |
3931 | - return new FolderMessage |
3932 | - { |
3933 | - Type = FolderMessage.MessageType.SUBSCRIBE, |
3934 | - Path = folderId |
3935 | - }; |
3936 | - } |
3937 | - |
3938 | - public FolderMessage Unsubscribe(string folderId) |
3939 | - { |
3940 | - ValidateArgs.Begin() |
3941 | - .IsNotNullOrEmpty(folderId, "folderId") |
3942 | - .Check(); |
3943 | - return new FolderMessage |
3944 | - { |
3945 | - Type = FolderMessage.MessageType.UNSUBSCRIBE, |
3946 | - Path = folderId |
3947 | - }; |
3948 | - } |
3949 | - |
3950 | - public FolderMessage RefreshVolumes() |
3951 | - { |
3952 | - return new FolderMessage { Type = FolderMessage.MessageType.REFRESH }; |
3953 | - } |
3954 | - } |
3955 | -} |
3956 | |
3957 | === removed file 'src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncShareMessageFactory.cs' |
3958 | --- src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncShareMessageFactory.cs 2010-07-13 09:12:00 +0000 |
3959 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncShareMessageFactory.cs 1970-01-01 00:00:00 +0000 |
3960 | @@ -1,98 +0,0 @@ |
3961 | -/** |
3962 | - * Copyright 2010 Canonical Ltd. |
3963 | - * |
3964 | - * This file is part of UbuntuOne on Windows. |
3965 | - * |
3966 | - * UbuntuOne on Windows is free software: you can redistribute it and/or modify |
3967 | - * it under the terms of the GNU Lesser General Public License version |
3968 | - * as published by the Free Software Foundation. |
3969 | - * |
3970 | - * Ubuntu One on Windows is distributed in the hope that it will be useful, |
3971 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3972 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3973 | - * GNU Lesser General Public License for more details. |
3974 | - * |
3975 | - * You should have received a copy of the GNU Lesser General Public License |
3976 | - * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. |
3977 | - * |
3978 | - * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
3979 | - */ |
3980 | -using Canonical.UbuntuOne.Common; |
3981 | -using Canonical.UbuntuOne.Common.Validation; |
3982 | - |
3983 | -namespace Canonical.UbuntuOne.ProcessDispatcher |
3984 | -{ |
3985 | - /// <summary> |
3986 | - /// Factory that can be used to create the messages to use when working with the share service. |
3987 | - /// </summary> |
3988 | - internal class SyncShareMessageFactory : ISyncShareMessageFactory |
3989 | - { |
3990 | - public ShareMessage QueryShares() |
3991 | - { |
3992 | - return new ShareMessage { Type = ShareMessage.MessageType.QUERYOTHERSHARES }; |
3993 | - } |
3994 | - |
3995 | - public ShareMessage AcceptShare(string shareId) |
3996 | - { |
3997 | - ValidateArgs.Begin() |
3998 | - .IsNotNullOrEmpty(shareId, "shareId") |
3999 | - .Check(); |
4000 | - |
4001 | - return new ShareMessage |
4002 | - { |
4003 | - Type = ShareMessage.MessageType.ACCEPTSHARE, |
4004 | - ShareId = shareId |
4005 | - }; |
4006 | - } |
4007 | - |
4008 | - public ShareMessage RejectShare(string shareId) |
4009 | - { |
4010 | - ValidateArgs.Begin() |
4011 | - .IsNotNullOrEmpty(shareId, "shareId") |
4012 | - .Check(); |
4013 | - |
4014 | - return new ShareMessage |
4015 | - { |
4016 | - Type = ShareMessage.MessageType.REJECTSHARE, |
4017 | - ShareId = shareId |
4018 | - }; |
4019 | - } |
4020 | - |
4021 | - public ShareMessage CreateShare(string path, string username, string name, AccessLevel accessLevel) |
4022 | - { |
4023 | - ValidateArgs.Begin() |
4024 | - .IsNotNullOrEmpty(path, "path") |
4025 | - .IsNotNullOrEmpty(username, "username") |
4026 | - .IsNotNullOrEmpty(name, "name") |
4027 | - .Check(); |
4028 | - |
4029 | - var message = new ShareMessage |
4030 | - { |
4031 | - Type = ShareMessage.MessageType.CREATESHARE, |
4032 | - Path = path, |
4033 | - Username = username, |
4034 | - Name = name |
4035 | - }; |
4036 | - switch (accessLevel) |
4037 | - { |
4038 | - case AccessLevel.MODIFY: |
4039 | - message.Access = ShareMessage.AccessLevel.MODIFY; |
4040 | - break; |
4041 | - default: |
4042 | - message.Access = ShareMessage.AccessLevel.VIEW; |
4043 | - break; |
4044 | - } |
4045 | - return message; |
4046 | - } |
4047 | - |
4048 | - public ShareMessage UpdateShares() |
4049 | - { |
4050 | - return new ShareMessage {Type = ShareMessage.MessageType.UPDATESHARES}; |
4051 | - } |
4052 | - |
4053 | - public ShareMessage GetShared() |
4054 | - { |
4055 | - return new ShareMessage {Type = ShareMessage.MessageType.QUERYSHARED}; |
4056 | - } |
4057 | - } |
4058 | -} |