neo4j-ruby-driver 4.4.16-java → 5.13.0.alpha.1-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad663c18da3f91017ddcf09aacd40cbbef09d6ed1a81c459b1548755bb2d1a9d
4
- data.tar.gz: 969ab28aaf9f16a2ae225e7734435ba882ef1a62206df33b06c3b7ce285d68d0
3
+ metadata.gz: dbf26d42944323e18fc28f944ff365d981755118e1d01f52345c72ebdcea5641
4
+ data.tar.gz: 708c207bbc0602450a4514876b910319652166946f657c5ae7ff7993d53056fa
5
5
  SHA512:
6
- metadata.gz: 3694d51ef544d48e19b3ba40f978d603c8f819139986fe5c137473d2fbe3217d062b87fab53605f3f155173fb8c06f183a54474cc97b3d11931efc3a9035be94
7
- data.tar.gz: 12e34048e3927ef5d4d51ed62a1463a01db4452d233f5106ae44a8fc65225e90b389a8686c7119e6b95a482a620d01931ba1d134c1f29437c6b77b6537244256
6
+ metadata.gz: 934c8d730afe408fe9b840c5bfc6c00c09886b0742d055139ead934c6adf59142171a3cdfdf3cabbbeefe57608b5b1417523d7dfc9232164bb728cc8285ef253
7
+ data.tar.gz: 93117f5187a574967021949c3b3a4bf0b4dc48706fba5080d2cc8f2210e598778460b0d22e46046c06d677cda165fb3d620239b94bb4d20331d57030c8ea8b9c
@@ -13,7 +13,7 @@ module Neo4j
13
13
  end
14
14
 
15
15
  def apply_to(builder, **hash)
16
- hash.compact.reduce(builder) { |object, key_value| object.send(*config_method(*key_value)) }
16
+ hash.compact.reduce(builder) { |object, (key, value)| object.send(*config_method(key, value)) }
17
17
  end
18
18
 
19
19
  def config_method(key, value)
@@ -45,6 +45,8 @@ module Neo4j
45
45
  else
46
46
  "with_#{value}_revocation_checks"
47
47
  end
48
+ when 'notification_config'
49
+ value = notification_config(**value)
48
50
  else
49
51
  value = to_neo(value, skip_unknown: true)
50
52
  end
@@ -63,6 +65,18 @@ module Neo4j
63
65
  end
64
66
  apply_to(trust_strategy, **config)
65
67
  end
68
+
69
+ def notification_config(minimum_severity: nil, disabled_categories: nil)
70
+ org.neo4j.driver.internal.InternalNotificationConfig.new(
71
+ value_of(org.neo4j.driver.internal.InternalNotificationSeverity, minimum_severity),
72
+ disabled_categories
73
+ &.map { |value| value_of(org.neo4j.driver.internal.InternalNotificationCategory, value) }
74
+ &.then(&java.util.HashSet.method(:new)))
75
+ end
76
+
77
+ def value_of(klass, value)
78
+ klass.value_of(value&.to_s&.upcase).or_else(nil)
79
+ end
66
80
  end
67
81
  end
68
82
  end
@@ -19,6 +19,7 @@ module Neo4j
19
19
  java_import org.neo4j.driver.exceptions.TokenExpiredException
20
20
  java_import org.neo4j.driver.exceptions.TransactionNestingException
21
21
  java_import org.neo4j.driver.exceptions.TransientException
22
+ java_import org.neo4j.driver.exceptions.UnsupportedFeatureException
22
23
  java_import org.neo4j.driver.exceptions.UntrustedServerException
23
24
 
24
25
  def mapped_exception(exception)
@@ -48,6 +49,8 @@ module Neo4j
48
49
  Neo4j::Driver::Exceptions::SecurityException
49
50
  when TransactionNestingException
50
51
  Neo4j::Driver::Exceptions::TransactionNestingException
52
+ when UnsupportedFeatureException
53
+ Neo4j::Driver::Exceptions::UnsupportedFeatureException
51
54
  when ClientException
52
55
  Neo4j::Driver::Exceptions::ClientException
53
56
  when ConnectionReadTimeoutException
@@ -8,7 +8,7 @@ module Neo4j
8
8
  include ConfigConverter
9
9
  include ExceptionCheckable
10
10
 
11
- auto_closable :driver, :routing_driver
11
+ auto_closable :driver
12
12
 
13
13
  def driver(uri, auth_token = Neo4j::Driver::AuthTokens.none, **config)
14
14
  check do
@@ -17,10 +17,14 @@ module Neo4j
17
17
  end
18
18
  end
19
19
 
20
- def routing_driver(routing_uris, auth_token, **config)
20
+ def internal_driver(uri, auth_token = Neo4j::Driver::AuthTokens.none, **config, &domain_name_resolver)
21
21
  check do
22
- super(routing_uris.map { |uri| java.net.URI.create(uri.to_s) }, auth_token,
23
- to_java_config(Neo4j::Driver::Config, **config))
22
+ java_uri = java.net.URI.create(uri.to_s)
23
+ java_config = to_java_config(Neo4j::Driver::Config, **config)
24
+ Internal::DriverFactory
25
+ .new(&domain_name_resolver)
26
+ .new_instance(java_uri, org.neo4j.driver.internal.security.StaticAuthTokenManager.new(auth_token),
27
+ java_config)
24
28
  end
25
29
  end
26
30
  end
@@ -0,0 +1,24 @@
1
+ module Neo4j
2
+ module Driver
3
+ module Ext
4
+ module Internal
5
+ class DriverFactory < org.neo4j.driver.internal.DriverFactory
6
+ def initialize(&domain_name_resolver)
7
+ super()
8
+ @domain_name_resolver = ->(name) do
9
+ domain_name_resolver.call(name).map do |addr|
10
+ java.net.InetAddress.get_by_name(addr)
11
+ rescue java.net.UnknownHostException => e
12
+ raise java.lang.RuntimeException.new(e)
13
+ end
14
+ end
15
+ end
16
+
17
+ def getDomainNameResolver
18
+ @domain_name_resolver
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,13 @@
1
+ module Neo4j
2
+ module Driver
3
+ module Ext
4
+ module Internal
5
+ module InternalNotificationCommon
6
+ def type
7
+ super.to_s
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,27 @@
1
+ module Neo4j
2
+ module Driver
3
+ module Ext
4
+ module Internal
5
+ module Summary
6
+ module InternalNotification
7
+ def severity_level
8
+ super.or_else(nil)
9
+ end
10
+
11
+ def raw_severity_level
12
+ super.or_else(nil)
13
+ end
14
+
15
+ def raw_category
16
+ super.or_else(nil)
17
+ end
18
+
19
+ def category
20
+ super.or_else(nil)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Neo4j
4
+ module Driver
5
+ module Ext
6
+ module Internal
7
+ module Summary
8
+ module InternalPlan
9
+ def args
10
+ arguments&.to_h&.transform_values(&:as_ruby_object)
11
+ end
12
+
13
+ def identifiers
14
+ super.to_a
15
+ end
16
+
17
+ # this part should probably be included in testkit-backend
18
+ def to_h
19
+ {operator_type:, args:, identifiers:, children: children&.map(&:to_h)}
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -9,7 +9,9 @@ module Neo4j
9
9
  java_import org.neo4j.driver.summary.QueryType
10
10
 
11
11
  %i[result_available_after result_consumed_after].each do |method|
12
- define_method(method) { super(Java::JavaUtilConcurrent::TimeUnit::MILLISECONDS) }
12
+ define_method(method) do
13
+ super(Java::JavaUtilConcurrent::TimeUnit::MILLISECONDS).then { |val| val unless val == -1 }
14
+ end
13
15
  end
14
16
 
15
17
  def query_type
@@ -28,6 +28,14 @@ module Neo4j
28
28
  def verify_connectivity
29
29
  check { super }
30
30
  end
31
+
32
+ def verify_authentication(auth_token)
33
+ check { super }
34
+ end
35
+
36
+ def supports_session_auth?
37
+ check { supports_session_auth }
38
+ end
31
39
  end
32
40
  end
33
41
  end
@@ -17,6 +17,10 @@ module Neo4j
17
17
  def each(&block)
18
18
  check { stream.for_each(&block) }
19
19
  end
20
+
21
+ def to_a
22
+ check { list.to_a }
23
+ end
20
24
  end
21
25
  end
22
26
  end
@@ -16,7 +16,7 @@ module Neo4j
16
16
  date = as_local_date
17
17
  Date.new(date.year, date.month_value, date.day_of_month)
18
18
  when Java::OrgNeo4jDriverInternalTypes::TypeConstructor::DURATION
19
- ActiveSupport::Duration.parse(as_iso_duration.to_s)
19
+ Driver::Internal::DurationNormalizer.create(*%i[months days seconds nanoseconds].map(&as_object.method(:send)))
20
20
  when Java::OrgNeo4jDriverInternalTypes::TypeConstructor::POINT
21
21
  point = as_point
22
22
  Types::Point.new(srid: point.srid, x: point.x, y: point.y, z: nullable(point.z))
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Neo4j
4
4
  module Driver
5
- VERSION = '4.4.16'
5
+ VERSION = '5.13.0.alpha.1'
6
6
  end
7
7
  end
@@ -43,6 +43,8 @@ Java::OrgNeo4jDriverInternal::InternalBookmark.prepend Neo4j::Driver::Ext::Inter
43
43
  Java::OrgNeo4jDriverInternal::InternalDriver.prepend Neo4j::Driver::Ext::InternalDriver
