rhoconnect 3.4.5 → 4.0.0.beta.10
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +57 -3
- data/Gemfile +9 -7
- data/Gemfile.lock +37 -37
- data/Rakefile +18 -7
- data/bench/benchapp/Gemfile +1 -1
- data/bench/benchapp/config.ru +0 -3
- data/bench/benchapp/controllers/ruby/application.rb +17 -0
- data/bench/benchapp/controllers/ruby/application_controller.rb +17 -0
- data/bench/benchapp/controllers/ruby/mock_adapter_controller.rb +8 -0
- data/bench/benchapp/controllers/ruby/queue_mock_adapter_controller.rb +8 -0
- data/bench/benchapp/{sources → models/ruby}/mock_adapter.rb +1 -1
- data/bench/benchapp/{sources → models/ruby}/queue_mock_adapter.rb +0 -0
- data/bench/benchapp/spec/{sources → models/ruby}/mock_adapter_spec.rb +1 -1
- data/bench/benchapp/spec/{sources → models/ruby}/queue_mock_adapter_spec.rb +1 -1
- data/bench/benchapp/spec/spec_helper.rb +2 -2
- data/bench/blobapp/Gemfile +1 -1
- data/bench/blobapp/config.ru +0 -3
- data/bench/blobapp/controllers/ruby/application_controller.rb +17 -0
- data/bench/blobapp/controllers/ruby/blob_adapter_controller.rb +8 -0
- data/bench/blobapp/{sources → models/ruby}/blob_adapter.rb +9 -2
- data/bench/blobapp/spec/{sources → models/ruby}/blob_adapter_spec.rb +1 -1
- data/bench/blobapp/spec/spec_helper.rb +1 -1
- data/bench/lib/bench/cli.rb +1 -1
- data/bench/scripts/blob_cud_script.rb +1 -1
- data/bench/scripts/query_md_script.rb +1 -1
- data/bench/scripts/query_only_script.rb +1 -1
- data/bench/scripts/query_script.rb +1 -1
- data/bench/scripts/test_query_script.rb +7 -1
- data/bench/spec/mock_adapter_spec.rb +1 -1
- data/bench/spec/result_spec.rb +3 -3
- data/bin/rhoconnect +5 -3
- data/commands/dtach/dtach_install.rb +2 -2
- data/commands/execute.rb +8 -3
- data/commands/generators/app.rb +3 -3
- data/commands/generators/controller.rb +6 -0
- data/commands/generators/model.rb +6 -0
- data/commands/generators/source.rb +3 -3
- data/commands/generators/update.rb +1 -1
- data/commands/redis/redis_about.rb +2 -2
- data/commands/redis/redis_download.rb +1 -1
- data/commands/redis/redis_install.rb +4 -3
- data/commands/redis/redis_restart.rb +4 -4
- data/commands/redis/redis_start.rb +5 -4
- data/commands/redis/redis_startbg.rb +5 -4
- data/commands/redis/redis_status.rb +13 -0
- data/commands/redis/redis_stop.rb +3 -3
- data/commands/rhoconnect/config.rb +28 -16
- data/commands/rhoconnect/flushdb.rb +1 -2
- data/commands/rhoconnect/get_token.rb +15 -11
- data/commands/rhoconnect/restart.rb +13 -5
- data/commands/rhoconnect/set_admin_password.rb +8 -8
- data/commands/rhoconnect/start.rb +74 -16
- data/commands/rhoconnect/startbg.rb +1 -1
- data/commands/rhoconnect/startdebug.rb +1 -1
- data/commands/rhoconnect/stop.rb +13 -1
- data/commands/rhoconnect/web.rb +5 -5
- data/commands/rhoconnect_console/console.rb +7 -5
- data/commands/{rhoconnect → rhoconnect_spec}/spec.rb +0 -0
- data/commands/rhoconnect_war/war.rb +9 -9
- data/commands/utilities/blank_app.ru +56 -0
- data/commands/utilities/redis_runner.rb +54 -19
- data/doc/authentication.txt +80 -6
- data/doc/blob-sync.txt +104 -97
- data/doc/bulk-sync.txt +1 -1
- data/doc/client-java.txt +3 -3
- data/doc/client-objc.txt +2 -2
- data/doc/client.txt +4 -4
- data/doc/command-line.txt +105 -200
- data/doc/data-partitioning.txt +40 -0
- data/doc/deploying.txt +249 -77
- data/doc/extending-rhoconnect-server.txt +40 -57
- data/doc/heroku-addon.txt +2 -0
- data/doc/install.txt +45 -95
- data/doc/introduction.txt +1 -1
- data/doc/java-plugin.txt +365 -190
- data/doc/metadata.txt +1 -1
- data/doc/migration.txt +108 -142
- data/doc/preparing-production.txt +1 -1
- data/doc/push-backend-setup.txt +2 -0
- data/doc/push-client-setup-android.txt +78 -0
- data/doc/push-client-setup-bb.txt +81 -0
- data/doc/push-client-setup-ios.txt +70 -0
- data/doc/push-client-setup-rps.txt +200 -0
- data/doc/push-client-setup.txt +63 -66
- data/doc/push-server-setup.txt +67 -40
- data/doc/push-testing.txt +29 -0
- data/doc/push.txt +21 -6
- data/doc/rest-api.txt +128 -55
- data/doc/rhoconnect-redis-stack.txt +120 -0
- data/doc/settings.txt +4 -12
- data/doc/source-adapters-intro.txt +28 -0
- data/doc/source-adapters.txt +235 -272
- data/doc/stats-middleware.txt +9 -29
- data/doc/supported-platforms.txt +21 -30
- data/doc/testing.txt +40 -42
- data/doc/tutorial.txt +72 -57
- data/examples/simple/Gemfile +1 -1
- data/examples/simple/application.rb +4 -5
- data/examples/simple/my_server.rb +2 -2
- data/examples/simple/settings/settings.yml +1 -1
- data/generators/rhoconnect.rb +151 -50
- data/generators/templates/application/Gemfile +1 -1
- data/generators/templates/application/Rakefile +3 -3
- data/generators/templates/application/config.ru +1 -4
- data/generators/templates/application/controllers/application_controller.rb +17 -0
- data/generators/templates/application/controllers/js/application_controller.js +14 -0
- data/generators/templates/application/controllers/ruby/application_controller.rb +17 -0
- data/generators/templates/application/package.json +8 -0
- data/generators/templates/application/rcgemfile +2 -5
- data/generators/templates/application/settings/settings.yml +3 -3
- data/generators/templates/application/spec/application_controller_spec.rb +23 -0
- data/generators/templates/application/spec/js_spec.rb +25 -0
- data/generators/templates/application/spec/spec_helper.rb +21 -7
- data/generators/templates/source/controllers/js/controller.js +7 -0
- data/generators/templates/source/controllers/ruby/controller.rb +8 -0
- data/generators/templates/source/controllers/ruby/controller_spec.rb +27 -0
- data/generators/templates/source/models/js/model.js +46 -0
- data/generators/templates/source/{source_adapter.rb → models/ruby/model.rb} +15 -10
- data/generators/templates/source/{source_spec.rb → models/ruby/model_spec.rb} +1 -1
- data/install.sh +5 -5
- data/installer/unix-like/create_texts.rb +2 -2
- data/installer/unix-like/rho_connect_install_constants.rb +2 -2
- data/installer/unix-like/rho_connect_install_utilities.rb +1 -1
- data/installer/utils/constants.rb +4 -4
- data/js-adapters/ballroom.js +216 -0
- data/js-adapters/node.rb +52 -0
- data/js-adapters/node_channel.rb +181 -0
- data/js-adapters/request.js +27 -0
- data/js-adapters/response.js +57 -0
- data/js-adapters/rhoconnect_helpers.js +60 -0
- data/js-adapters/router.js +60 -0
- data/js-adapters/server.js +5 -0
- data/lib/rhoconnect/api/app/ans_login.rb +3 -3
- data/lib/rhoconnect/api/app/bulk_data.rb +10 -10
- data/lib/rhoconnect/api/app/fast_delete.rb +11 -10
- data/lib/rhoconnect/api/app/fast_insert.rb +11 -10
- data/lib/rhoconnect/api/app/fast_update.rb +11 -10
- data/lib/rhoconnect/api/app/login.rb +5 -5
- data/lib/rhoconnect/api/app/push_deletes.rb +12 -11
- data/lib/rhoconnect/api/app/push_objects.rb +12 -11
- data/lib/rhoconnect/api/app/query.rb +8 -7
- data/lib/rhoconnect/api/app/queue_updates.rb +98 -94
- data/lib/rhoconnect/api/app/search.rb +8 -7
- data/lib/rhoconnect/api/client/client_get_db_doc.rb +5 -5
- data/lib/rhoconnect/api/client/client_set_db_doc.rb +8 -8
- data/lib/rhoconnect/api/client/create.rb +7 -7
- data/lib/rhoconnect/api/client/get_client_params.rb +4 -4
- data/lib/rhoconnect/api/client/list_client_docs.rb +17 -17
- data/lib/rhoconnect/api/client/register.rb +12 -12
- data/lib/rhoconnect/api/client/reset.rb +5 -5
- data/lib/rhoconnect/api/readstate/set_refresh_time.rb +9 -9
- data/lib/rhoconnect/api/source/get_source_params.rb +4 -4
- data/lib/rhoconnect/api/source/list_sources.rb +16 -16
- data/lib/rhoconnect/api/source/update_source_params.rb +6 -6
- data/lib/rhoconnect/api/store/get_db_doc.rb +4 -4
- data/lib/rhoconnect/api/store/set_db_doc.rb +7 -7
- data/lib/rhoconnect/api/system/get_adapter.rb +4 -4
- data/lib/rhoconnect/api/system/get_license_info.rb +8 -8
- data/lib/rhoconnect/api/system/login.rb +15 -15
- data/lib/rhoconnect/api/system/reset.rb +11 -11
- data/lib/rhoconnect/api/system/save_adapter.rb +4 -4
- data/lib/rhoconnect/api/system/stats.rb +22 -22
- data/lib/rhoconnect/api/user/create_user.rb +7 -7
- data/lib/rhoconnect/api/user/delete_client.rb +6 -6
- data/lib/rhoconnect/api/user/delete_user.rb +11 -10
- data/lib/rhoconnect/api/user/list_clients.rb +4 -4
- data/lib/rhoconnect/api/user/list_source_docs.rb +10 -10
- data/lib/rhoconnect/api/user/list_users.rb +3 -3
- data/lib/rhoconnect/api/user/ping.rb +3 -3
- data/lib/rhoconnect/api/user/show_user.rb +3 -3
- data/lib/rhoconnect/api/user/update_user.rb +5 -5
- data/lib/rhoconnect/api/user/user_get_db_doc.rb +5 -5
- data/lib/rhoconnect/api/user/user_set_db_doc.rb +10 -10
- data/lib/rhoconnect/api_token.rb +5 -6
- data/lib/rhoconnect/app.rb +6 -46
- data/lib/rhoconnect/application/init.rb +5 -2
- data/lib/rhoconnect/async.rb +76 -39
- data/lib/rhoconnect/bulk_data/bulk_data.rb +6 -4
- data/lib/rhoconnect/client.rb +59 -9
- data/lib/rhoconnect/condition/admin_required.rb +27 -0
- data/lib/rhoconnect/condition/client_required.rb +50 -0
- data/lib/rhoconnect/condition/login_required.rb +22 -0
- data/lib/rhoconnect/condition/source_required.rb +49 -0
- data/lib/rhoconnect/condition/verbs.rb +17 -0
- data/lib/rhoconnect/condition/verify_success.rb +19 -0
- data/lib/rhoconnect/controller/app_base.rb +74 -0
- data/lib/rhoconnect/controller/base.rb +68 -0
- data/lib/rhoconnect/controller/clients_controller.rb +79 -0
- data/lib/rhoconnect/controller/dynamic_adapter_controller.rb +93 -0
- data/lib/rhoconnect/controller/js_base.rb +124 -0
- data/lib/rhoconnect/controller/read_state_controller.rb +22 -0
- data/lib/rhoconnect/controller/source_adapter_base.rb +14 -0
- data/lib/rhoconnect/controller/sources_controller.rb +44 -0
- data/lib/rhoconnect/controller/store_controller.rb +25 -0
- data/lib/rhoconnect/controller/system_controller.rb +67 -0
- data/lib/rhoconnect/controller/users_controller.rb +99 -0
- data/lib/rhoconnect/db_adapter.rb +1 -3
- data/lib/rhoconnect/document.rb +159 -50
- data/lib/rhoconnect/handler/authenticate/execute_methods.rb +77 -0
- data/lib/rhoconnect/handler/authenticate/runner.rb +49 -0
- data/lib/rhoconnect/handler/authenticate.rb +3 -0
- data/lib/rhoconnect/handler/bulk_data.rb +28 -0
- data/lib/rhoconnect/handler/changes/engine.rb +271 -0
- data/lib/rhoconnect/handler/changes/execute_methods.rb +88 -0
- data/lib/rhoconnect/handler/changes/pass_through_runner.rb +11 -0
- data/lib/rhoconnect/handler/changes/runner.rb +53 -0
- data/lib/rhoconnect/handler/changes.rb +31 -0
- data/lib/rhoconnect/handler/helpers/auth_method.rb +29 -0
- data/lib/rhoconnect/handler/helpers/binding.rb +18 -0
- data/lib/rhoconnect/handler/helpers/bulk_data.rb +53 -0
- data/lib/rhoconnect/handler/helpers/source_job.rb +14 -0
- data/lib/rhoconnect/handler/helpers.rb +4 -0
- data/lib/rhoconnect/handler/plugin_callbacks/execute_methods.rb +99 -0
- data/lib/rhoconnect/handler/plugin_callbacks/runner.rb +28 -0
- data/lib/rhoconnect/handler/plugin_callbacks.rb +67 -0
- data/lib/rhoconnect/handler/query/engine.rb +93 -0
- data/lib/rhoconnect/handler/query/execute_methods.rb +21 -0
- data/lib/rhoconnect/handler/query/pass_through_runner.rb +35 -0
- data/lib/rhoconnect/handler/query/runner.rb +270 -0
- data/lib/rhoconnect/handler/query.rb +19 -0
- data/lib/rhoconnect/handler/search/engine.rb +60 -0
- data/lib/rhoconnect/handler/search/execute_methods.rb +32 -0
- data/lib/rhoconnect/handler/search/pass_through_runner.rb +18 -0
- data/lib/rhoconnect/handler/search/runner.rb +104 -0
- data/lib/rhoconnect/handler/search.rb +26 -0
- data/lib/rhoconnect/handler/sync.rb +29 -0
- data/lib/rhoconnect/jobs/source_job.rb +13 -4
- data/lib/rhoconnect/js_adapter.rb +79 -0
- data/lib/rhoconnect/license.rb +10 -2
- data/lib/rhoconnect/middleware/current_user.rb +14 -1
- data/lib/rhoconnect/middleware/helpers.rb +10 -93
- data/lib/rhoconnect/middleware/x_domain_session_wrapper.rb +1 -1
- data/lib/rhoconnect/model/base.rb +229 -0
- data/lib/rhoconnect/model/dynamic_adapter_model.rb +90 -0
- data/lib/rhoconnect/model/js_base.rb +121 -0
- data/lib/rhoconnect/ping/android.rb +1 -1
- data/lib/rhoconnect/predefined_adapters/bench_adapter.rb +7 -4
- data/lib/rhoconnect/read_state.rb +3 -3
- data/lib/rhoconnect/server.rb +159 -190
- data/lib/rhoconnect/source.rb +100 -11
- data/lib/rhoconnect/stats/record.rb +10 -10
- data/lib/rhoconnect/store.rb +905 -591
- data/lib/rhoconnect/{model.rb → store_orm.rb} +53 -115
- data/lib/rhoconnect/tasks.rb +18 -4
- data/lib/rhoconnect/test_methods.rb +30 -17
- data/lib/rhoconnect/user.rb +35 -17
- data/lib/rhoconnect/utilities.rb +1 -1
- data/lib/rhoconnect/version.rb +2 -2
- data/lib/rhoconnect/web-console/server.rb +29 -14
- data/lib/rhoconnect/web-console/views/home.js +10 -10
- data/lib/rhoconnect/web-console/views/new_ping.js +1 -1
- data/lib/rhoconnect.rb +120 -51
- data/rhoconnect.gemspec +4 -3
- data/spec/api/api_helper.rb +1 -6
- data/spec/api/app/fast_delete_spec.rb +4 -4
- data/spec/api/app/fast_insert_spec.rb +4 -4
- data/spec/api/app/fast_update_spec.rb +8 -8
- data/spec/api/app/push_deletes_spec.rb +2 -2
- data/spec/api/app/push_objects_spec.rb +5 -5
- data/spec/api/client/client_get_db_doc_spec.rb +6 -4
- data/spec/api/client/client_set_db_doc_spec.rb +3 -2
- data/spec/api/client/get_client_params_spec.rb +14 -0
- data/spec/api/client/list_client_docs_spec.rb +30 -20
- data/spec/api/client/reset_spec.rb +36 -0
- data/spec/api/source/get_source_params_spec.rb +23 -17
- data/spec/api/system/get_license_info_spec.rb +0 -20
- data/spec/api/system/login_spec.rb +8 -0
- data/spec/api/system/reset_spec.rb +0 -1
- data/spec/api/system/stats_spec.rb +5 -5
- data/spec/api/user/create_user_spec.rb +14 -6
- data/spec/api/user/delete_user_spec.rb +20 -18
- data/spec/api/user/list_users_spec.rb +5 -6
- data/spec/api/user/update_user_spec.rb +5 -4
- data/spec/apps/rhotestapp/config.ru +16 -1
- data/spec/apps/rhotestapp/controllers/js/js_sample_controller.js +23 -0
- data/spec/apps/rhotestapp/controllers/js/sample2_controller.js +32 -0
- data/spec/apps/rhotestapp/controllers/ruby/application_controller.rb +21 -0
- data/spec/apps/rhotestapp/controllers/ruby/sample_adapter_controller.rb +8 -0
- data/spec/apps/rhotestapp/models/js/js_sample.js +55 -0
- data/spec/apps/rhotestapp/models/js/sample2.js +25 -0
- data/spec/apps/rhotestapp/{sources → models/ruby}/base_adapter.rb +0 -0
- data/spec/apps/rhotestapp/{sources → models/ruby}/fixed_schema_adapter.rb +0 -0
- data/spec/apps/rhotestapp/{sources → models/ruby}/other_adapter.rb +0 -0
- data/spec/apps/rhotestapp/{sources → models/ruby}/sample_adapter.rb +0 -0
- data/spec/apps/rhotestapp/{sources → models/ruby}/simple_adapter.rb +2 -2
- data/spec/apps/rhotestapp/{sources → models/ruby}/sub_adapter.rb +0 -0
- data/spec/apps/rhotestapp/settings/settings.yml +0 -1
- data/spec/bulk_data/bulk_data_spec.rb +20 -5
- data/spec/cli/cli_spec.rb +83 -0
- data/spec/client_spec.rb +20 -17
- data/spec/client_sync_spec.rb +244 -406
- data/spec/controllers/js_base_spec.rb +89 -0
- data/spec/doc/doc_spec.rb +18 -18
- data/spec/document_spec.rb +29 -13
- data/spec/dynamic_adapter_spec.rb +6 -6
- data/spec/generator/generator_spec.rb +7 -4
- data/spec/jobs/bulk_data_job_spec.rb +14 -10
- data/spec/jobs/source_job_spec.rb +8 -8
- data/spec/license_spec.rb +5 -2
- data/spec/models/js_model_spec.rb +39 -0
- data/spec/node_spec.rb +42 -0
- data/spec/perf/store_perf_spec.rb +67 -12
- data/spec/ping/android_spec.rb +1 -1
- data/spec/read_state_spec.rb +1 -1
- data/spec/rhoconnect_spec.rb +1 -1
- data/spec/server/cors_spec.rb +14 -18
- data/spec/server/server_spec.rb +265 -88
- data/spec/server/stats_spec.rb +1 -1
- data/spec/source_adapter_spec.rb +54 -27
- data/spec/source_spec.rb +8 -3
- data/spec/source_sync_spec.rb +538 -468
- data/spec/spec_helper.rb +35 -4
- data/spec/stats/record_spec.rb +10 -10
- data/spec/{model_spec.rb → store_orm_spec.rb} +56 -54
- data/spec/store_spec.rb +159 -179
- data/spec/support/shared_examples.rb +36 -27
- data/spec/sync_states_spec.rb +40 -33
- data/spec/test_methods_spec.rb +18 -14
- data/spec/user_spec.rb +17 -30
- metadata +156 -52
- data/bench/benchapp/application.rb +0 -39
- data/bench/blobapp/application.rb +0 -44
- data/commands/rhoconnect/clean_start.rb +0 -9
- data/commands/rhoconnect/create_user.rb +0 -18
- data/commands/rhoconnect/delete_device.rb +0 -9
- data/commands/rhoconnect/delete_user.rb +0 -8
- data/commands/rhoconnect/reset.rb +0 -16
- data/commands/rhoconnect/reset_refresh.rb +0 -11
- data/generators/templates/application/application.rb +0 -43
- data/lib/rhoconnect/client_sync.rb +0 -434
- data/lib/rhoconnect/dynamic_adapter.rb +0 -91
- data/lib/rhoconnect/middleware/admin_user.rb +0 -23
- data/lib/rhoconnect/middleware/current_request.rb +0 -16
- data/lib/rhoconnect/middleware/login_required.rb +0 -22
- data/lib/rhoconnect/source_adapter.rb +0 -132
- data/lib/rhoconnect/source_sync.rb +0 -464
- data/spec/apps/rhotestapp/application.rb +0 -23
data/doc/command-line.txt
CHANGED
@@ -39,10 +39,10 @@ For example:
|
|
39
39
|
[ADDED] storeserver/Rakefile
|
40
40
|
[ADDED] storeserver/Gemfile
|
41
41
|
[ADDED] storeserver/spec/spec_helper.rb
|
42
|
-
|
42
|
+
|
43
43
|
Here's a basic rundown of each of the files that were just generated:
|
44
|
-
|
45
|
-
|
44
|
+
|
45
|
+
|
46
46
|
* **config.ru** - This is a rackup file which will load your application. RhoConnect uses the excellent [sinatra](http://www.sinatrarb.com/) web framework to run the application.
|
47
47
|
* **settings/settings.yml** - This contains settings such as your redis connection, which source adapters exist and their parameters. You can also put custom settings here.
|
48
48
|
* **settings/license.key** - The RhoConnect [license](/rhoconnect/licensing) associated with your application. The default license allows up to 10 devices to synchronize with the application.
|
@@ -67,35 +67,42 @@ rhoconnect, type `rhoconnect` or `rhoconnect help`.
|
|
67
67
|
:::term
|
68
68
|
$ rhoconnect help
|
69
69
|
Tasks:
|
70
|
-
rhoconnect app NAME #
|
70
|
+
rhoconnect app NAME # Generate a new rhoconnect application
|
71
71
|
rhoconnect attach # Attach to rhoconnect console
|
72
|
-
rhoconnect
|
73
|
-
rhoconnect create-user # Creates and subscribes user for application in rhoconnect
|
74
|
-
rhoconnect delete-device # Deletes a device from rhoconnect
|
75
|
-
rhoconnect delete-user # Deletes a user from rhoconnect
|
72
|
+
rhoconnect console [environment] # Run rhoconnect console
|
76
73
|
rhoconnect dtach-about # About dtach
|
77
|
-
rhoconnect dtach-install # Install dtach
|
74
|
+
rhoconnect dtach-install # Install dtach program from sources
|
78
75
|
rhoconnect flushdb # Flush data store - WARNING: THIS REMOVES ALL DATA IN RHOCONNECT
|
79
|
-
rhoconnect get-token #
|
76
|
+
rhoconnect get-token # Fetch current api token from rhoconnect
|
80
77
|
rhoconnect help [TASK] # Describe available tasks or one specific task
|
81
78
|
rhoconnect redis-about # About redis
|
82
79
|
rhoconnect redis-attach # Attach to redis dtach socket
|
83
|
-
rhoconnect redis-download # Download redis
|
84
|
-
rhoconnect redis-install # Install the latest
|
85
|
-
rhoconnect redis-restart # Restart redis
|
86
|
-
rhoconnect redis-start # Start redis
|
87
|
-
rhoconnect redis-
|
88
|
-
rhoconnect
|
89
|
-
rhoconnect
|
90
|
-
rhoconnect restart # Alias for `rhoconnect stop; rhoconnect start`
|
80
|
+
rhoconnect redis-download # Download redis release 2.6.11
|
81
|
+
rhoconnect redis-install # Install the latest verison of Redis from Github (requires git, duh)
|
82
|
+
rhoconnect redis-restart # Restart redis on localhost
|
83
|
+
rhoconnect redis-start # Start redis on localhost
|
84
|
+
rhoconnect redis-status # Show status of redis servers
|
85
|
+
rhoconnect redis-stop # Stop redis running on localhost
|
86
|
+
rhoconnect restart [options] # Alias for `rhoconnect stop; rhoconnect start`
|
91
87
|
rhoconnect secret # Generate a cryptographically secure secret session key
|
92
|
-
rhoconnect set-admin-password #
|
93
|
-
rhoconnect source NAME #
|
94
|
-
rhoconnect
|
95
|
-
rhoconnect start # Start rhoconnect server
|
88
|
+
rhoconnect set-admin-password # Set the admin password
|
89
|
+
rhoconnect source NAME # Generate a new source adapter
|
90
|
+
rhoconnect start [options] # Start rhoconnect server
|
96
91
|
rhoconnect stop # Stop rhoconnect server
|
97
|
-
rhoconnect
|
98
|
-
rhoconnect
|
92
|
+
rhoconnect update # Update an existing application to the latest rhoconnect release
|
93
|
+
rhoconnect version # Display rhoconnect version
|
94
|
+
rhoconnect web # Launch the web console in a browser
|
95
|
+
|
96
|
+
**NOTE: The `rhoconnect war` command is available only if you switch to jruby, such as using the command `rvm use jruby`.**
|
97
|
+
|
98
|
+
`rhoconnect start` and `rhoconnect restart` have the following options.
|
99
|
+
|
100
|
+
-p, [--port=N] # Use port (default: 9292)
|
101
|
+
-r, [--redis=REDIS] # Redis server settings: (default: localhost:6379)
|
102
|
+
-P, [--push-server=PUSH_SERVER] # Push server settings (default: http://someappname@localhost:8675/)
|
103
|
+
-t, [--api-token=API_TOKEN] # API token (default: my-rhoconnect-token)
|
104
|
+
-f, [--config=CONFIG] # /path/to/rhoconnect/settings.yml file
|
105
|
+
-l, [--licenseflie=LICENSEFLIE] # /path/to/license.key file
|
99
106
|
|
100
107
|
### Installing DTach (Mac OS / Linux only)
|
101
108
|
|
@@ -115,6 +122,26 @@ Next, you will need to setup and start a [redis](http://redis.io/) server:
|
|
115
122
|
|
116
123
|
The server will show that it is running on the console.
|
117
124
|
|
125
|
+
### Redis Horizontal Scaling
|
126
|
+
|
127
|
+
Starting from v4.0, RhoConnect supports multiple Redis instances per app.
|
128
|
+
To enable this feature, edit your app `settings/settings.yml` file and replace the `:redis:` configuration
|
129
|
+
with an array of redis servers you are going to use:
|
130
|
+
|
131
|
+
:::yaml
|
132
|
+
# ...
|
133
|
+
:production:
|
134
|
+
:licensefile: settings/license.key
|
135
|
+
:syncserver: http://localhost:9292/api/application/
|
136
|
+
:push_server: http://appname:secret@localhost:8675/
|
137
|
+
# One or more redis servers
|
138
|
+
:redis:
|
139
|
+
- localhost:6379
|
140
|
+
- localhost:6380
|
141
|
+
- localhost:6381
|
142
|
+
- localhost:6382
|
143
|
+
# ...
|
144
|
+
|
118
145
|
### Start the Application
|
119
146
|
|
120
147
|
Open a new console window (since the redis server is running in the previous console window). Then change directories to your rhoconnect application and start the application.
|
@@ -123,25 +150,56 @@ Open a new console window (since the redis server is running in the previous con
|
|
123
150
|
$ cd storeserver
|
124
151
|
$ rhoconnect start
|
125
152
|
|
126
|
-
|
153
|
+
#### Starting RhoConnect without a Source Adapter Application
|
154
|
+
|
155
|
+
You can also start RhoConnect in a directory that does not contain a RhoConnect source adapter application. This is useful for RhoConnect plugin developers, who do not write a RhoConnect source adapter application: they can start a RhoConnect server from an empty directory.
|
156
|
+
|
157
|
+
:::term
|
158
|
+
$ cd (an empty directory)
|
159
|
+
$ rhoconnect start
|
160
|
+
|
161
|
+
When you start RhoConnect in a directory that does not contain a rhoconnect source adapter application, a hidden settings file, .rhoconnect.yml, is created in your user home directory. Here is a partial sample listing.
|
162
|
+
|
163
|
+
:development: &70196107903780
|
164
|
+
:syncserver: http://localhost:9393
|
165
|
+
:redis: localhost:6379
|
166
|
+
:push_server: http://someappname@localhost:8675/
|
167
|
+
:api_token: my-rhoconnect-token
|
168
|
+
:secret: !binary |-
|
169
|
+
...
|
170
|
+
:test: *70196107903780
|
171
|
+
:production: *70196107903780
|
172
|
+
|
173
|
+
Once .rhoconnect.yml has been created in your user home directory, you can manually modify it for the next time you start RhoConnect. For example, you could change the port upon which the syncserver runs.
|
174
|
+
|
175
|
+
Running RhoConnect this way uses the default license key in the RhoConnect gem. You can use other license keys by using the `-l` option in the `rhoconnect start` command.
|
176
|
+
|
177
|
+
#### Opening the Web Console
|
178
|
+
|
179
|
+
If everything went well when you started RhoConnect, you should see the following in your console:
|
180
|
+
|
181
|
+
[03:52:15 PM 2013-03-12] Rhoconnect Server v4.0.0 started...
|
127
182
|
|
128
|
-
[05:47:10 PM 2011-04-19] Rhoconnect Server v3.0.0 started...
|
129
|
-
|
130
183
|
To open the web console, navigate to [http://localhost:9292/](http://localhost:9292) in your browser or run:
|
131
184
|
|
132
185
|
:::term
|
133
186
|
$ rhoconnect web
|
134
|
-
|
187
|
+
|
135
188
|
### Creating executable WAR containers (JRuby environment only)
|
136
189
|
|
137
190
|
It is possible to create Java WAR containers for your Rhoconnect application that can be deployed into the
|
138
|
-
Java App Servers (for example, JBoss). To create the executable WAR container, execute the following command in your app's root directory:
|
139
|
-
|
191
|
+
Java App Servers (for example, Tomcat, JBoss). To create the executable WAR container, execute the following command in your app's root directory:
|
192
|
+
|
140
193
|
:::term
|
141
194
|
$ cd storeserver
|
142
195
|
$ rhoconnect war
|
143
|
-
|
144
|
-
This will build the WAR file named
|
196
|
+
|
197
|
+
This will build the WAR file named `storeserver.war` that can be deployed into the Java App Server. Also warbler package includes
|
198
|
+
an application launcher script, so you can run it standalone on port 8080 in java environment:
|
199
|
+
:::term
|
200
|
+
$ java -jar storeserver.war
|
201
|
+
|
202
|
+
To open the web console, navigate to [http://localhost:8080/](http://localhost:8080) in your browser.
|
145
203
|
|
146
204
|
### Common Tasks
|
147
205
|
|
@@ -149,195 +207,42 @@ RhoConnect applications come with many useful rhoconnect tasks for administrativ
|
|
149
207
|
|
150
208
|
* `rhoconnect dtach-install` - (Mac OS / Linux only) This will install [dtach](http://dtach.sourceforge.net/) to /usr/local/bin.
|
151
209
|
|
152
|
-
* `rhoconnect redis-install` - This will install to the system. On Mac OS / Linux, it will attempt to install in '/usr/local/bin' (on windows, C:\redis-<version>), unless you have specified a REDIS_HOME to use instead.
|
210
|
+
* `rhoconnect redis-install` - This will install to the system. On Mac OS / Linux, it will attempt to install in '/usr/local/bin' (on windows, C:\redis-<version>), unless you have specified a REDIS_HOME to use instead.
|
153
211
|
If you cannot install redis on Linux due to insufficient user permissions, then follows these [instructions](/rhoconnect/install).
|
154
|
-
|
212
|
+
|
155
213
|
* `rhoconnect set-admin-password` - Set the RhoConnect administrator password. The default password is blank ''.
|
156
214
|
|
157
215
|
* `rhoconnect get-token` - Get a RhoConnect API token to use for calling the RhoConnect REST API.
|
158
|
-
|
216
|
+
|
159
217
|
**NOTE: On Mac OS / Linux, you need to install dtach (i.e. by running `rhoconnect dtach-install`) to run the following tasks: **
|
160
218
|
|
161
|
-
* `rhoconnect redis-start` -
|
162
|
-
|
163
|
-
* `rhoconnect redis-stop` - Stop
|
219
|
+
* `rhoconnect redis-start` - Start redis on localhost.
|
220
|
+
|
221
|
+
* `rhoconnect redis-stop` - Stop redis running on localhost.
|
164
222
|
|
165
|
-
*
|
223
|
+
* `rhoconnect redis-status` - Show status of redis servers.
|
224
|
+
|
225
|
+
* `rhoconnect redis-attach` - (Mac OS / Linux only) Attach to a currently-running redis server.
|
166
226
|
|
167
227
|
* `rhoconnect start` - Start the RhoConnect application in a new console. This requires a running redis server.
|
168
228
|
|
169
229
|
* `rhoconnect stop` - Stop the currently-running RhoConnect application.
|
170
|
-
|
171
|
-
* `rhoconnect attach` - (Mac OS / Linux only) Attach to a currently-running RhoConnect application.
|
172
230
|
|
173
|
-
*
|
231
|
+
* `rhoconnect attach` - (Mac OS / Linux only) Attach to a currently-running RhoConnect application.
|
174
232
|
|
175
233
|
Some other useful development tasks:
|
176
234
|
|
177
|
-
* `rhoconnect reset` - Reset the RhoConnect application to the initial state. This WILL DELETE ALL DATA IN REDIS! So be sure you don't run this in production!
|
178
|
-
|
179
235
|
* `rhoconnect spec` - Run all source adapter specs in spec/sources/.
|
180
|
-
|
236
|
+
|
181
237
|
* `rhoconnect web` - Open the RhoConnect web console in a browser.
|
182
238
|
|
183
239
|
## Generate Source
|
184
240
|
|
185
241
|
Connecting to a backend service with RhoConnect requires that you write a small amount of code for the query, create, update and delete operations of your particular enterprise backend. The collection of the code for these operations is called a source. You can create source for your RhoConnect application two ways:
|
186
|
-
|
187
|
-
* [RhoConnect source adapter](/rhoconnect/source-adapters): generate a Ruby code source adapter from RhoStudio or from the command line, similar to how you generate a RhoConnect app. This source adapter contains code for the query, create, update and delete operations.
|
188
|
-
|
189
|
-
* [RhoConnect plugin](/rhoconnect/plugin-intro): write the source code (the query, create, update and delete operations) into your backend application, and plug a RhoConnect plugin in the application. The plugin is written in the language that matchs your backend application, such as Java or .NET.
|
190
|
-
|
191
|
-
## Rake Tasks (Rhoconnect v.3.1 and lower)
|
192
|
-
<span class="label label-important">As of version 4.0 of rhoconnect, rake tasks will be deprecated!!</span>
|
193
|
-
|
194
|
-
Each RhoConnect (v.3.1 and lower) application uses [rake](https://github.com/jimweirich/rake) to manage development tasks such as starting/stopping the app, starting resque workers, and running specs.
|
195
242
|
|
196
|
-
|
243
|
+
* [RhoConnect source adapter](/rhoconnect/source-adapters): generate a Ruby code source adapter from RhoStudio or from the command line, similar to how you generate a RhoConnect app. This source adapter contains code for the query, create, update and delete operations.
|
197
244
|
|
198
|
-
|
245
|
+
* [RhoConnect plugin](/rhoconnect/plugin-intro): write the source code (the query, create, update and delete operations) into your backend application, and plug a RhoConnect plugin in the application. The plugin is written in the language that matchs your backend application, such as Java or .NET.
|
199
246
|
|
200
|
-
|
201
|
-
|
202
|
-
$ rake -T
|
203
|
-
(in ~/storeserver)
|
204
|
-
rake dtach:about # About dtach
|
205
|
-
rake dtach:install # Install dtach 0.8 from source
|
206
|
-
rake redis:about # About redis
|
207
|
-
rake redis:attach # Attach to redis dtach socket
|
208
|
-
rake redis:download # Download package
|
209
|
-
rake redis:install # Install the latest version of Redis from Github (requires git, duh)
|
210
|
-
rake redis:restart # Restart redis
|
211
|
-
rake redis:start # Start redis
|
212
|
-
rake redis:stop # Stop redis
|
213
|
-
rake resque:work # Start a Resque worker
|
214
|
-
rake resque:workers # Start multiple Resque workers.
|
215
|
-
rake rhoconnect:attach # Attach to rhoconnect console
|
216
|
-
rake rhoconnect:clean_start # Clean rhoconnect, get token, and create new user
|
217
|
-
rake rhoconnect:create_user # Creates and subscribes user for application in rhoconnect
|
218
|
-
rake rhoconnect:delete_device # Deletes a device from rhoconnect
|
219
|
-
rake rhoconnect:delete_user # Deletes a user from rhoconnect
|
220
|
-
rake rhoconnect:flushdb # Flush data store - WARNING: THIS REMOVES ALL DATA IN RHOCONNECT
|
221
|
-
rake rhoconnect:get_token # Fetches current api token from rhoconnect
|
222
|
-
rake rhoconnect:reset # Reset the rhoconnect database (you will need to run rhoconnect:get_token afterwards)
|
223
|
-
rake rhoconnect:reset_refresh # Reset source refresh time
|
224
|
-
rake rhoconnect:restart # Alias for `rake rhoconnect:stop; rake rhoconnect:start`
|
225
|
-
rake rhoconnect:set_admin_password # Sets the admin password
|
226
|
-
rake rhoconnect:spec # Run source adapter specs
|
227
|
-
rake rhoconnect:start # Start rhoconnect server
|
228
|
-
rake rhoconnect:stop # Stop rhoconnect server
|
229
|
-
rake rhoconnect:war # Build executable WAR file to be used in Java App Servers
|
230
|
-
rake rhoconnect:web # Launch the web console in a browser - uses :syncserver: in settings.yml
|
231
|
-
|
232
|
-
Below is provided a list of rake tasks and their corresponding RhoConnect v.3.2+ command.
|
233
|
-
|
234
|
-
<table border="1", cellpadding="5", width="100%">
|
235
|
-
<tr>
|
236
|
-
<th>rake Command</th>
|
237
|
-
<th>rhoconnect command</th>
|
238
|
-
</tr>
|
239
|
-
<tr>
|
240
|
-
<td>rake -T</td>
|
241
|
-
<td>rhoconnect help</td>
|
242
|
-
</tr>
|
243
|
-
<tr>
|
244
|
-
<td>rake rhoconnect:attach</td>
|
245
|
-
<td>rhoconnect attach</td>
|
246
|
-
</tr>
|
247
|
-
<tr>
|
248
|
-
<td>rake rhoconnect:clean_start</td>
|
249
|
-
<td>rhoconnect clean-start</td>
|
250
|
-
</tr>
|
251
|
-
<tr>
|
252
|
-
<td>rake rhoconnect:reate_user</td>
|
253
|
-
<td>rhoconnect create-user</td>
|
254
|
-
</tr>
|
255
|
-
<tr>
|
256
|
-
<td>rake rhoconnect:delete_device</td>
|
257
|
-
<td>rhoconnect delete-device</td>
|
258
|
-
</tr>
|
259
|
-
<tr>
|
260
|
-
<td>rake rhoconnect:delete_user</td>
|
261
|
-
<td>rhoconnect delete-user</td>
|
262
|
-
</tr>
|
263
|
-
<tr>
|
264
|
-
<td>rake rhoconnect:flushdb</td>
|
265
|
-
<td>rhoconnect flushdb</td>
|
266
|
-
</tr>
|
267
|
-
<tr>
|
268
|
-
<td>rake rhoconnect:get_token</td>
|
269
|
-
<td>rhoconnect get-token</td>
|
270
|
-
</tr>
|
271
|
-
<tr>
|
272
|
-
<td>rake rhoconnect:reset</td>
|
273
|
-
<td>rhoconnect reset</td>
|
274
|
-
</tr>
|
275
|
-
<tr>
|
276
|
-
<td>rake rhoconnect:reset_refresh</td>
|
277
|
-
<td>rhoconnect reset-refresh</td>
|
278
|
-
</tr>
|
279
|
-
<tr>
|
280
|
-
<td>rake rhoconnect:restart</td>
|
281
|
-
<td>rhoconnect restart</td>
|
282
|
-
</tr>
|
283
|
-
<tr>
|
284
|
-
<td>rake rhoconnect:set_admin_password</td>
|
285
|
-
<td>rhoconnect set-admin-password</td>
|
286
|
-
</tr>
|
287
|
-
<tr>
|
288
|
-
<td>rake rhoconnect:spec</td>
|
289
|
-
<td>rhoconnect spec</td>
|
290
|
-
</tr>
|
291
|
-
<tr>
|
292
|
-
<td>rake rhoconnect:start</td>
|
293
|
-
<td>rhoconnect start</td>
|
294
|
-
</tr>
|
295
|
-
<tr>
|
296
|
-
<td>rake rhoconnect:stop</td>
|
297
|
-
<td>rhoconnect stop</td>
|
298
|
-
</tr>
|
299
|
-
<tr>
|
300
|
-
<td>rake rhoconnect:war</td>
|
301
|
-
<td>rhoconnect war</td>
|
302
|
-
</tr>
|
303
|
-
<tr>
|
304
|
-
<td>rake rhoconnect:web</td>
|
305
|
-
<td>rhoconnect web</td>
|
306
|
-
</tr>
|
307
|
-
<tr>
|
308
|
-
<td>rake dtach:about</td>
|
309
|
-
<td>rhoconnect dtach-about</td>
|
310
|
-
</tr>
|
311
|
-
<tr>
|
312
|
-
<td>rake dtach:install</td>
|
313
|
-
<td>rhoconnect dtach-install</td>
|
314
|
-
</tr>
|
315
|
-
<tr>
|
316
|
-
<td>rake redis:about</td>
|
317
|
-
<td>rhoconnect redis-about</td>
|
318
|
-
</tr>
|
319
|
-
<tr>
|
320
|
-
<td>rake redis:attach</td>
|
321
|
-
<td>rhoconnect redis-attach</td>
|
322
|
-
</tr>
|
323
|
-
<tr>
|
324
|
-
<td>rake redis:download</td>
|
325
|
-
<td>rhoconnect redis-download</td>
|
326
|
-
</tr>
|
327
|
-
<tr>
|
328
|
-
<td>rake redis:install</td>
|
329
|
-
<td>rhoconnect redis-install</td>
|
330
|
-
</tr>
|
331
|
-
<tr>
|
332
|
-
<td>rake redis:restart</td>
|
333
|
-
<td>rhoconnect redis-restart</td>
|
334
|
-
</tr>
|
335
|
-
<tr>
|
336
|
-
<td>rake redis:start</td>
|
337
|
-
<td>rhoconnect redis-start</td>
|
338
|
-
</tr>
|
339
|
-
<tr>
|
340
|
-
<td>rake redis:stop</td>
|
341
|
-
<td>rhoconnect redis-stop</td>
|
342
|
-
</tr>
|
343
|
-
</table>
|
247
|
+
## Rake Tasks (Removed)
|
248
|
+
<span class="label label-important">As of version 4.0, the rhoconnect rake tasks have been removed. You can use `rhoconnect --help` to see the list of available rhoconnect commands.</span>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
Data Partitioning & Pass-Through
|
2
|
+
===
|
3
|
+
|
4
|
+
## Data Partitioning
|
5
|
+
|
6
|
+
Data is stored in RhoConnect using [redis sets](http://redis.io/commands#set). The `@result` hash from the `query` method is stored in redis and referred to as the Master Document or MD.
|
7
|
+
|
8
|
+
The MD is referenced in RhoConnect by a corresponding partition. Source adapters can partition data in two ways: user and app. As you might have guessed, user partitioning stores a copy of the source adapter MD for each user (one copy shared across all devices for a given user).
|
9
|
+
|
10
|
+
Likewise, app partitioning stores one copy of the source adapter MD for the entire application (all users and devices share the same data). App partitioning can be particularly useful if you have source adapter models which retrieve large amounts of data that is fixed from user to user, for example a global product catalog. Using app partitioning wherever possible ***greatly reduces*** the amount of data in redis.
|
11
|
+
|
12
|
+
### User Partition
|
13
|
+
User partitioning is the default mode for source adapters, however you can explicitly define it in `settings/settings.yml` with:
|
14
|
+
|
15
|
+
:::yaml
|
16
|
+
:sources:
|
17
|
+
Product:
|
18
|
+
:poll_interval: 300
|
19
|
+
:partition_type: user
|
20
|
+
|
21
|
+
### App Partition
|
22
|
+
Enable app partitioning the same way:
|
23
|
+
|
24
|
+
:::yaml
|
25
|
+
:sources:
|
26
|
+
Product:
|
27
|
+
:poll_interval: 300
|
28
|
+
:partition_type: app
|
29
|
+
|
30
|
+
Now you have a single copy of the `Product` source adapter dataset for all users.
|
31
|
+
|
32
|
+
## Pass Through
|
33
|
+
RhoConnect provides a simple way to keep data out of redis. If you have sensitive data that you do not want saved in redis, add the `pass_through` option in settings/settings.yml for each source:
|
34
|
+
|
35
|
+
:::yaml
|
36
|
+
:sources:
|
37
|
+
Product:
|
38
|
+
:pass_through: true
|
39
|
+
|
40
|
+
**NOTE: When running query or search the entire data set will be returned from your backend service. **
|