diff --git a/internal/utils/persistent-actors/src/main/java/org/eclipse/ditto/internal/utils/persistentactors/condition/package-info.java b/internal/utils/persistent-actors/src/main/java/org/eclipse/ditto/internal/utils/persistentactors/condition/package-info.java deleted file mode 100644 index 8e8e30ac54..0000000000 --- a/internal/utils/persistent-actors/src/main/java/org/eclipse/ditto/internal/utils/persistentactors/condition/package-info.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ - -/** - * Entity-tag handlers. - */ -@org.eclipse.ditto.utils.jsr305.annotations.AllValuesAreNonnullByDefault -package org.eclipse.ditto.internal.utils.persistentactors.condition; diff --git a/things/model/src/main/java/org/eclipse/ditto/things/model/signals/events/ThingMerged.java b/things/model/src/main/java/org/eclipse/ditto/things/model/signals/events/ThingMerged.java index f199c0820a..5a280a94a5 100644 --- a/things/model/src/main/java/org/eclipse/ditto/things/model/signals/events/ThingMerged.java +++ b/things/model/src/main/java/org/eclipse/ditto/things/model/signals/events/ThingMerged.java @@ -210,16 +210,16 @@ public String toString() { /** * An enumeration of the JSON fields of a {@code ThingMerged} event. */ - static final class JsonFields { + public static final class JsonFields { private JsonFields() { throw new AssertionError(); } - static final JsonFieldDefinition JSON_PATH = + public static final JsonFieldDefinition JSON_PATH = JsonFactory.newStringFieldDefinition("path", FieldType.REGULAR, JsonSchemaVersion.V_2); - static final JsonFieldDefinition JSON_VALUE = + public static final JsonFieldDefinition JSON_VALUE = JsonFactory.newJsonValueFieldDefinition("value", FieldType.REGULAR, JsonSchemaVersion.V_2); } } diff --git a/things/service/src/main/java/org/eclipse/ditto/things/service/persistence/serializer/ThingMongoEventAdapter.java b/things/service/src/main/java/org/eclipse/ditto/things/service/persistence/serializer/ThingMongoEventAdapter.java index ba7d45a8ec..9e4c3b6cd6 100644 --- a/things/service/src/main/java/org/eclipse/ditto/things/service/persistence/serializer/ThingMongoEventAdapter.java +++ b/things/service/src/main/java/org/eclipse/ditto/things/service/persistence/serializer/ThingMongoEventAdapter.java @@ -22,6 +22,7 @@ import org.eclipse.ditto.json.JsonPointer; import org.eclipse.ditto.policies.model.Policy; import org.eclipse.ditto.things.model.signals.events.ThingEvent; +import org.eclipse.ditto.things.model.signals.events.ThingMerged; import org.eclipse.ditto.things.service.common.config.DefaultThingConfig; import akka.actor.ExtendedActorSystem; @@ -35,6 +36,10 @@ public final class ThingMongoEventAdapter extends AbstractMongoEventAdapter event, final JsonObject jsonObject) { - return super.performToJournalMigration(event, jsonObject) - .remove(POLICY_IN_THING_EVENT_PAYLOAD); // remove the policy entries from thing event payload + if (event instanceof ThingMerged) { + return super.performToJournalMigration(event, jsonObject) + .remove(POLICY_IN_THING_MERGED_VALUE_PAYLOAD); // remove the policy entries from thing merged payload + } else { + return super.performToJournalMigration(event, jsonObject) + .remove(POLICY_IN_THING_EVENT_PAYLOAD); // remove the policy entries from thing event payload + } } }