44
44
  Java::OrgNeo4jDriverInternal::InternalEntity.include Neo4j::Driver::Ext::InternalEntity
45
45
  Java::OrgNeo4jDriverInternal::InternalNode.prepend Neo4j::Driver::Ext::InternalNode
46
+ Java::OrgNeo4jDriverInternal::InternalNotificationCategory.prepend Neo4j::Driver::Ext::Internal::InternalNotificationCommon
47
+ Java::OrgNeo4jDriverInternal::InternalNotificationSeverity.prepend Neo4j::Driver::Ext::Internal::InternalNotificationCommon
46
48
  Java::OrgNeo4jDriverInternal::InternalPath.include Neo4j::Driver::Ext::StartEndNaming
47
49
  Java::OrgNeo4jDriverInternal::InternalPath::SelfContainedSegment.include Neo4j::Driver::Ext::StartEndNaming
48
50
  Java::OrgNeo4jDriverInternal::InternalRecord.prepend Neo4j::Driver::Ext::InternalRecord
@@ -54,5 +56,7 @@ Java::OrgNeo4jDriverInternalAsync::InternalAsyncSession.prepend Neo4j::Driver::E
54
56
  Java::OrgNeo4jDriverInternalCluster::RoutingTableRegistryImpl.include Neo4j::Driver::Ext::Internal::Cluster::RoutingTableRegistryImpl
55
57
  Java::OrgNeo4jDriverInternalCursor::DisposableAsyncResultCursor.prepend Neo4j::Driver::Ext::Internal::Cursor::DisposableAsyncResultCursor
56
58
  Java::OrgNeo4jDriverInternalMetrics::InternalConnectionPoolMetrics.include Neo4j::Driver::Ext::Internal::Metrics::InternalConnectionPoolMetrics
59
+ Java::OrgNeo4jDriverInternalSummary::InternalNotification.prepend Neo4j::Driver::Ext::Internal::Summary::InternalNotification
60
+ Java::OrgNeo4jDriverInternalSummary::InternalPlan.prepend Neo4j::Driver::Ext::Internal::Summary::InternalPlan
57
61
  Java::OrgNeo4jDriverInternalSummary::InternalResultSummary.prepend Neo4j::Driver::Ext::Internal::Summary::InternalResultSummary
58
62
  Java::OrgNeo4jDriverInternalValue::ValueAdapter.include Neo4j::Driver::Ext::RubyConverter
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Neo4j
4
+ module Driver
5
+ module Exceptions
6
+ # A feature is not supported in a given setup.
7
+ class UnsupportedFeatureException < ClientException
8
+ end
9
+ end
10
+ end
11
+ end
@@ -21,6 +21,11 @@ module Neo4j
21
21
  duration&.in_milliseconds&.round
22
22
  end
23
23
 
24
+ def create(months, days, seconds, nanoseconds)
25
+ { months:, days:, seconds: seconds + (nanoseconds.zero? ? 0 : nanoseconds * BigDecimal('1e-9')) }
26
+ .sum { |key, value| ActiveSupport::Duration.send(key, value) }
27
+ end
28
+
24
29
  private
25
30
 
26
31
  def divmod(number, factor)
@@ -2,10 +2,7 @@
2
2
 
3
3
  require 'active_support/concern'
4
4
  require 'active_support/core_ext/hash/indifferent_access'
5
- require 'active_support/core_ext/object/blank'
6
5
  require 'active_support/isolated_execution_state' if Gem::Requirement.create('>= 7').satisfied_by?(Gem.loaded_specs["activesupport"].version) # TODO: this should not be necessary https://github.com/rails/rails/issues/43851
7
- require 'active_support/deprecator' if Gem::Requirement.create('>= 7.1').satisfied_by?(Gem.loaded_specs["activesupport"].version)
8
- require 'active_support/deprecation'
9
6
  require 'active_support/core_ext/numeric/time'
10
7
  require 'active_support/duration'
11
8
  require 'active_support/time'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-ruby-driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.16
4
+ version: 5.13.0.alpha.1
5
5
  platform: java
6
6
  authors:
7
7
  - Heinrich Klobuczek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-03 00:00:00.000000000 Z
11
+ date: 2023-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - ">="
16
+ - - "<"
17
17
  - !ruby/object:Gem::Version
18
- version: 5.2.0
18
+ version: '7.1'
19
19
  name: activesupport
20
- type: :runtime
21
20
  prerelease: false
21
+ type: :runtime
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "<"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.2.0
26
+ version: '7.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -31,8 +31,8 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.1.10
33
33
  name: zeitwerk
34
- type: :runtime
35
34
  prerelease: false
35
+ type: :runtime
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
@@ -45,8 +45,8 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: 0.6.0
47
47
  name: concurrent-ruby-edge
