Skip to content
Permalink
Browse files

Rename classes the use short "Ops" in their name to "PersistenceOpera…

…tions"

Signed-off-by: Klem Yannic (INST/ECS1) <yannic.klem@bosch-si.com>
  • Loading branch information
Yannic92 committed May 13, 2019
1 parent 93821eb commit e691c4d0669c5a217a0032d48795eff14f84d952
Showing with 206 additions and 175 deletions.
  1. +9 −8 ...ivity/messaging/persistence/{ConnectionOpsActor.java → ConnectionPersistenceOperationsActor.java}
  2. +2 −2 ...y/starter/src/main/java/org/eclipse/ditto/services/connectivity/actors/ConnectivityRootActor.java
  3. +4 −4 ...y/messaging/persistence/{ConnectionOpsActorIT.java → ConnectionPersistenceOperationsActorIT.java}
  4. +12 −12 .../policies/persistence/actors/policy/{PolicyOpsActor.java → PolicyPersistenceOperationsActor.java}
  5. +2 −2 ...policies/starter/src/main/java/org/eclipse/ditto/services/policies/starter/PoliciesRootActor.java
  6. +5 −5 ...ies/persistence/actors/policies/{PolicyOpsActorIT.java → PolicyPersistenceOperationsActorIT.java}
  7. +9 −8 ...to/services/things/persistence/actors/{ThingOpsActor.java → ThingPersistenceOperationsActor.java}
  8. +3 −2 services/things/starter/src/main/java/org/eclipse/ditto/services/things/starter/ThingsRootActor.java
  9. +4 −4 ...ervices/things/persistence/actors/{ThingOpsActorIT.java → ThingPersistenceOperationsActorIT.java}
  10. +2 −2 ...java/org/eclipse/ditto/services/thingsearch/persistence/write/ThingsSearchUpdaterPersistence.java
  11. +2 −2 ...s/src/main/java/org/eclipse/ditto/services/thingsearch/updater/actors/SearchUpdaterRootActor.java
  12. +7 −6 ...ngsearch/updater/actors/{ThingsSearchOpsActor.java → ThingsSearchPersistenceOperationsActor.java}
  13. +13 −11 ...ces/utils/persistence/mongo/ops/{AbstractOpsActor.java → AbstractPersistenceOperationsActor.java}
  14. +1 −1 .../ditto/services/utils/persistence/mongo/ops/{EntitiesOps.java → EntityPersistenceOperations.java}
  15. +2 −2 ...to/services/utils/persistence/mongo/ops/{NamespaceOps.java → NamespacePersistenceOperations.java}
  16. +15 −12 ...rsistence/mongo/ops/eventsource/{MongoEntitiesOps.java → MongoEntitiesPersistenceOperations.java}
  17. +15 −12 ...istence/mongo/ops/eventsource/{MongoNamespaceOps.java → MongoNamespacePersistenceOperations.java}
  18. +5 −5 ...istence/mongo/ops/eventsource/{MongoOpsSelection.java → MongoPersistenceOperationsSelection.java}
  19. +22 −21 ...s/eventsource/{MongoOpsSelectionProvider.java → MongoPersistenceOperationsSelectionProvider.java}
  20. +1 −2 .../eclipse/ditto/services/utils/persistence/mongo/ops/eventsource/MongoEventSourceITAssertions.java
  21. +52 −42 ...ource/{MongoOpsSelectionProviderTest.java → MongoPersistenceOperationsSelectionProviderTest.java}
  22. +16 −10 ...mongo/ops/eventsource/{MongoOpsSelectionTest.java → MongoPersistenceOperationsSelectionTest.java}
  23. +3 −0 signals/commands/common/src/main/java/org/eclipse/ditto/signals/commands/common/CommonCommand.java
@@ -16,9 +16,9 @@

import org.eclipse.ditto.services.connectivity.messaging.ConnectionActor;
import org.eclipse.ditto.services.utils.persistence.mongo.MongoClientWrapper;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.AbstractOpsActor;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.EntitiesOps;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.eventsource.MongoEntitiesOps;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.AbstractPersistenceOperationsActor;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.EntityPersistenceOperations;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.eventsource.MongoEntitiesPersistenceOperations;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.eventsource.MongoEventSourceSettings;
import org.eclipse.ditto.signals.commands.connectivity.ConnectivityCommand;

