/** * Constructs a new Mapping Strategy for AMQP Bridge. */ public AmqpBridgeMappingStrategy() { this(new ThingsMappingStrategy()); }
/** * Returns a new {@link ThingTag}. * * @param id the ID of the modified Thing. * @param revision the revision of the modified Thing. * @return a new {@link ThingTag}. */ public static ThingTag of(final String id, final long revision) { return new ThingTag(id, revision); }
@Override public Map<String, BiFunction<JsonObject, DittoHeaders, Jsonifiable>> determineStrategy() { final MappingStrategiesBuilder builder = MappingStrategiesBuilder.newInstance(); addThingsStrategies(builder); addCommonStrategies(builder); addDevOpsStrategies(builder); addNamespacesStrategies(builder); return builder.build(); }
/** * Constructs a new Mapping Strategy for Gateway. */ public GatewayMappingStrategy() { policiesMappingStrategy = new PoliciesMappingStrategy(); thingsMappingStrategy = new ThingsMappingStrategy(); connectivityMappingStrategy = new ConnectivityMappingStrategy(thingsMappingStrategy); thingSearchMappingStrategy = new ThingSearchMappingStrategy(); }
private void processThingTag(final ThingTag thingTag) { LogUtil.enhanceLogWithCorrelationId(log, "things-tags-sync-" + thingTag.asIdentifierString()); log.debug("Received new Thing Tag for thing <{}> with revision <{}>: <{}>.", thingId, sequenceNumber, thingTag.asIdentifierString()); activeSyncMetadata = new SyncMetadata(getSender(), thingTag); if (thingTag.getRevision() > sequenceNumber) { log.info("The Thing Tag for the thing <{}> has the revision {} which is greater than the current actor's" + " sequence number <{}>.", thingId, thingTag.getRevision(), sequenceNumber); triggerSynchronization(); } else { ackSync(true); } }
@Override public Map<String, BiFunction<JsonObject, DittoHeaders, Jsonifiable>> determineStrategy() { final MappingStrategiesBuilder builder = MappingStrategiesBuilder.newInstance(); addThingsStrategies(builder); addDevOpsStrategies(builder); return builder.build(); } }
private static ThingTag createElement(final PidWithSeqNr pidWithSeqNr) { final String id = pidWithSeqNr.getPersistenceId() .replaceFirst(ThingPersistenceActor.PERSISTENCE_ID_PREFIX, ""); return ThingTag.of(id, pidWithSeqNr.getSequenceNr()); } }
private void processThingTag(final ThingTag thingTag) { final String elementIdentifier = thingTag.asIdentifierString(); LogUtil.enhanceLogWithCorrelationId(log, "things-tags-sync-" + elementIdentifier); log.debug("Forwarding incoming ThingTag '{}'", elementIdentifier); forwardJsonifiableToShardRegion(thingTag, ThingTag::getId); }
/** * Constructs a new {@code GatewayMappingStrategy} object. */ public GatewayMappingStrategy() { policiesMappingStrategy = new PoliciesMappingStrategy(); thingsMappingStrategy = new ThingsMappingStrategy(); connectivityMappingStrategy = new ConnectivityMappingStrategy(thingsMappingStrategy); thingSearchMappingStrategy = new ThingSearchMappingStrategy(); }
/** * Constructs a new Mapping Strategy for Connectivity service. */ public ConnectivityMappingStrategy() { this(new ThingsMappingStrategy()); }
private void processThingTag(final ThingTag thingTag) { LogUtil.enhanceLogWithCorrelationId(log, "things-tags-sync-" + thingTag.asIdentifierString()); log.debug("Received new Thing Tag for thing <{}> with revision <{}>: <{}>.", thingId, sequenceNumber, thingTag.asIdentifierString()); activeSyncMetadata = new SyncMetadata(getSender(), thingTag); if (thingTag.getRevision() > sequenceNumber) { log.info("The Thing Tag for the thing <{}> has the revision {} which is greater than the current actor's" + " sequence number <{}>.", thingId, thingTag.getRevision(), sequenceNumber); triggerSynchronization(); } else { ackSync(true); } }
/** * Returns a new {@link ThingTag}. * * @param id the ID of the modified Thing. * @param revision the revision of the modified Thing. * @return a new {@link ThingTag}. */ public static ThingTag of(final String id, final long revision) { return new ThingTag(id, revision); }
private static ThingTag createElement(final PidWithSeqNr pidWithSeqNr) { final String id = pidWithSeqNr.getPersistenceId() .replaceFirst(ThingPersistenceActor.PERSISTENCE_ID_PREFIX, ""); return ThingTag.of(id, pidWithSeqNr.getSequenceNr()); } }
private void processThingTag(final ThingTag thingTag) { final String elementIdentifier = thingTag.asIdentifierString(); LogUtil.enhanceLogWithCorrelationId(log, "things-tags-sync-" + elementIdentifier); log.debug("Forwarding incoming ThingTag '{}'", elementIdentifier); forwardJsonifiableToShardRegion(thingTag, ThingTag::getId); }
/** * Constructs a new Mapping Strategy. */ public ConciergeMappingStrategy() { policiesMappingStrategy = new PoliciesMappingStrategy(); thingsMappingStrategy = new ThingsMappingStrategy(); connectivityMappingStrategy = new ConnectivityMappingStrategy(thingsMappingStrategy); thingSearchMappingStrategy = new ThingSearchMappingStrategy(); batchMappingStrategy = new BatchMappingStrategy(); }
/** * Constructs a new Mapping Strategy for Things Search. */ public ThingSearchMappingStrategy() { policiesMappingStrategy = new PoliciesMappingStrategy(); thingsMappingStrategy = new ThingsMappingStrategy(); }
/** * Creates a new {@link ThingTag} from a JSON object. * * @param jsonObject the JSON object of which a new {@link ThingTag} is to be created. * @return the {@link ThingTag} which was created from the given JSON object. * @throws NullPointerException if {@code jsonObject} is {@code null}. * @throws IllegalArgumentException if {@code jsonObject} is empty. * @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} is not valid JSON. * @throws org.eclipse.ditto.json.JsonMissingFieldException if the passed in {@code jsonObject} was not in the * expected format. */ public static ThingTag fromJson(final JsonObject jsonObject) { return new ThingTag(jsonObject); }
/** * Constructs a new {@code ConciergeMappingStrategy} object. */ public ConciergeMappingStrategy() { policiesMappingStrategy = new PoliciesMappingStrategy(); thingsMappingStrategy = new ThingsMappingStrategy(); connectivityMappingStrategy = new ConnectivityMappingStrategy(thingsMappingStrategy); thingSearchMappingStrategy = new ThingSearchMappingStrategy(); batchMappingStrategy = new BatchMappingStrategy(); }
/** * Constructs a new {@code ThingsMappingStrategy} object. */ public ThingSearchMappingStrategy() { policiesMappingStrategy = new PoliciesMappingStrategy(); thingsMappingStrategy = new ThingsMappingStrategy(); }
/** * Creates a new {@link ThingTag} from a JSON object. * * @param jsonObject the JSON object of which a new {@link ThingTag} is to be created. * @return the {@link ThingTag} which was created from the given JSON object. * @throws NullPointerException if {@code jsonObject} is {@code null}. * @throws IllegalArgumentException if {@code jsonObject} is empty. * @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} is not valid JSON. * @throws org.eclipse.ditto.json.JsonMissingFieldException if the passed in {@code jsonObject} was not in the * expected format. */ public static ThingTag fromJson(final JsonObject jsonObject) { return new ThingTag(jsonObject); }