neo4j-ruby-driver 5.7.0.alpha.4 → 6.0.3.alpha.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +440 -40
- data/jruby/neo4j/driver/ext/async_converter.rb +55 -0
- data/jruby/neo4j/driver/ext/auth_tokens.rb +20 -0
- data/jruby/neo4j/driver/ext/config_converter.rb +83 -0
- data/jruby/neo4j/driver/ext/exception_checkable.rb +34 -0
- data/jruby/neo4j/driver/ext/exception_mapper.rb +92 -0
- data/jruby/neo4j/driver/ext/graph_database.rb +33 -0
- data/jruby/neo4j/driver/ext/internal/abstract_query_runner.rb +18 -0
- data/jruby/neo4j/driver/ext/internal/async/internal_async_session.rb +23 -0
- data/jruby/neo4j/driver/ext/internal/cluster/routing_table_registry_impl.rb +15 -0
- data/jruby/neo4j/driver/ext/internal/cursor/disposable_async_result_cursor.rb +15 -0
- data/jruby/neo4j/driver/ext/internal/driver_factory.rb +24 -0
- data/jruby/neo4j/driver/ext/internal/eager_result_value.rb +17 -0
- data/jruby/neo4j/driver/ext/internal/metrics/internal_connection_pool_metrics.rb +17 -0
- data/jruby/neo4j/driver/ext/internal/summary/internal_notification.rb +27 -0
- data/jruby/neo4j/driver/ext/internal/summary/internal_plan.rb +26 -0
- data/jruby/neo4j/driver/ext/internal/summary/internal_result_summary.rb +34 -0
- data/jruby/neo4j/driver/ext/internal_driver.rb +52 -0
- data/jruby/neo4j/driver/ext/internal_entity.rb +21 -0
- data/jruby/neo4j/driver/ext/internal_keys.rb +15 -0
- data/jruby/neo4j/driver/ext/internal_node.rb +13 -0
- data/jruby/neo4j/driver/ext/internal_record.rb +29 -0
- data/jruby/neo4j/driver/ext/internal_relationship.rb +13 -0
- data/jruby/neo4j/driver/ext/internal_result.rb +27 -0
- data/jruby/neo4j/driver/ext/internal_session.rb +44 -0
- data/jruby/neo4j/driver/ext/internal_transaction.rb +19 -0
- data/jruby/neo4j/driver/ext/logger.rb +60 -0
- data/jruby/neo4j/driver/ext/map_converter.rb +14 -0
- data/jruby/neo4j/driver/ext/neo_converter.rb +59 -0
- data/jruby/neo4j/driver/ext/query.rb +13 -0
- data/jruby/neo4j/driver/ext/ruby_converter.rb +57 -0
- data/jruby/neo4j/driver/ext/run_override.rb +22 -0
- data/jruby/neo4j/driver/ext/start_end_naming.rb +17 -0
- data/{ruby → jruby}/neo4j/driver/version.rb +1 -1
- data/jruby/neo4j/driver.rb +62 -0
- data/lib/neo4j/driver/{auto_closable.rb → auto_closeable.rb} +6 -6
- data/lib/neo4j/driver/exceptions/neo4j_exception.rb +6 -6
- data/lib/neo4j/driver/internal/deprecator.rb +15 -0
- metadata +91 -277
- data/ruby/neo4j/driver/access_mode.rb +0 -10
- data/ruby/neo4j/driver/auth_tokens.rb +0 -34
- data/ruby/neo4j/driver/bookmark.rb +0 -21
- data/ruby/neo4j/driver/config.rb +0 -89
- data/ruby/neo4j/driver/graph_database.rb +0 -78
- data/ruby/neo4j/driver/internal/async/connection/bolt_protocol_util.rb +0 -51
- data/ruby/neo4j/driver/internal/async/connection/bootstrap_factory.rb +0 -22
- data/ruby/neo4j/driver/internal/async/connection/channel_attributes.rb +0 -31
- data/ruby/neo4j/driver/internal/async/connection/channel_connected_listener.rb +0 -32
- data/ruby/neo4j/driver/internal/async/connection/channel_connector_impl.rb +0 -83
- data/ruby/neo4j/driver/internal/async/connection/channel_pipeline_builder_impl.rb +0 -22
- data/ruby/neo4j/driver/internal/async/connection/direct_connection.rb +0 -30
- data/ruby/neo4j/driver/internal/async/connection/event_loop_group_factory.rb +0 -83
- data/ruby/neo4j/driver/internal/async/connection/handshake_completed_listener.rb +0 -27
- data/ruby/neo4j/driver/internal/async/connection/handshake_handler.rb +0 -113
- data/ruby/neo4j/driver/internal/async/connection/netty_channel_initializer.rb +0 -57
- data/ruby/neo4j/driver/internal/async/connection/netty_domain_name_resolver.rb +0 -26
- data/ruby/neo4j/driver/internal/async/connection/netty_domain_name_resolver_group.rb +0 -19
- data/ruby/neo4j/driver/internal/async/connection/routing_connection.rb +0 -36
- data/ruby/neo4j/driver/internal/async/connection/stream.rb +0 -12
- data/ruby/neo4j/driver/internal/async/connection/stream_reader.rb +0 -16
- data/ruby/neo4j/driver/internal/async/connection_context.rb +0 -10
- data/ruby/neo4j/driver/internal/async/immutable_connection_context.rb +0 -24
- data/ruby/neo4j/driver/internal/async/inbound/byte_buf_input.rb +0 -30
- data/ruby/neo4j/driver/internal/async/inbound/channel_error_handler.rb +0 -77
- data/ruby/neo4j/driver/internal/async/inbound/chunk_decoder.rb +0 -41
- data/ruby/neo4j/driver/internal/async/inbound/connect_timeout_handler.rb +0 -32
- data/ruby/neo4j/driver/internal/async/inbound/connection_read_timeout_handler.rb +0 -17
- data/ruby/neo4j/driver/internal/async/inbound/inbound_message_dispatcher.rb +0 -171
- data/ruby/neo4j/driver/internal/async/inbound/inbound_message_handler.rb +0 -42
- data/ruby/neo4j/driver/internal/async/inbound/message_decoder.rb +0 -51
- data/ruby/neo4j/driver/internal/async/internal_async_session.rb +0 -98
- data/ruby/neo4j/driver/internal/async/internal_async_transaction.rb +0 -13
- data/ruby/neo4j/driver/internal/async/leak_logging_network_session.rb +0 -34
- data/ruby/neo4j/driver/internal/async/network_connection.rb +0 -194
- data/ruby/neo4j/driver/internal/async/network_session.rb +0 -150
- data/ruby/neo4j/driver/internal/async/outbound/chunk_aware_byte_buf_output.rb +0 -110
- data/ruby/neo4j/driver/internal/async/outbound/outbound_message_handler.rb +0 -39
- data/ruby/neo4j/driver/internal/async/pool/channel.rb +0 -66
- data/ruby/neo4j/driver/internal/async/pool/channel_pool.rb +0 -31
- data/ruby/neo4j/driver/internal/async/pool/channel_tracker.rb +0 -135
- data/ruby/neo4j/driver/internal/async/pool/connection_pool_impl.rb +0 -156
- data/ruby/neo4j/driver/internal/async/pool/netty_channel_health_checker.rb +0 -87
- data/ruby/neo4j/driver/internal/async/pool/netty_channel_pool.rb +0 -52
- data/ruby/neo4j/driver/internal/async/pool/network_connection_factory.rb +0 -21
- data/ruby/neo4j/driver/internal/async/pool/pool_settings.rb +0 -34
- data/ruby/neo4j/driver/internal/async/pool/timed_stack.rb +0 -15
- data/ruby/neo4j/driver/internal/async/result_cursors_holder.rb +0 -17
- data/ruby/neo4j/driver/internal/async/unmanaged_transaction.rb +0 -212
- data/ruby/neo4j/driver/internal/bookmark_holder.rb +0 -9
- data/ruby/neo4j/driver/internal/cluster/cluster_composition.rb +0 -48
- data/ruby/neo4j/driver/internal/cluster/cluster_composition_lookup_result.rb +0 -14
- data/ruby/neo4j/driver/internal/cluster/cluster_routing_table.rb +0 -122
- data/ruby/neo4j/driver/internal/cluster/identity_resolver.rb +0 -10
- data/ruby/neo4j/driver/internal/cluster/loadbalancing/least_connected_load_balancing_strategy.rb +0 -68
- data/ruby/neo4j/driver/internal/cluster/loadbalancing/load_balancer.rb +0 -125
- data/ruby/neo4j/driver/internal/cluster/loadbalancing/round_robin_array_index.rb +0 -13
- data/ruby/neo4j/driver/internal/cluster/multi_databases_routing_procedure_runner.rb +0 -31
- data/ruby/neo4j/driver/internal/cluster/rediscovery_impl.rb +0 -147
- data/ruby/neo4j/driver/internal/cluster/route_message_routing_procedure_runner.rb +0 -43
- data/ruby/neo4j/driver/internal/cluster/routing_context.rb +0 -77
- data/ruby/neo4j/driver/internal/cluster/routing_procedure_cluster_composition_provider.rb +0 -60
- data/ruby/neo4j/driver/internal/cluster/routing_procedure_response.rb +0 -35
- data/ruby/neo4j/driver/internal/cluster/routing_settings.rb +0 -24
- data/ruby/neo4j/driver/internal/cluster/routing_table_handler_impl.rb +0 -95
- data/ruby/neo4j/driver/internal/cluster/routing_table_registry_impl.rb +0 -121
- data/ruby/neo4j/driver/internal/cluster/single_database_routing_procedure_runner.rb +0 -73
- data/ruby/neo4j/driver/internal/connection_settings.rb +0 -16
- data/ruby/neo4j/driver/internal/cursor/async_result_cursor_impl.rb +0 -55
- data/ruby/neo4j/driver/internal/cursor/async_result_cursor_only_factory.rb +0 -24
- data/ruby/neo4j/driver/internal/cursor/disposable_async_result_cursor.rb +0 -61
- data/ruby/neo4j/driver/internal/cursor/result_cursor_factory_impl.rb +0 -24
- data/ruby/neo4j/driver/internal/cursor/rx_result_cursor_impl.rb +0 -110
- data/ruby/neo4j/driver/internal/database_name_util.rb +0 -37
- data/ruby/neo4j/driver/internal/default_bookmark_holder.rb +0 -9
- data/ruby/neo4j/driver/internal/default_domain_name_resolver.rb +0 -11
- data/ruby/neo4j/driver/internal/direct_connection_provider.rb +0 -40
- data/ruby/neo4j/driver/internal/driver_factory.rb +0 -126
- data/ruby/neo4j/driver/internal/handlers/begin_tx_response_handler.rb +0 -20
- data/ruby/neo4j/driver/internal/handlers/channel_releasing_reset_response_handler.rb +0 -30
- data/ruby/neo4j/driver/internal/handlers/commit_tx_response_handler.rb +0 -25
- data/ruby/neo4j/driver/internal/handlers/hello_response_handler.rb +0 -65
- data/ruby/neo4j/driver/internal/handlers/init_response_handler.rb +0 -34
- data/ruby/neo4j/driver/internal/handlers/legacy_pull_all_response_handler.rb +0 -199
- data/ruby/neo4j/driver/internal/handlers/no_op_response_handler.rb +0 -16
- data/ruby/neo4j/driver/internal/handlers/ping_response_handler.rb +0 -29
- data/ruby/neo4j/driver/internal/handlers/pull_handlers.rb +0 -32
- data/ruby/neo4j/driver/internal/handlers/pulln/auto_pull_response_handler.rb +0 -168
- data/ruby/neo4j/driver/internal/handlers/pulln/basic_pull_response_handler.rb +0 -298
- data/ruby/neo4j/driver/internal/handlers/pulln/fetch_size_util.rb +0 -20
- data/ruby/neo4j/driver/internal/handlers/reset_response_handler.rb +0 -34
- data/ruby/neo4j/driver/internal/handlers/rollback_tx_response_handler.rb +0 -25
- data/ruby/neo4j/driver/internal/handlers/route_message_response_handler.rb +0 -21
- data/ruby/neo4j/driver/internal/handlers/routing_response_handler.rb +0 -70
- data/ruby/neo4j/driver/internal/handlers/run_response_handler.rb +0 -38
- data/ruby/neo4j/driver/internal/handlers/session_pull_response_completion_listener.rb +0 -34
- data/ruby/neo4j/driver/internal/handlers/transaction_pull_response_completion_listener.rb +0 -20
- data/ruby/neo4j/driver/internal/impersonation_util.rb +0 -22
- data/ruby/neo4j/driver/internal/internal_bookmark.rb +0 -36
- data/ruby/neo4j/driver/internal/internal_database_name.rb +0 -9
- data/ruby/neo4j/driver/internal/internal_driver.rb +0 -74
- data/ruby/neo4j/driver/internal/internal_entity.rb +0 -21
- data/ruby/neo4j/driver/internal/internal_node.rb +0 -21
- data/ruby/neo4j/driver/internal/internal_pair.rb +0 -9
- data/ruby/neo4j/driver/internal/internal_path.rb +0 -35
- data/ruby/neo4j/driver/internal/internal_point2_d.rb +0 -9
- data/ruby/neo4j/driver/internal/internal_point3_d.rb +0 -6
- data/ruby/neo4j/driver/internal/internal_record.rb +0 -27
- data/ruby/neo4j/driver/internal/internal_relationship.rb +0 -27
- data/ruby/neo4j/driver/internal/internal_result.rb +0 -49
- data/ruby/neo4j/driver/internal/internal_session.rb +0 -81
- data/ruby/neo4j/driver/internal/internal_transaction.rb +0 -48
- data/ruby/neo4j/driver/internal/logging/channel_activity_logger.rb +0 -29
- data/ruby/neo4j/driver/internal/logging/channel_error_logger.rb +0 -17
- data/ruby/neo4j/driver/internal/logging/prefixed_logger.rb +0 -19
- data/ruby/neo4j/driver/internal/logging/reformatted_logger.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/abstract_message_writer.rb +0 -23
- data/ruby/neo4j/driver/internal/messaging/bolt_protocol.rb +0 -32
- data/ruby/neo4j/driver/internal/messaging/bolt_protocol_version.rb +0 -48
- data/ruby/neo4j/driver/internal/messaging/common/common_message_reader.rb +0 -51
- data/ruby/neo4j/driver/internal/messaging/common/common_value.rb +0 -33
- data/ruby/neo4j/driver/internal/messaging/common/common_value_packer.rb +0 -104
- data/ruby/neo4j/driver/internal/messaging/common/common_value_unpacker.rb +0 -256
- data/ruby/neo4j/driver/internal/messaging/encode/begin_message_encoder.rb +0 -15
- data/ruby/neo4j/driver/internal/messaging/encode/commit_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/discard_all_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/discard_message_encoder.rb +0 -15
- data/ruby/neo4j/driver/internal/messaging/encode/goodbye_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/hello_message_encoder.rb +0 -15
- data/ruby/neo4j/driver/internal/messaging/encode/init_message_encoder.rb +0 -16
- data/ruby/neo4j/driver/internal/messaging/encode/logoff_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/logon_message_encoder.rb +0 -15
- data/ruby/neo4j/driver/internal/messaging/encode/pull_all_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/pull_message_encoder.rb +0 -15
- data/ruby/neo4j/driver/internal/messaging/encode/reset_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/rollback_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/route_message_encoder.rb +0 -24
- data/ruby/neo4j/driver/internal/messaging/encode/route_v44_message_encoder.rb +0 -22
- data/ruby/neo4j/driver/internal/messaging/encode/run_message_encoder.rb +0 -16
- data/ruby/neo4j/driver/internal/messaging/encode/run_with_metadata_message_encoder.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/request/abstract_streaming_message.rb +0 -25
- data/ruby/neo4j/driver/internal/messaging/request/begin_message.rb +0 -25
- data/ruby/neo4j/driver/internal/messaging/request/commit_message.rb +0 -20
- data/ruby/neo4j/driver/internal/messaging/request/discard_all_message.rb +0 -20
- data/ruby/neo4j/driver/internal/messaging/request/discard_message.rb +0 -23
- data/ruby/neo4j/driver/internal/messaging/request/goodbye_message.rb +0 -20
- data/ruby/neo4j/driver/internal/messaging/request/hello_message.rb +0 -30
- data/ruby/neo4j/driver/internal/messaging/request/init_message.rb +0 -19
- data/ruby/neo4j/driver/internal/messaging/request/logoff_message.rb +0 -13
- data/ruby/neo4j/driver/internal/messaging/request/logon_message.rb +0 -13
- data/ruby/neo4j/driver/internal/messaging/request/message_with_metadata.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/request/multi_database_util.rb +0 -26
- data/ruby/neo4j/driver/internal/messaging/request/pull_all_message.rb +0 -23
- data/ruby/neo4j/driver/internal/messaging/request/pull_message.rb +0 -22
- data/ruby/neo4j/driver/internal/messaging/request/reset_message.rb +0 -32
- data/ruby/neo4j/driver/internal/messaging/request/rollback_message.rb +0 -20
- data/ruby/neo4j/driver/internal/messaging/request/route_message.rb +0 -28
- data/ruby/neo4j/driver/internal/messaging/request/run_message.rb +0 -23
- data/ruby/neo4j/driver/internal/messaging/request/run_with_metadata_message.rb +0 -49
- data/ruby/neo4j/driver/internal/messaging/request/transaction_metadata_builder.rb +0 -24
- data/ruby/neo4j/driver/internal/messaging/response/failure_message.rb +0 -40
- data/ruby/neo4j/driver/internal/messaging/response/ignored_message.rb +0 -29
- data/ruby/neo4j/driver/internal/messaging/response/record_message.rb +0 -33
- data/ruby/neo4j/driver/internal/messaging/response/success_message.rb +0 -34
- data/ruby/neo4j/driver/internal/messaging/v3/bolt_protocol_v3.rb +0 -82
- data/ruby/neo4j/driver/internal/messaging/v3/message_format_v3.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/v3/message_writer_v3.rb +0 -27
- data/ruby/neo4j/driver/internal/messaging/v4/bolt_protocol_v4.rb +0 -29
- data/ruby/neo4j/driver/internal/messaging/v4/message_format_v4.rb +0 -13
- data/ruby/neo4j/driver/internal/messaging/v4/message_writer_v4.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/v41/bolt_protocol_v41.rb +0 -25
- data/ruby/neo4j/driver/internal/messaging/v42/bolt_protocol_v42.rb +0 -13
- data/ruby/neo4j/driver/internal/messaging/v43/bolt_protocol_v43.rb +0 -19
- data/ruby/neo4j/driver/internal/messaging/v43/message_format_v43.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/v43/message_writer_v43.rb +0 -20
- data/ruby/neo4j/driver/internal/messaging/v44/bolt_protocol_v44.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/v44/message_format_v44.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/v44/message_writer_v44.rb +0 -15
- data/ruby/neo4j/driver/internal/messaging/v5/bolt_protocol_v5.rb +0 -21
- data/ruby/neo4j/driver/internal/messaging/v5/message_format_v5.rb +0 -18
- data/ruby/neo4j/driver/internal/messaging/v5/value_unpacker_v5.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/v51/bolt_protocol_v51.rb +0 -40
- data/ruby/neo4j/driver/internal/messaging/v51/message_format_v51.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/v51/message_writer_v51.rb +0 -17
- data/ruby/neo4j/driver/internal/metrics/connection_pool_metrics_listener.rb +0 -34
- data/ruby/neo4j/driver/internal/metrics/internal_abstract_metrics.rb +0 -46
- data/ruby/neo4j/driver/internal/metrics/internal_connection_pool_metrics.rb +0 -105
- data/ruby/neo4j/driver/internal/metrics/internal_metrics.rb +0 -82
- data/ruby/neo4j/driver/internal/metrics/internal_metrics_provider.rb +0 -18
- data/ruby/neo4j/driver/internal/metrics/listener_event.rb +0 -17
- data/ruby/neo4j/driver/internal/metrics/metrics_provider.rb +0 -24
- data/ruby/neo4j/driver/internal/metrics/time_recorder_listener_event.rb +0 -15
- data/ruby/neo4j/driver/internal/packstream/byte_array_incompatible_packer.rb +0 -12
- data/ruby/neo4j/driver/internal/packstream/pack_input.rb +0 -47
- data/ruby/neo4j/driver/internal/packstream/pack_output.rb +0 -39
- data/ruby/neo4j/driver/internal/packstream/pack_stream.rb +0 -326
- data/ruby/neo4j/driver/internal/packstream/pack_type.rb +0 -17
- data/ruby/neo4j/driver/internal/read_only_bookmark_holder.rb +0 -13
- data/ruby/neo4j/driver/internal/resolved_bolt_server_address.rb +0 -35
- data/ruby/neo4j/driver/internal/retry/exponential_backoff_retry_logic.rb +0 -151
- data/ruby/neo4j/driver/internal/revocation_strategy.rb +0 -19
- data/ruby/neo4j/driver/internal/scheme.rb +0 -32
- data/ruby/neo4j/driver/internal/security/internal_auth_token.rb +0 -15
- data/ruby/neo4j/driver/internal/security/security_plan_impl.rb +0 -48
- data/ruby/neo4j/driver/internal/security_setting.rb +0 -66
- data/ruby/neo4j/driver/internal/session_factory_impl.rb +0 -32
- data/ruby/neo4j/driver/internal/spi/connection.rb +0 -19
- data/ruby/neo4j/driver/internal/spi/connection_pool.rb +0 -9
- data/ruby/neo4j/driver/internal/spi/response_handler.rb +0 -23
- data/ruby/neo4j/driver/internal/summary/internal_database_info.rb +0 -7
- data/ruby/neo4j/driver/internal/summary/internal_input_position.rb +0 -11
- data/ruby/neo4j/driver/internal/summary/internal_notification.rb +0 -16
- data/ruby/neo4j/driver/internal/summary/internal_plan.rb +0 -41
- data/ruby/neo4j/driver/internal/summary/internal_profiled_plan.rb +0 -32
- data/ruby/neo4j/driver/internal/summary/internal_result_summary.rb +0 -33
- data/ruby/neo4j/driver/internal/summary/internal_server_info.rb +0 -6
- data/ruby/neo4j/driver/internal/summary/internal_summary_counters.rb +0 -18
- data/ruby/neo4j/driver/internal/svm/netty_substitutions.rb +0 -196
- data/ruby/neo4j/driver/internal/svm/z_lib_substitutions.rb +0 -21
- data/ruby/neo4j/driver/internal/util/certificate_tool.rb +0 -65
- data/ruby/neo4j/driver/internal/util/clock.rb +0 -29
- data/ruby/neo4j/driver/internal/util/error_util.rb +0 -104
- data/ruby/neo4j/driver/internal/util/extract.rb +0 -123
- data/ruby/neo4j/driver/internal/util/format.rb +0 -39
- data/ruby/neo4j/driver/internal/util/futures.rb +0 -99
- data/ruby/neo4j/driver/internal/util/iterables.rb +0 -35
- data/ruby/neo4j/driver/internal/util/lock_util.rb +0 -23
- data/ruby/neo4j/driver/internal/util/metadata_extractor.rb +0 -107
- data/ruby/neo4j/driver/internal/util/mutex.rb +0 -9
- data/ruby/neo4j/driver/internal/util/preconditions.rb +0 -16
- data/ruby/neo4j/driver/internal/util/result_holder.rb +0 -72
- data/ruby/neo4j/driver/internal/util/server_version.rb +0 -60
- data/ruby/neo4j/driver/logging1.rb +0 -51
- data/ruby/neo4j/driver/net/server_address.rb +0 -9
- data/ruby/neo4j/driver/query.rb +0 -48
- data/ruby/neo4j/driver/records.rb +0 -13
- data/ruby/neo4j/driver/transaction_config.rb +0 -50
- data/ruby/neo4j/driver/values.rb +0 -26
- data/ruby/neo4j/driver.rb +0 -28
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Svm
|
|
4
|
-
# This substitution avoid having loggers added to the build
|
|
5
|
-
class Target_io_netty_util_internal_logging_InternalLoggerFactory
|
|
6
|
-
def self.new_default_factory(name)
|
|
7
|
-
org.neo4j.driver.internal.shaded.io.netty.util.internal.logging.JdkLoggerFactory::INSTANCE
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
# SSL
|
|
11
|
-
# This whole section is mostly about removing static analysis references to openssl/tcnative
|
|
12
|
-
class Target_io_netty_handler_ssl_JdkSslServerContext
|
|
13
|
-
def initialize(provider, trust_cert_collection, trust_manager_factory, key_cert_chain, key, key_password,
|
|
14
|
-
key_manager_factory, ciphers, cipher_filter, apn, session_cache_size, session_timeout, client_auth,
|
|
15
|
-
protocols, start_tls, key_store)
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
class Target_io_netty_handler_ssl_JdkSslClientContext
|
|
20
|
-
def initialize(ssl_context_provider, trust_cert_collection, trust_manager_factory, key_cert_chain, key, key_password,
|
|
21
|
-
key_manager_factory, ciphers, cipher_filter, apn, protocols, session_cache_size, session_timeout,
|
|
22
|
-
key_store_type)
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
class Target_io_netty_handler_ssl_SslHandler
|
|
27
|
-
JDK = nil
|
|
28
|
-
def for_engine
|
|
29
|
-
JDK
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
class Target_io_netty_handler_ssl_JdkAlpnApplicationProtocolNegotiator_AlpnWrapper
|
|
34
|
-
def wrap_ssl_engine(engine, alloc, application_negotiator, server)
|
|
35
|
-
Target_io_netty_handler_ssl_JdkAlpnSslEngine.new(engine, application_negotiator, server)
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def Target_io_netty_handler_ssl_JdkAlpnApplicationProtocolNegotiator_AlpnWrapperJava8
|
|
40
|
-
def wrap_ssl_engine(engine, alloc, application_negotiator, server)
|
|
41
|
-
if Target_io_netty_handler_ssl_JettyAlpnSslEngine.available?
|
|
42
|
-
return server ? Target_io_netty_handler_ssl_JettyAlpnSslEngine.new_server_engine(engine, application_negotiator) : Target_io_netty_handler_ssl_JettyAlpnSslEngine.new_client_engine(engine, application_negotiator)
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
raise RuntimeError, "Unable to wrap SSLEngine of type #{engine.class.name}"
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
class Target_io_netty_handler_ssl_JettyAlpnSslEngine
|
|
50
|
-
def self.available?
|
|
51
|
-
false
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def new_client_engine(engine, application_negotiator)
|
|
55
|
-
nil
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def new_server_engine(engine, application_negotiator)
|
|
59
|
-
nil
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
class Target_io_netty_handler_ssl_JdkAlpnSslEngine
|
|
64
|
-
def initialize(engine, application_negotiator, server)
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
class Target_io_netty_handler_ssl_SslContext
|
|
69
|
-
def new_client_context_internal(provider, ssl_context_provider, trust_cert_collection, trust_manager_factory, key_cert_chain, key, key_password,
|
|
70
|
-
key_manager_factory, ciphers, cipher_filter, apn, session_cache_size, session_timeout, client_auth,
|
|
71
|
-
protocols, start_tls, enable_ocsp, key_store_type, ctx_options)
|
|
72
|
-
|
|
73
|
-
if enable_ocsp
|
|
74
|
-
raise ArgumentError, "OCSP is not supported with this SslProvider: #{provider}"
|
|
75
|
-
else
|
|
76
|
-
Target_io_netty_handler_ssl_JdkSslServerContext.new(ssl_context_provider, trust_cert_collection, trust_manager_factory, key_cert_chain, key, key_password,
|
|
77
|
-
key_manager_factory, ciphers, cipher_filter, apn, session_cache_size, session_timeout, client_auth,
|
|
78
|
-
protocols, start_tls, key_store_type)
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def new_client_context_internal(provider, ssl_context_provider, trust_cert, trust_manager_factory, key_cert_chain,
|
|
83
|
-
key, key_password, key_manager_factory, ciphers, cipher_filter, apn, protocols,
|
|
84
|
-
session_cache_size, session_timeout, enable_ocsp, key_store_type, options)
|
|
85
|
-
|
|
86
|
-
if enable_ocsp
|
|
87
|
-
raise ArgumentError, "OCSP is not supported with this SslProvider: #{provider}"
|
|
88
|
-
else
|
|
89
|
-
Target_io_netty_handler_ssl_JdkSslClientContext.new(ssl_context_provider, trust_cert, trust_manager_factory, key_cert_chain, key, key_password,
|
|
90
|
-
key_manager_factory, ciphers, cipher_filter, apn, protocols, session_cache_size, session_timeout, key_store_type)
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
class Target_io_netty_handler_ssl_JdkDefaultApplicationProtocolNegotiator
|
|
96
|
-
INSTANCE = :instance
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
class Target_io_netty_handler_ssl_JdkSslContext
|
|
100
|
-
def self.to_negotiator(config, server)
|
|
101
|
-
if config.nil?
|
|
102
|
-
return Target_io_netty_handler_ssl_JdkDefaultApplicationProtocolNegotiator::INSTANCE
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
case config.protocol
|
|
106
|
-
when NONE
|
|
107
|
-
Target_io_netty_handler_ssl_JdkDefaultApplicationProtocolNegotiator::INSTANCE
|
|
108
|
-
when ALPN
|
|
109
|
-
if server
|
|
110
|
-
# GRAAL RC9 bug: https://github.com/oracle/graal/issues/813
|
|
111
|
-
# switch(config.selectorFailureBehavior()) {
|
|
112
|
-
# case FATAL_ALERT:
|
|
113
|
-
# return new JdkAlpnApplicationProtocolNegotiator(true, config.supportedProtocols());
|
|
114
|
-
# case NO_ADVERTISE:
|
|
115
|
-
# return new JdkAlpnApplicationProtocolNegotiator(false, config.supportedProtocols());
|
|
116
|
-
# default:
|
|
117
|
-
# throw new UnsupportedOperationException(new StringBuilder("JDK provider does not support ")
|
|
118
|
-
# . append(config.selectorFailureBehavior()).append(" failure behavior").toString());
|
|
119
|
-
# }
|
|
120
|
-
behavior = config.selector_failure_behavior
|
|
121
|
-
if behavior == org.neo4j.driver.internal.shaded.io.netty.handler.ssl.ApplicationProtocolConfig.SelectorFailureBehavior::FATAL_ALERT
|
|
122
|
-
return org.neo4j.driver.internal.shaded.io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator.new(true, config.supported_protocols)
|
|
123
|
-
elsif org.neo4j.driver.internal.shaded.io.netty.handler.ssl.ApplicationProtocolConfig.SelectorFailureBehavior::NO_ADVERTISE
|
|
124
|
-
return org.neo4j.driver.internal.shaded.io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator.new(false, config.supported_protocols)
|
|
125
|
-
else
|
|
126
|
-
raise UnsupportedOperationException, "JDK provider does not support #{config.selector_failure_behavior} failure behavior"
|
|
127
|
-
end
|
|
128
|
-
else
|
|
129
|
-
case config.selected_listener_failure_behavior
|
|
130
|
-
when ACCEPT
|
|
131
|
-
org.neo4j.driver.internal.shaded.io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator.new(false, config.supported_protocols)
|
|
132
|
-
when FATAL_ALERT
|
|
133
|
-
return org.neo4j.driver.internal.shaded.io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator.new(true, config.supported_protocols)
|
|
134
|
-
else
|
|
135
|
-
raise UnsupportedOperationException, "JDK provider does not support #{config.selected_listener_failure_behavior} failure behavior"
|
|
136
|
-
end
|
|
137
|
-
end
|
|
138
|
-
else
|
|
139
|
-
raise UnsupportedOperationException, "JDK provider does not support #{config.protocol} protocol"
|
|
140
|
-
end
|
|
141
|
-
end
|
|
142
|
-
end
|
|
143
|
-
|
|
144
|
-
# This one only prints exceptions otherwise we get a useless bogus
|
|
145
|
-
# exception message: https://github.com/eclipse-vertx/vert.x/issues/1657
|
|
146
|
-
class Target_io_netty_bootstrap_AbstractBootstrap
|
|
147
|
-
def initialize(channel)
|
|
148
|
-
@channel_factory = org.neo4j.driver.internal.shaded.io.netty.bootstrap.ChannelFactory.new
|
|
149
|
-
end
|
|
150
|
-
|
|
151
|
-
def config
|
|
152
|
-
nil
|
|
153
|
-
end
|
|
154
|
-
|
|
155
|
-
def init_and_register
|
|
156
|
-
begin
|
|
157
|
-
channel = @channel_factory.new_channel
|
|
158
|
-
new(channel)
|
|
159
|
-
rescue StandardError => e
|
|
160
|
-
# THE FIX IS HERE:
|
|
161
|
-
t.print_stack_trace
|
|
162
|
-
unless channel.nil?
|
|
163
|
-
# channel can be null if newChannel crashed (eg SocketException("too many open files"))
|
|
164
|
-
channel.unsafe.close_forcibly
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
# as the Channel is not registered yet we need to force the usage of the GlobalEventExecutor
|
|
168
|
-
org.neo4j.driver.internal.shaded.io.netty.channel.DefaultChannelPromise.new(channel, io.netty.util.concurrent.GlobalEventExecutor::INSTANCE).set_failure(e)
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
reg_future = config.group.register(channel)
|
|
172
|
-
if reg_future.cause
|
|
173
|
-
if channel.registered?
|
|
174
|
-
channel.close
|
|
175
|
-
else
|
|
176
|
-
channel.unsafe.close_forcibly
|
|
177
|
-
end
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
# If we are here and the promise is not failed, it's one of the following cases:
|
|
181
|
-
# 1) If we attempted registration from the event loop, the registration has been completed at this point.
|
|
182
|
-
# i.e. It's safe to attempt bind() or connect() now because the channel has been registered.
|
|
183
|
-
# 2) If we attempted registration from the other thread, the registration request has been successfully
|
|
184
|
-
# added to the event loop's task queue for later execution.
|
|
185
|
-
# i.e. It's safe to attempt bind() or connect() now:
|
|
186
|
-
# because bind() or connect() will be executed *after* the scheduled registration task is executed
|
|
187
|
-
# because register(), bind(), and connect() are all bound to the same thread.
|
|
188
|
-
reg_future
|
|
189
|
-
end
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
class NettySubstitutions
|
|
193
|
-
end
|
|
194
|
-
end
|
|
195
|
-
end
|
|
196
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Svm
|
|
4
|
-
# This substitution avoid having jcraft zlib added to the build
|
|
5
|
-
class Target_org_neo4j_driver_internal_shaded_io_netty_handler_codec_compression_ZlibCodecFactory
|
|
6
|
-
class << self
|
|
7
|
-
def new_zlib_encoder(wrapper, compression_level)
|
|
8
|
-
org.neo4j.driver.internal.shaded.io.netty.handler.codec.compression.JdkZlibEncoder.new(wrapper, compression_level)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def zlib_decoder(wrapper)
|
|
12
|
-
org.neo4j.driver.internal.shaded.io.netty.handler.codec.compression.jdk_zlib_decoder(wrapper)
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
class ZLibSubstitutions
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Util
|
|
4
|
-
|
|
5
|
-
# A tool used to save, load certs, etc.
|
|
6
|
-
class CertificateTool
|
|
7
|
-
BEGIN_CERT = "-----BEGIN CERTIFICATE-----"
|
|
8
|
-
END_CERT = "-----END CERTIFICATE-----"
|
|
9
|
-
|
|
10
|
-
# Save a certificate to a file in base 64 binary format with BEGIN and END strings
|
|
11
|
-
# @param certStr
|
|
12
|
-
# @param certFile
|
|
13
|
-
# @throws IOException
|
|
14
|
-
class << self
|
|
15
|
-
def save_x509_cert(cert_str, cert_file)
|
|
16
|
-
writer = java.io.BufferedWriter.new(java.io.FileWriter.new(cert_file))
|
|
17
|
-
|
|
18
|
-
writer.write(BEGIN_CERT)
|
|
19
|
-
writer.new_line
|
|
20
|
-
|
|
21
|
-
writer.write(cert_str)
|
|
22
|
-
writer.new_line
|
|
23
|
-
|
|
24
|
-
writer.write(END_CERT)
|
|
25
|
-
writer.new_line
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# Save a certificate to a file. Remove all the content in the file if there is any before.
|
|
29
|
-
|
|
30
|
-
# @param cert
|
|
31
|
-
# @param certFile
|
|
32
|
-
# @throws GeneralSecurityException
|
|
33
|
-
# @throws IOException
|
|
34
|
-
|
|
35
|
-
# Load the certificates written in X.509 format in a file to a key store.
|
|
36
|
-
|
|
37
|
-
# @param certFile
|
|
38
|
-
# @param keyStore
|
|
39
|
-
# @throws GeneralSecurityException
|
|
40
|
-
# @throws IOException
|
|
41
|
-
def load_x509_cert(cert_file, key_store)
|
|
42
|
-
input_stream = java.io.BufferedInputStream.new(java.io.FileInputStream.new(cert_file))
|
|
43
|
-
|
|
44
|
-
cert_factory = java.security.cert.CertificateFactory.get_instance('X.509')
|
|
45
|
-
cert_count = 0 #The file might contain multiple certs
|
|
46
|
-
|
|
47
|
-
while input_stream.available > 0
|
|
48
|
-
begin
|
|
49
|
-
cert = cert_factory.generate_certificate(input_stream)
|
|
50
|
-
cert_count = cert_count + 1
|
|
51
|
-
# load_x509_cert(cert, 'neo4j.javadriver.trustedcert.', cert_count, key_store)
|
|
52
|
-
rescue java.security.cert.CertificateException => e
|
|
53
|
-
|
|
54
|
-
# This happens if there is whitespace at the end of the certificate - we load one cert, and then try and load a
|
|
55
|
-
# second cert, at which point we fail
|
|
56
|
-
return if !e.get_cause.nil? && e.get_cause.get_message == 'Empty input'
|
|
57
|
-
raise java.io.IOException.new("Failed to load certificate from `#{cert_file.get_absolute_path}`: #{cert_count} : #{e.get_message}", e)
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Util
|
|
4
|
-
module Clock
|
|
5
|
-
module System
|
|
6
|
-
class << self
|
|
7
|
-
def millis()
|
|
8
|
-
gettime(:millisecond)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def time()
|
|
12
|
-
gettime(:float_second).seconds
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def sleep(duration)
|
|
16
|
-
super(duration.in_seconds)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
private
|
|
20
|
-
|
|
21
|
-
def gettime(unit)
|
|
22
|
-
Process.clock_gettime(Process::CLOCK_MONOTONIC, unit)
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Neo4j::Driver::Internal::Util
|
|
4
|
-
class ErrorUtil
|
|
5
|
-
DEFAULT_CONN_TERMINATED_REASON = 'Please ensure that your database is listening on the correct host and port and '\
|
|
6
|
-
'that you have compatible encryption settings both on Neo4j server and driver. '\
|
|
7
|
-
'Note that the default encryption setting has changed in Neo4j 4.0.'.freeze
|
|
8
|
-
|
|
9
|
-
SEC_EXCEPTION_CODE_MAPPING = {
|
|
10
|
-
'Neo.ClientError.Security.Unauthorized' => Neo4j::Driver::Exceptions::AuthenticationException,
|
|
11
|
-
'Neo.ClientError.Security.AuthorizationExpired' => Neo4j::Driver::Exceptions::AuthorizationExpiredException,
|
|
12
|
-
'Neo.ClientError.Security.TokenExpired' => Neo4j::Driver::Exceptions::TokenExpiredException
|
|
13
|
-
}.freeze
|
|
14
|
-
|
|
15
|
-
class << self
|
|
16
|
-
def new_connection_terminated_error(reason)
|
|
17
|
-
reason ||= DEFAULT_CONN_TERMINATED_REASON
|
|
18
|
-
Neo4j::Driver::Exceptions::ServiceUnavailableException.new("Connection to the database terminated. #{reason}")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def new_result_consumed_error
|
|
22
|
-
Neo4j::Driver::Exceptions::ResultConsumedException.new(
|
|
23
|
-
'Cannot access records on this result any more as the result has already been consumed '\
|
|
24
|
-
'or the query runner where the result is created has already been closed.'
|
|
25
|
-
)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def new_neo4j_error(code, message)
|
|
29
|
-
case extract_error_class(code)
|
|
30
|
-
when 'ClientError'
|
|
31
|
-
if extract_error_sub_class(code) == 'Security'
|
|
32
|
-
SEC_EXCEPTION_CODE_MAPPING[code] || Neo4j::Driver::Exceptions::SecurityException
|
|
33
|
-
else
|
|
34
|
-
code == 'Neo.ClientError.Database.DatabaseNotFound' ? Neo4j::Driver::Exceptions::FatalDiscoveryException : Neo4j::Driver::Exceptions::ClientException
|
|
35
|
-
end
|
|
36
|
-
when 'TransientError'
|
|
37
|
-
Neo4j::Driver::Exceptions::TransientException
|
|
38
|
-
else
|
|
39
|
-
Neo4j::Driver::Exceptions::DatabaseException
|
|
40
|
-
end.new(code, message)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def fatal?(error)
|
|
44
|
-
!error.is_a?(Neo4j::Driver::Exceptions::Neo4jException) ||
|
|
45
|
-
protocol_violation_error?(error.code) ||
|
|
46
|
-
!client_or_transient_error?(error.code)
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def rethrow_async_exception(exception)
|
|
50
|
-
error = exception.cause
|
|
51
|
-
internal_cause = InternalExceptionCause.new(nil, error.backtrace)
|
|
52
|
-
error.add_suppressed(internal_cause)
|
|
53
|
-
|
|
54
|
-
# do not include Thread.current and this method in the stacktrace
|
|
55
|
-
current_stack_trace = Thread.current.backtrace.drop(2)
|
|
56
|
-
error.set_backtrace(current_stack_trace)
|
|
57
|
-
|
|
58
|
-
org.neo4j.driver.internal.shaded.io.netty.util.internal.PlatformDependent.throw_exception(error)
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def add_suppressed(main_error, error)
|
|
62
|
-
main_error.add_suppressed(error) if main_error.is_a?(Neo4j::Driver::Exceptions::Neo4jException) && main_error != error
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
def get_root_cause(error)
|
|
66
|
-
java.util.Objects.require_non_null(error)
|
|
67
|
-
|
|
68
|
-
error.cause ? get_root_cause(error.cause) : error
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
# Exception which is merely a holder of an async stacktrace, which is not the primary stacktrace users are interested in.
|
|
72
|
-
# Used for blocking API calls that block on async API calls.
|
|
73
|
-
class InternalExceptionCause < RuntimeError
|
|
74
|
-
def initialize(message, backtrace)
|
|
75
|
-
super(message)
|
|
76
|
-
set_backtrace(backtrace)
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
private
|
|
81
|
-
|
|
82
|
-
def extract_error_class(code)
|
|
83
|
-
extract_class_from_code(code, 2)
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
def extract_error_sub_class(code)
|
|
87
|
-
extract_class_from_code(code, 3)
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def extract_class_from_code(code, parts_counts)
|
|
91
|
-
parts = code.split('.')
|
|
92
|
-
parts.length < parts_counts ? '' : parts[parts_counts - 1]
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
def protocol_violation_error?(error_code)
|
|
96
|
-
error_code&.start_with?('Neo.ClientError.Request')
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
def client_or_transient_error?(error_code)
|
|
100
|
-
error_code && %w[ClientError TransientError].any?(&error_code.method(:include?))
|
|
101
|
-
end
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
end
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Util
|
|
4
|
-
# Utility class for extracting data.
|
|
5
|
-
class Extract
|
|
6
|
-
def initialize
|
|
7
|
-
raise java.lang.UnsupportedOperationException
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
class << self
|
|
11
|
-
def list(data, map_function)
|
|
12
|
-
size = data.length
|
|
13
|
-
|
|
14
|
-
case size
|
|
15
|
-
when 0
|
|
16
|
-
java.util.Collections.empty_list
|
|
17
|
-
when 1
|
|
18
|
-
java.util.Collections.singleton_list(map_function.apply(data.first))
|
|
19
|
-
else
|
|
20
|
-
result = []
|
|
21
|
-
data.each do |value|
|
|
22
|
-
result << map_function.apply(value)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
result.freeze
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def map(record, map_function)
|
|
30
|
-
size = record.length
|
|
31
|
-
|
|
32
|
-
case size
|
|
33
|
-
when 0
|
|
34
|
-
java.util.Collections.empty_map
|
|
35
|
-
when 1
|
|
36
|
-
java.util.Collections.singleton_map[record.keys.first] = map_function.apply(record.first)
|
|
37
|
-
else
|
|
38
|
-
map = {}
|
|
39
|
-
keys = record.keys
|
|
40
|
-
size.times do |i|
|
|
41
|
-
map[keys[i]] = map_function.apply(record[i])
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
map.freeze
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def properties(map, map_function)
|
|
49
|
-
size = map.length
|
|
50
|
-
|
|
51
|
-
case size
|
|
52
|
-
when 0
|
|
53
|
-
java.util.Collections.empty_list
|
|
54
|
-
when 1
|
|
55
|
-
key = map.keys.first
|
|
56
|
-
value = map[key]
|
|
57
|
-
java.util.Collections.singleton_list(InternalPair.of(key, map_function.apply(value)))
|
|
58
|
-
else
|
|
59
|
-
list = []
|
|
60
|
-
keys = record.keys
|
|
61
|
-
map.keys.each do |map_key|
|
|
62
|
-
map_value = map[map_key]
|
|
63
|
-
list << InternalPair.of(map_key, map_function.apply(map_value))
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
list.freeze
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def fields(map, map_function)
|
|
71
|
-
size = map.keys.length
|
|
72
|
-
|
|
73
|
-
case size
|
|
74
|
-
when 0
|
|
75
|
-
java.util.Collections.empty_list
|
|
76
|
-
when 1
|
|
77
|
-
key = map.keys.first
|
|
78
|
-
value = map[key]
|
|
79
|
-
java.util.Collections.singleton_list(InternalPair.of(key, map_function.apply(value)))
|
|
80
|
-
else
|
|
81
|
-
list = []
|
|
82
|
-
keys = record.keys
|
|
83
|
-
size.times do |i|
|
|
84
|
-
key = keys[i]
|
|
85
|
-
value = map[key]
|
|
86
|
-
list << InternalPair.of(key, map_function.apply(value))
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
list.freeze
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
def map_of_values(map)
|
|
94
|
-
return java.util.Collections.empty_map if map.nil? || map.empty?
|
|
95
|
-
|
|
96
|
-
result = {}
|
|
97
|
-
|
|
98
|
-
map.entry_set.each do |key, value|
|
|
99
|
-
assert_parameter(value)
|
|
100
|
-
result[key] = value
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
result
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
def assert_parameter(value)
|
|
107
|
-
if value.is_a? Types::Node
|
|
108
|
-
raise Exceptions::ClientException, "Nodes can't be used as parameters."
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
if value.is_a? Types::Relationship
|
|
112
|
-
raise Exceptions::ClientException, "Relationships can't be used as parameters."
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
if value.is_a? Types::Path
|
|
116
|
-
raise Exceptions::ClientException, "Paths can't be used as parameters."
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
|
-
end
|
|
122
|
-
end
|
|
123
|
-
end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Util
|
|
4
|
-
class Format
|
|
5
|
-
def initialize
|
|
6
|
-
raise java.lang.UnsupportedOperationException
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
# formats map using ':' as key-value separator instead of default '='
|
|
10
|
-
class << self
|
|
11
|
-
def format_pairs(entries)
|
|
12
|
-
case entries.size
|
|
13
|
-
when 0
|
|
14
|
-
'{}'
|
|
15
|
-
when 1
|
|
16
|
-
"#{key_value_string(entries.first)}"
|
|
17
|
-
else
|
|
18
|
-
builder = ""
|
|
19
|
-
builder << "{"
|
|
20
|
-
builder << key_value_string(entries.first)
|
|
21
|
-
|
|
22
|
-
entries.each do |entry|
|
|
23
|
-
builder << ","
|
|
24
|
-
builder << " "
|
|
25
|
-
builder << key_value_string(entry)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
builder << "}"
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
private def key_value_string(entry)
|
|
33
|
-
"#{entry.keys.first}:#{entry.values.first}"
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Neo4j::Driver
|
|
4
|
-
module Internal
|
|
5
|
-
module Util
|
|
6
|
-
class Futures
|
|
7
|
-
# TO DO: complete this class, this was partially migrated
|
|
8
|
-
|
|
9
|
-
private
|
|
10
|
-
|
|
11
|
-
COMPLETED_WITH_NULL = Concurrent::Promises.fulfilled_future(nil)
|
|
12
|
-
|
|
13
|
-
public
|
|
14
|
-
|
|
15
|
-
class << self
|
|
16
|
-
def completed_with_null
|
|
17
|
-
COMPLETED_WITH_NULL
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def completed_with_null_if_no_error(future, error)
|
|
21
|
-
error ? future.reject(error) : future.fulfill(nil)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def failed_future(error)
|
|
25
|
-
Concurrent::Promises.rejected_future(error)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def blocking_get(stage)
|
|
29
|
-
Async::Connection::EventLoopGroupFactory.assert_not_in_event_loop_thread
|
|
30
|
-
|
|
31
|
-
interrupted = false
|
|
32
|
-
begin
|
|
33
|
-
loop do
|
|
34
|
-
break stage.value!
|
|
35
|
-
rescue Interrupt => e
|
|
36
|
-
# this thread was interrupted while waiting
|
|
37
|
-
# computation denoted by the future might still be running
|
|
38
|
-
interrupted = true
|
|
39
|
-
|
|
40
|
-
# run the interrupt handler and ignore if it throws
|
|
41
|
-
# need to wait for IO thread to actually finish, can't simply re-rethrow
|
|
42
|
-
yield rescue nil
|
|
43
|
-
# rescue java.util.concurrent.ExecutionException => e
|
|
44
|
-
# ErrorUtil.rethrow_async_exception(e)
|
|
45
|
-
end
|
|
46
|
-
ensure
|
|
47
|
-
Thread.current.interrupt if interrupted
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def get_now(stage)
|
|
52
|
-
stage.resolved? ? stage.value! : nil
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def join_now_or_else_throw(future)
|
|
56
|
-
if future.resolved?
|
|
57
|
-
future.value!
|
|
58
|
-
else
|
|
59
|
-
raise yield
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def combine_errors(error1, error2)
|
|
64
|
-
ErrorUtil.add_suppressed(error1, error2) if error1 && error2
|
|
65
|
-
error1 || error2
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def on_error_continue(future, error_recorder)
|
|
69
|
-
Validator.require_non_nil!(future)
|
|
70
|
-
|
|
71
|
-
future
|
|
72
|
-
.then { |value| CompletionResult.new(value, nil) }
|
|
73
|
-
.rescue do |error|
|
|
74
|
-
Futures.combine_errors(error_recorder, error)
|
|
75
|
-
CompletionResult.new(nil, error)
|
|
76
|
-
end.then_flat do |result|
|
|
77
|
-
if result.value.nil?
|
|
78
|
-
yield result.error
|
|
79
|
-
else
|
|
80
|
-
Concurrent::Promises.fulfilled_future(result.value)
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
def future_completing_consumer(future, fulfilled, value, throwable)
|
|
86
|
-
fulfilled ? future.fulfill(value) : future.reject(throwable)
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
private
|
|
90
|
-
|
|
91
|
-
CompletionResult = Struct.new(:value, :error)
|
|
92
|
-
|
|
93
|
-
def no_op_interrupt_handler
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
end
|
|
98
|
-
end
|
|
99
|
-
end
|