@@ -31,11 +31,12 @@
/**
* Ops for the event-sourcing persistence of things.
*/
public final class ConnectionOpsActor extends AbstractOpsActor {
public final class ConnectionPersistenceOperationsActor extends AbstractPersistenceOperationsActor {

public static final String ACTOR_NAME = "connectionOps";

private ConnectionOpsActor(final ActorRef pubSubMediator, final EntitiesOps entitiesOps,
private ConnectionPersistenceOperationsActor(final ActorRef pubSubMediator,
final EntityPersistenceOperations entitiesOps,
final MongoClientWrapper mongoClientWrapper) {

super(pubSubMediator, ConnectivityCommand.RESOURCE_TYPE, null, entitiesOps,
@@ -50,17 +51,17 @@ private ConnectionOpsActor(final ActorRef pubSubMediator, final EntitiesOps enti
* @return a Props object.
*/
public static Props props(final ActorRef pubSubMediator, final Config config) {
return Props.create(ConnectionOpsActor.class, () -> {
return Props.create(ConnectionPersistenceOperationsActor.class, () -> {
final MongoEventSourceSettings eventSourceSettings =
MongoEventSourceSettings.fromConfig(config, ConnectionActor.PERSISTENCE_ID_PREFIX, false,
ConnectionActor.JOURNAL_PLUGIN_ID, ConnectionActor.SNAPSHOT_PLUGIN_ID);

final MongoClientWrapper mongoClient = MongoClientWrapper.newInstance(config);
final MongoDatabase db = mongoClient.getDefaultDatabase();

final EntitiesOps entitiesOps = MongoEntitiesOps.of(db, eventSourceSettings);
final EntityPersistenceOperations entitiesOps = MongoEntitiesPersistenceOperations.of(db, eventSourceSettings);

return new ConnectionOpsActor(pubSubMediator, entitiesOps, mongoClient);
return new ConnectionPersistenceOperationsActor(pubSubMediator, entitiesOps, mongoClient);
});
}

@@ -34,7 +34,7 @@
import org.eclipse.ditto.services.connectivity.messaging.ConnectionSupervisorActor;
import org.eclipse.ditto.services.connectivity.messaging.DefaultClientActorPropsFactory;
import org.eclipse.ditto.services.connectivity.messaging.ReconnectActor;
import org.eclipse.ditto.services.connectivity.messaging.persistence.ConnectionOpsActor;
import org.eclipse.ditto.services.connectivity.messaging.persistence.ConnectionPersistenceOperationsActor;
import org.eclipse.ditto.services.connectivity.util.ConfigKeys;
import org.eclipse.ditto.services.models.concierge.ConciergeMessagingConstants;
import org.eclipse.ditto.services.models.concierge.actors.ConciergeForwarderActor;
@@ -206,7 +206,7 @@ private ConnectivityRootActor(final ServiceConfigReader configReader, final Acto
startClusterSingletonActor(ReconnectActor.ACTOR_NAME, ReconnectActor.props(connectionShardRegion,
mongoReadJournal::currentPersistenceIds));

startChildActor(ConnectionOpsActor.ACTOR_NAME, ConnectionOpsActor.props(pubSubMediator, config));
startChildActor(ConnectionPersistenceOperationsActor.ACTOR_NAME, ConnectionPersistenceOperationsActor.props(pubSubMediator, config));

String hostname = config.getString(ConfigKeys.Http.HOSTNAME);
if (hostname.isEmpty()) {
@@ -45,10 +45,10 @@
import akka.testkit.TestProbe;

/**
* Tests {@link ConnectionOpsActor}.
* Tests {@link ConnectionPersistenceOperationsActor}.
*/
@AllValuesAreNonnullByDefault
public final class ConnectionOpsActorIT extends MongoEventSourceITAssertions {
public final class ConnectionPersistenceOperationsActorIT extends MongoEventSourceITAssertions {

@Test
public void purgeEntitiesWithoutNamespace() {
@@ -103,8 +103,8 @@ protected Object getRetrieveEntityCommand(final String id) {
protected ActorRef startActorUnderTest(final ActorSystem actorSystem, final ActorRef pubSubMediator,
final Config config) {

final Props opsActorProps = ConnectionOpsActor.props(pubSubMediator, config);
return actorSystem.actorOf(opsActorProps, ConnectionOpsActor.ACTOR_NAME);
final Props opsActorProps = ConnectionPersistenceOperationsActor.props(pubSubMediator, config);
return actorSystem.actorOf(opsActorProps, ConnectionPersistenceOperationsActor.ACTOR_NAME);
}

@Override
@@ -15,12 +15,12 @@
import java.util.Collections;

import org.eclipse.ditto.services.utils.persistence.mongo.MongoClientWrapper;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.AbstractOpsActor;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.EntitiesOps;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.NamespaceOps;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.eventsource.MongoEntitiesOps;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.AbstractPersistenceOperationsActor;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.EntityPersistenceOperations;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.NamespacePersistenceOperations;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.eventsource.MongoEntitiesPersistenceOperations;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.eventsource.MongoEventSourceSettings;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.eventsource.MongoNamespaceOps;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.eventsource.MongoNamespacePersistenceOperations;
import org.eclipse.ditto.signals.commands.policies.PolicyCommand;
import org.eclipse.ditto.utils.jsr305.annotations.AllValuesAreNonnullByDefault;

@@ -34,12 +34,12 @@
* Ops for the event-sourcing persistence of policies.
*/
@AllValuesAreNonnullByDefault
public final class PolicyOpsActor extends AbstractOpsActor {
public final class PolicyPersistenceOperationsActor extends AbstractPersistenceOperationsActor {

public static final String ACTOR_NAME = "policyOps";

private PolicyOpsActor(final ActorRef pubSubMediator, final NamespaceOps namespaceOps,
final EntitiesOps entitiesOps, final MongoClientWrapper mongoClient) {
private PolicyPersistenceOperationsActor(final ActorRef pubSubMediator, final NamespacePersistenceOperations namespaceOps,
final EntityPersistenceOperations entitiesOps, final MongoClientWrapper mongoClient) {
super(pubSubMediator, PolicyCommand.RESOURCE_TYPE, namespaceOps, entitiesOps,
Collections.singleton(mongoClient));
}
@@ -52,18 +52,18 @@ private PolicyOpsActor(final ActorRef pubSubMediator, final NamespaceOps namespa
* @return a Props object.
*/
public static Props props(final ActorRef pubSubMediator, final Config config) {
return Props.create(PolicyOpsActor.class, () -> {
return Props.create(PolicyPersistenceOperationsActor.class, () -> {
final MongoEventSourceSettings eventSourceSettings =
MongoEventSourceSettings.fromConfig(config, PolicyPersistenceActor.PERSISTENCE_ID_PREFIX, true,
PolicyPersistenceActor.JOURNAL_PLUGIN_ID, PolicyPersistenceActor.SNAPSHOT_PLUGIN_ID);

final MongoClientWrapper mongoClient = MongoClientWrapper.newInstance(config);
final MongoDatabase db = mongoClient.getDefaultDatabase();

final NamespaceOps namespaceOps = MongoNamespaceOps.of(db, eventSourceSettings);
final EntitiesOps entitiesOps = MongoEntitiesOps.of(db, eventSourceSettings);
final NamespacePersistenceOperations namespaceOps = MongoNamespacePersistenceOperations.of(db, eventSourceSettings);
final EntityPersistenceOperations entitiesOps = MongoEntitiesPersistenceOperations.of(db, eventSourceSettings);

return new PolicyOpsActor(pubSubMediator, namespaceOps, entitiesOps, mongoClient);
return new PolicyPersistenceOperationsActor(pubSubMediator, namespaceOps, entitiesOps, mongoClient);
});
}

@@ -28,7 +28,7 @@
import org.eclipse.ditto.services.base.config.ServiceConfigReader;
import org.eclipse.ditto.services.models.policies.PoliciesMessagingConstants;
import org.eclipse.ditto.services.policies.persistence.actors.policies.PoliciesPersistenceStreamingActorCreator;
import org.eclipse.ditto.services.policies.persistence.actors.policy.PolicyOpsActor;
import org.eclipse.ditto.services.policies.persistence.actors.policy.PolicyPersistenceOperationsActor;
import org.eclipse.ditto.services.policies.persistence.actors.policy.PolicySupervisorActor;
import org.eclipse.ditto.services.policies.util.ConfigKeys;
import org.eclipse.ditto.services.utils.akka.LogUtil;
@@ -159,7 +159,7 @@ private PoliciesRootActor(final ServiceConfigReader configReader,
.start(PoliciesMessagingConstants.SHARD_REGION, policySupervisorProps, shardingSettings,
ShardRegionExtractor.of(numberOfShards, getContext().getSystem()));

startChildActor(PolicyOpsActor.ACTOR_NAME, PolicyOpsActor.props(pubSubMediator, config));
startChildActor(PolicyPersistenceOperationsActor.ACTOR_NAME, PolicyPersistenceOperationsActor.props(pubSubMediator, config));

retrieveStatisticsDetailsResponseSupplier = RetrieveStatisticsDetailsResponseSupplier.of(policiesShardRegion,
PoliciesMessagingConstants.SHARD_REGION, log);
@@ -21,7 +21,7 @@
import org.eclipse.ditto.model.policies.Policy;
import org.eclipse.ditto.model.policies.Resource;
import org.eclipse.ditto.model.policies.SubjectType;
import org.eclipse.ditto.services.policies.persistence.actors.policy.PolicyOpsActor;
import org.eclipse.ditto.services.policies.persistence.actors.policy.PolicyPersistenceOperationsActor;
import org.eclipse.ditto.services.policies.persistence.actors.policy.PolicySupervisorActor;
import org.eclipse.ditto.services.policies.persistence.serializer.PolicyMongoSnapshotAdapter;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.eventsource.MongoEventSourceITAssertions;
@@ -41,10 +41,10 @@
import akka.actor.Props;

/**
* Tests {@link PolicyOpsActor}.
* Tests {@link PolicyPersistenceOperationsActor}.
*/
@AllValuesAreNonnullByDefault
public final class PolicyOpsActorIT extends MongoEventSourceITAssertions {
public final class PolicyPersistenceOperationsActorIT extends MongoEventSourceITAssertions {

@Test
public void purgeNamespaceWithoutSuffix() {
@@ -111,8 +111,8 @@ protected Object getRetrieveEntityCommand(final String id) {
protected ActorRef startActorUnderTest(final ActorSystem actorSystem, final ActorRef pubSubMediator,
final Config config) {

final Props opsActorProps = PolicyOpsActor.props(pubSubMediator, config);
return actorSystem.actorOf(opsActorProps, PolicyOpsActor.ACTOR_NAME);
final Props opsActorProps = PolicyPersistenceOperationsActor.props(pubSubMediator, config);
return actorSystem.actorOf(opsActorProps, PolicyPersistenceOperationsActor.ACTOR_NAME);
}

@Override
@@ -15,10 +15,10 @@
import java.util.Collections;

import org.eclipse.ditto.services.utils.persistence.mongo.MongoClientWrapper;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.AbstractOpsActor;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.NamespaceOps;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.AbstractPersistenceOperationsActor;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.NamespacePersistenceOperations;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.eventsource.MongoEventSourceSettings;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.eventsource.MongoNamespaceOps;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.eventsource.MongoNamespacePersistenceOperations;
import org.eclipse.ditto.signals.commands.things.ThingCommand;
import org.eclipse.ditto.utils.jsr305.annotations.AllValuesAreNonnullByDefault;

@@ -32,11 +32,12 @@
* Ops for the event-sourcing persistence of things.
*/
@AllValuesAreNonnullByDefault
public final class ThingOpsActor extends AbstractOpsActor {
public final class ThingPersistenceOperationsActor extends AbstractPersistenceOperationsActor {

public static final String ACTOR_NAME = "thingOps";

private ThingOpsActor(final ActorRef pubSubMediator, final NamespaceOps namespaceOps,
private ThingPersistenceOperationsActor(final ActorRef pubSubMediator,
final NamespacePersistenceOperations namespaceOps,
final MongoClientWrapper mongoClientWrapper) {

super(pubSubMediator, ThingCommand.RESOURCE_TYPE, namespaceOps, null,
@@ -51,17 +52,17 @@ private ThingOpsActor(final ActorRef pubSubMediator, final NamespaceOps namespac
* @return a Props object.
*/
public static Props props(final ActorRef pubSubMediator, final Config config) {
return Props.create(ThingOpsActor.class, () -> {
return Props.create(ThingPersistenceOperationsActor.class, () -> {
final MongoEventSourceSettings eventSourceSettings =
MongoEventSourceSettings.fromConfig(config, ThingPersistenceActor.PERSISTENCE_ID_PREFIX, true,
ThingPersistenceActor.JOURNAL_PLUGIN_ID, ThingPersistenceActor.SNAPSHOT_PLUGIN_ID);

final MongoClientWrapper mongoClient = MongoClientWrapper.newInstance(config);
final MongoDatabase db = mongoClient.getDefaultDatabase();

final NamespaceOps namespaceOps = MongoNamespaceOps.of(db, eventSourceSettings);
final NamespacePersistenceOperations namespaceOps = MongoNamespacePersistenceOperations.of(db, eventSourceSettings);

return new ThingOpsActor(pubSubMediator, namespaceOps, mongoClient);
return new ThingPersistenceOperationsActor(pubSubMediator, namespaceOps, mongoClient);
});
}

@@ -26,7 +26,7 @@
import org.eclipse.ditto.services.base.config.HttpConfigReader;
import org.eclipse.ditto.services.base.config.ServiceConfigReader;
import org.eclipse.ditto.services.models.things.ThingsMessagingConstants;
import org.eclipse.ditto.services.things.persistence.actors.ThingOpsActor;
import org.eclipse.ditto.services.things.persistence.actors.ThingPersistenceOperationsActor;
import org.eclipse.ditto.services.things.persistence.actors.ThingSupervisorActor;
import org.eclipse.ditto.services.things.persistence.actors.ThingsPersistenceStreamingActorCreator;
import org.eclipse.ditto.services.things.persistence.snapshotting.ThingSnapshotter;
@@ -162,7 +162,8 @@ private ThingsRootActor(final ServiceConfigReader configReader,
shardingSettings,
ShardRegionExtractor.of(numberOfShards, getContext().getSystem()));

startChildActor(ThingOpsActor.ACTOR_NAME, ThingOpsActor.props(pubSubMediator, config));
startChildActor(
ThingPersistenceOperationsActor.ACTOR_NAME, ThingPersistenceOperationsActor.props(pubSubMediator, config));

retrieveStatisticsDetailsResponseSupplier = RetrieveStatisticsDetailsResponseSupplier.of(thingsShardRegion,
ThingsMessagingConstants.SHARD_REGION, log);
@@ -33,10 +33,10 @@
import akka.actor.Props;

/**
* Tests {@link ThingOpsActor} against a local MongoDB.
* Tests {@link ThingPersistenceOperationsActor} against a local MongoDB.
*/
@AllValuesAreNonnullByDefault
public final class ThingOpsActorIT extends MongoEventSourceITAssertions {
public final class ThingPersistenceOperationsActorIT extends MongoEventSourceITAssertions {

@Test
public void purgeNamespaceWithoutSuffix() {
@@ -88,8 +88,8 @@ protected Object getRetrieveEntityCommand(final String id) {
protected ActorRef startActorUnderTest(final ActorSystem actorSystem, final ActorRef pubSubMediator,
final Config config) {

final Props opsActorProps = ThingOpsActor.props(pubSubMediator, config);
return actorSystem.actorOf(opsActorProps, ThingOpsActor.ACTOR_NAME);
final Props opsActorProps = ThingPersistenceOperationsActor.props(pubSubMediator, config);
return actorSystem.actorOf(opsActorProps, ThingPersistenceOperationsActor.ACTOR_NAME);
}

@Override
@@ -16,15 +16,15 @@

import org.eclipse.ditto.services.models.policies.PolicyReferenceTag;
import org.eclipse.ditto.services.models.policies.PolicyTag;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.NamespaceOps;
import org.eclipse.ditto.services.utils.persistence.mongo.ops.NamespacePersistenceOperations;

import akka.NotUsed;
import akka.stream.javadsl.Source;

/**
* The persistence for the search updater service.
*/
public interface ThingsSearchUpdaterPersistence extends NamespaceOps {
public interface ThingsSearchUpdaterPersistence extends NamespacePersistenceOperations {

/**
* Retrieves modifiable unsorted list of policy reference tags that match the given policy IDs.
@@ -129,8 +129,8 @@ private SearchUpdaterRootActor(final ServiceConfigReader configReader,
final Props manualUpdaterProps = ManualUpdater.props(dittoMongoClient.getDefaultDatabase(), thingsUpdaterActor);
startClusterSingletonActor(ManualUpdater.ACTOR_NAME, manualUpdaterProps);

startChildActor(ThingsSearchOpsActor.ACTOR_NAME,
ThingsSearchOpsActor.props(pubSubMediator, searchUpdaterPersistence));
startChildActor(ThingsSearchPersistenceOperationsActor.ACTOR_NAME,
ThingsSearchPersistenceOperationsActor.props(pubSubMediator, searchUpdaterPersistence));

final boolean thingsSynchronizationActive = config.getBoolean(ConfigKeys.THINGS_SYNCER_ACTIVE);
if (thingsSynchronizationActive) {

0 comments on commit e691c4d

Please sign in to comment.
You can’t perform that action at this time.