48
- type: :runtime
49
48
  prerelease: false
49
+ type: :runtime
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
@@ -55,15 +55,15 @@ dependencies:
55
55
  - !ruby/object:Gem::Dependency
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - '='
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: 0.4.1
61
61
  name: jar-dependencies
62
- type: :runtime
63
62
  prerelease: false
63
+ type: :runtime
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.4.1
69
69
  - !ruby/object:Gem::Dependency
@@ -73,8 +73,8 @@ dependencies:
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  name: ffaker
76
- type: :development
77
76
  prerelease: false
77
+ type: :development
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
@@ -87,8 +87,8 @@ dependencies:
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  name: hoe
90
- type: :development
91
90
  prerelease: false
91
+ type: :development
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
@@ -101,8 +101,8 @@ dependencies:
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  name: hoe-bundler
104
- type: :development
105
104
  prerelease: false
105
+ type: :development
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
@@ -115,8 +115,8 @@ dependencies:
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  name: hoe-gemspec
118
- type: :development
119
118
  prerelease: false
119
+ type: :development
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
@@ -129,8 +129,8 @@ dependencies:
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  name: rake
132
- type: :development
133
132
  prerelease: false
133
+ type: :development
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
@@ -143,8 +143,8 @@ dependencies:
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  name: rspec-its
146
- type: :development
147
146
  prerelease: false
147
+ type: :development
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - ">="
@@ -157,8 +157,8 @@ dependencies:
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
159
  name: rspec-mocks
160
- type: :development
161
160
  prerelease: false
161
+ type: :development
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ">="
@@ -171,8 +171,8 @@ dependencies:
171
171
  - !ruby/object:Gem::Version
172
172
  version: '2'
173
173
  name: async
174
- type: :development
175
174
  prerelease: false
175
+ type: :development
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "<"
@@ -185,8 +185,8 @@ dependencies:
185
185
  - !ruby/object:Gem::Version
186
186
  version: '0'
187
187
  name: ruby-maven
188
- type: :development
189
188
  prerelease: false
189
+ type: :development
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - ">="
@@ -202,8 +202,8 @@ dependencies:
202
202
  - !ruby/object:Gem::Version
203
203
  version: '7'
204
204
  name: rdoc
205
- type: :development
206
205
  prerelease: false
206
+ type: :development
207
207
  version_requirements: !ruby/object:Gem::Requirement
208
208
  requirements:
209
209
  - - ">="
@@ -234,8 +234,12 @@ files:
234
234
  - jruby/neo4j/driver/ext/internal/async/internal_async_session.rb
235
235
  - jruby/neo4j/driver/ext/internal/cluster/routing_table_registry_impl.rb
236
236
  - jruby/neo4j/driver/ext/internal/cursor/disposable_async_result_cursor.rb
237
+ - jruby/neo4j/driver/ext/internal/driver_factory.rb
237
238
  - jruby/neo4j/driver/ext/internal/internal_bookmark.rb
239
+ - jruby/neo4j/driver/ext/internal/internal_notification_common.rb
238
240
  - jruby/neo4j/driver/ext/internal/metrics/internal_connection_pool_metrics.rb
241
+ - jruby/neo4j/driver/ext/internal/summary/internal_notification.rb
242
+ - jruby/neo4j/driver/ext/internal/summary/internal_plan.rb
239
243
  - jruby/neo4j/driver/ext/internal/summary/internal_result_summary.rb
240
244
  - jruby/neo4j/driver/ext/internal_driver.rb
241
245
  - jruby/neo4j/driver/ext/internal_entity.rb
@@ -276,6 +280,7 @@ files:
276
280
  - lib/neo4j/driver/exceptions/token_expired_exception.rb
277
281
  - lib/neo4j/driver/exceptions/transaction_nesting_exception.rb
278
282
  - lib/neo4j/driver/exceptions/transient_exception.rb
283
+ - lib/neo4j/driver/exceptions/unsupported_feature_exception.rb
279
284
  - lib/neo4j/driver/exceptions/untrusted_server_exception.rb
280
285
  - lib/neo4j/driver/exceptions/value/lossy_coercion.rb
281
286
  - lib/neo4j/driver/exceptions/value/not_multi_valued.rb
@@ -312,11 +317,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
312
317
  version: '2.6'
313
318
  required_rubygems_version: !ruby/object:Gem::Requirement
314
319
  requirements:
315
- - - ">="
320
+ - - ">"
316
321
  - !ruby/object:Gem::Version
317
- version: '0'
322
+ version: 1.3.1
318
323
  requirements:
319
- - jar org.neo4j.driver, neo4j-java-driver, 4.4.16
324
+ - jar org.neo4j.driver, neo4j-java-driver-all, 5.13.0
320
325
  rubygems_version: 3.3.26
321
326
  signing_key:
322
327
  specification_version: 4