You are on page 1of 5

Use Case1 Sync Folder on device D2 from device D1 (D1 has already offered that folder).

Summary
1. D2 send Subscribe request

Details
1. D2 send Subscribe request
Client Request - Subscriptions
http://<servername>/subscriptions Method: POST X-Device-Type = Mac OS X 10.6 Content-Type = application/json Authorization = Basic dHVzaGFyLmJhZ2F2ZUBxdWlja29mZmljZS5jb206YWJjZA== Accept = application/json Accept-Language = en X-Device-Id = W8045M20AGU__xyz BODY { "subscription" : { "offering_id" : 1 } }

Use Case2 Sync Folder on device D2 from device D1 (not offered)


1. 2. 3. 4. 5. 6. 7. 8. D1 Posts remote_create_offering command to remotefolders. Server creates ops_create_offering operation for D2. D2 creates the offering (Uploads the files). D2 post the response. D2 Completes the operation. Server puts offering data in D1s resultset. D1 gets the resultset. D1 send subscribe request.

1. D1 Posts remote_create_offering command to remoteFolders.


http://wssync-stg-qod.quickofficeconnect.com/WSSync-1.0/remoteFolders Method: POST X-Device-Type = Mac OS X 10.6 Content-Type = application/json Authorization = Basic dHVzaGFyLmJhZ2F2ZUBxdWlja29mZmljZS5jb206YWJjZA== Accept = application/json Accept-Language = en X-Device-Id = W8045M20AGU__xyz HTTP BODY { "remotefolder": { "source_device_id":1, "remote_command":"remote_create_offering", "destination_device_id":2, "source_folder":"/test/test" "long_desc" : "These are my work documents" } }

Immediate response from server


{"transaction_id":"a237b37f-4e2a-4428-ab69-0aaedef72bd9"}

2. Server creates ops_create_offering operation for D2.


{"operation": { "operation_id":19000, "op":"ops_create_offering", "source_transaction_id":"3fe97f6f-7713-494f-b364-22237113cc0f", "status":"in_progress", "source_device_id":1, "self_link":"http:// wssync-stgqod.quickofficeconnect.com/WSSync/operations/19000",

"local_folder":"/test/test", "long_desc" : "These are my work documents" } }

3. D2 creates the offering


Client Request - Create Offering POST http://<servername>/offerings/
{ "offering" : { "type" : "package", "label" : "My Documents", "long_desc" : "These are my work documents" } }

Server Response - Create Offering


{ "offering" : { "offering_id" : 1 "type" : "package" "label" : My Personal Docs "long_desc" : These are all of my personal documents, "root_file_info_id" : 1, "links" : [ { "auto_subscription": "http://<servername>/subscriptions/7" }, { "subscription": "http://<servername>/subscriptions/7" }, { "operation": "http://<servername>/subscriptions/7/operations" } ] } }

[D2 will subscribe to the offering and Upload MDT:]

4. D2 POST response
{"remotefolder": { "offering_id":1, "label" : My Personal Docs", "root_file_info_id" : 1, "source_device_id":1, "source_transaction_id":"3fe97f6f-7713-494f-b364-22237113cc0f" } }

OR { "error": { "source_device_id"1, "source_transaction_id": "3fe97f6f-7713-494f-b364-22237113cc0f", "messages": [ { "message": { "content": "invalid_path" } } ] } }

5. D2 Complete the operation


{"operation":{"status":"complete"}}

6. Server puts the folders data in D1s resultset 7. D1 gets the resultset.
{ {"resultsets": {"children": [ {"resultset_processing_status":"ALL_RESULTS_OK", "results": [ {"remotefolder": { "offering_id":1, "label" : My Personal Docs", "root_file_info_id" : 1 "source_transaction_id":"96cd376f-3a52-40c8-b6d7d2402411d032", "source_device_id":3 }, "result_processed_ok":true, "result_type":"create_offering_status" } ], "transaction_identifier":"96cd376f-3a52-40c8-b6d7d2402411d032" } ] } }}

8. D1 send subscribe request


Client Request - Subscriptions
http://<servername>/subscriptions Method: POST X-Device-Type = Mac OS X 10.6 Content-Type = application/json Authorization = Basic dHVzaGFyLmJhZ2F2ZUBxdWlja29mZmljZS5jb206YWJjZA== Accept = application/json Accept-Language = en X-Device-Id = W8045M20AGU__xyz BODY { "subscription" : { "offering_id" : 1 } }

You might also like