Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use namespaces and rql filter for event subscriptions #232

Merged

Conversation

thjaeckle
Copy link
Member

Fixes: #149

When subscribing for events at all Ditto streaming APIs (SSE, WebSocket, connectivity) optionally following parameters can now be specified:

thjaeckle and others added 30 commits April 20, 2018 14:39
…in the backend

* moved services-thingsearch-query-model to model-query (removed all non-model dependencies)
* removed Bson dependencies from model
* added a default Predicate<Thing> based implementation "ThingPredicateVisitor"
* added unit tests for testing this implementation
* added to StreamingSessionActor that an "eventFilter" may be specified in order to filter events
* used in both WebsocketRoute and SseThingsRoute
* enhanced DummyAuthenticationProvider in order to specify dummy-auth also as HTTP query param

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
# Conflicts:
#	services/gateway/endpoints/src/main/java/org/eclipse/ditto/services/gateway/endpoints/routes/sse/SseThingsRoute.java
#	services/gateway/endpoints/src/main/java/org/eclipse/ditto/services/gateway/endpoints/routes/websocket/WebsocketRoute.java
#	services/gateway/streaming/src/main/java/org/eclipse/ditto/services/gateway/streaming/actors/StreamingSessionActor.java
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
# Conflicts:
#	model/query/src/main/java/org/eclipse/ditto/model/query/filter/EnsureMonotonicityVisitor.java
#	model/query/src/main/java/org/eclipse/ditto/model/query/filter/ParameterOptionVisitor.java
#	model/query/src/main/java/org/eclipse/ditto/model/query/filter/ParameterPredicateVisitor.java
#	model/query/src/main/java/org/eclipse/ditto/model/query/model/criteria/CriteriaFactoryImpl.java
#	model/query/src/main/java/org/eclipse/ditto/model/query/model/criteria/ExistsCriteriaImpl.java
#	model/query/src/main/java/org/eclipse/ditto/model/query/model/expression/FeatureIdPropertyExpressionImpl.java
#	model/query/src/main/java/org/eclipse/ditto/model/query/model/expression/PolicyRestrictedFieldExpression.java
#	model/query/src/main/java/org/eclipse/ditto/model/query/model/expression/SortFieldExpression.java
#	model/query/src/main/java/org/eclipse/ditto/model/query/model/expression/ThingsAclFieldExpressionImpl.java
#	model/query/src/main/java/org/eclipse/ditto/model/query/model/expression/ThingsGlobalReadsFieldExpressionImpl.java
#	model/query/src/test/java/org/eclipse/ditto/model/query/filter/ParameterOptionVisitorTest.java
#	model/query/src/test/java/org/eclipse/ditto/model/query/filter/ParameterPredicateVisitorTest.java
#	services/gateway/endpoints/src/main/java/org/eclipse/ditto/services/gateway/endpoints/routes/sse/SseThingsRoute.java
#	services/gateway/streaming/src/main/java/org/eclipse/ditto/services/gateway/streaming/actors/StreamingSessionActor.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/criteria/visitors/ContainsAllRequiredResourcesVisitor.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/criteria/visitors/CreateBsonPredicateVisitor.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/criteria/visitors/CreateUnwoundBsonVisitor.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/expression/visitors/CreateUnwoundBsonFieldVisitor.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/expression/visitors/GetExistsBsonVisitor.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/expression/visitors/GetFieldIdentifierVisitor.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/expression/visitors/GetFilterBsonVisitor.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/expression/visitors/GetPolicyRestrictionBsonVisitor.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/expression/visitors/GetSortBsonVisitor.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/expression/visitors/GetUnwoundExistsFilterBsonVisitor.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/expression/visitors/IsInternalViewVisitor.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/AbstractPredicateTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/AndCriteriaImplTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/AnyCriteriaImplTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/CriteriaFactoryImplTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/EqPredicateImplTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/ExistsCriteriaImplTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/FieldCriteriaImplTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/GePredicateImplTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/GtPredicateImplTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/LtPredicateImplTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/NePredicateImplTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/NorCriteriaImplTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/query/model/criteria/OrCriteriaImplTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/read/AggregationPolicyAuthIT.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/read/query/MongoQueryBuilderFactoryTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/read/query/MongoQueryBuilderLimitedTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/read/query/MongoQueryBuilderUnlimitedTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/read/query/PolicyRestrictedMongoSearchAggregationTest.java
#	services/thingsearch/starter/src/main/java/org/eclipse/ditto/services/thingsearch/starter/actors/SearchActor.java
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
# Conflicts:
#	services/connectivity/messaging/pom.xml
#	services/connectivity/messaging/src/main/java/org/eclipse/ditto/services/connectivity/messaging/MessageMappingProcessorActor.java
#	services/gateway/endpoints/src/main/java/org/eclipse/ditto/services/gateway/endpoints/routes/websocket/WebsocketRoute.java
#	services/gateway/streaming/src/main/java/org/eclipse/ditto/services/gateway/streaming/actors/StreamingSessionActor.java
… msg

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
# Conflicts:
#	model/connectivity/src/main/java/org/eclipse/ditto/model/connectivity/ConnectivityModelFactory.java
#	model/connectivity/src/main/java/org/eclipse/ditto/model/connectivity/ExternalMessage.java
#	model/connectivity/src/main/java/org/eclipse/ditto/model/connectivity/ExternalMessageBuilder.java
#	model/connectivity/src/main/java/org/eclipse/ditto/model/connectivity/ImmutableExternalMessage.java
#	model/connectivity/src/main/java/org/eclipse/ditto/model/connectivity/ImmutableTarget.java
#	model/connectivity/src/main/java/org/eclipse/ditto/model/connectivity/MutableExternalMessageBuilder.java
#	model/connectivity/src/main/java/org/eclipse/ditto/model/connectivity/Target.java
#	model/connectivity/src/main/java/org/eclipse/ditto/model/connectivity/Topic.java
#	model/connectivity/src/test/java/org/eclipse/ditto/model/connectivity/ImmutableExternalMessageTest.java
#	model/connectivity/src/test/java/org/eclipse/ditto/model/connectivity/ImmutableTargetTest.java
#	services/connectivity/mapping/src/main/java/org/eclipse/ditto/services/connectivity/mapping/DittoMessageMapper.java
#	services/connectivity/messaging/src/main/java/org/eclipse/ditto/services/connectivity/messaging/BasePublisherActor.java
#	services/connectivity/messaging/src/main/java/org/eclipse/ditto/services/connectivity/messaging/ConnectionActor.java
#	services/connectivity/messaging/src/test/java/org/eclipse/ditto/services/connectivity/messaging/TestConstants.java
#	services/gateway/endpoints/src/main/java/org/eclipse/ditto/services/gateway/endpoints/routes/sse/SseThingsRoute.java
#	services/gateway/streaming/src/main/java/org/eclipse/ditto/services/gateway/streaming/actors/StreamingSessionActor.java
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
* and fixed StreamingSessionActor which did not treat twin/live correctly

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
# Conflicts:
#	model/query/src/main/java/org/eclipse/ditto/model/query/model/query/QueryConstants.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/query/MongoAggregationBuilderFactory.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/query/MongoQueryBuilder.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/query/MongoQueryBuilderFactory.java
#	services/thingsearch/persistence/src/main/java/org/eclipse/ditto/services/thingsearch/persistence/read/query/PolicyRestrictedMongoSearchAggregation.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/read/PagingIT.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/read/query/MongoQueryBuilderFactoryTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/read/query/MongoQueryBuilderLimitedTest.java
#	services/thingsearch/persistence/src/test/java/org/eclipse/ditto/services/thingsearch/persistence/read/query/MongoQueryTest.java
#	services/thingsearch/starter/src/main/java/org/eclipse/ditto/services/thingsearch/starter/actors/SearchActor.java
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Philipp Michalski <Philipp.Michalski@bosch-si.com>
connectivity model

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
# Conflicts:
#	model/connectivity/src/main/java/org/eclipse/ditto/model/connectivity/ImmutableTarget.java
#	model/connectivity/src/test/java/org/eclipse/ditto/model/connectivity/UnmodifiableExternalMessageTest.java
#	services/gateway/endpoints/src/main/java/org/eclipse/ditto/services/gateway/endpoints/routes/sse/SseThingsRoute.java
#	services/gateway/endpoints/src/main/java/org/eclipse/ditto/services/gateway/endpoints/routes/websocket/WebsocketRoute.java
#	signals/commands/thingsearch/pom.xml
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Philipp Michalski <Philipp.Michalski@bosch-si.com>
thjaeckle and others added 11 commits September 11, 2018 12:56
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Philipp Michalski <Philipp.Michalski@bosch-si.com>
… new module ditto-model-rql

* in order to not have an unwanted ditto-model-thingsearch dependency if only RQL is required
* fixed package structure which had "model" twice in its path
* moved InvalidRqlExpressionException to ditto-model-rql

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
when RQL was invalid

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
* in ge, gt, le, lt - where Comparable is used
* try to convert them to BigDecimal and compare them
* if that fails, in the last effort, compare their string representations

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
@thjaeckle
Copy link
Member Author

Pair-Reviewed together with @phalski

@thjaeckle thjaeckle merged commit 7b54822 into eclipse-ditto:master Sep 17, 2018
@thjaeckle thjaeckle added this to the 0.8.0-M2 milestone Sep 21, 2018
@yufei-cai yufei-cai deleted the feature/rql-event-subscriptions branch June 13, 2019 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant