@Override public String asIdentifierString() { return entityId + ENTITY_ID_FROM_POLICY_TAG_SEPARATOR + policyTag.getRevision(); }
@Override public String asIdentifierString() { return entityId + ENTITY_ID_FROM_POLICY_TAG_SEPARATOR + policyTag.getRevision(); }
@Override public JsonValue toJson() { return JsonFactory.newObjectBuilder() .set(JsonFields.ENTITY_ID, entityId) .set(JsonFields.POLICY_ID, policyTag.getId()) .set(JsonFields.POLICY_REV, policyTag.getRevision()) .build(); }
@Override public JsonObject toJson() { return JsonFactory.newObjectBuilder() .set(JsonFields.ENTITY_ID, entityId) .set(JsonFields.POLICY_ID, policyTag.getId()) .set(JsonFields.POLICY_REV, policyTag.getRevision()) .build(); }
@Override public Source<String, NotUsed> getOutdatedThingIds(final PolicyTag policyTag) { log.debug("Retrieving outdated Thing ids with policy tag: <{}>", policyTag); final String policyId = policyTag.getId(); final Bson filter = and(eq(FIELD_POLICY_ID, policyId), lt(FIELD_POLICY_REVISION, policyTag.getRevision())); final Publisher<Document> publisher = collection.find(filter).projection(new BsonDocument(FIELD_ID, new BsonInt32(1))); return Source.fromPublisher(publisher) .map(doc -> doc.getString(FIELD_ID)); }
@Override public Source<String, NotUsed> getOutdatedThingIds(final PolicyTag policyTag) { log.debug("Retrieving outdated Thing ids with policy tag: <{}>", policyTag); final String policyId = policyTag.getId(); final Bson filter = and(eq(FIELD_POLICY_ID, policyId), lt(FIELD_POLICY_REVISION, policyTag.getRevision())); final Publisher<Document> publisher = collection.find(filter).projection(new BsonDocument(FIELD_ID, new BsonInt32(1))); return Source.fromPublisher(publisher) .map(doc -> doc.getString(FIELD_ID)); }
} else if (policyReferenceTag.getPolicyTag().getRevision() > policyRevision) { log.info("The Policy-Reference-Tag has a revision which is greater " + "than the current policy-revision <{}> for thing <{}>: <{}>.", policyRevision, thingId,
} else if (policyReferenceTag.getPolicyTag().getRevision() > policyRevision) { log.info("The Policy-Reference-Tag has a revision which is greater " + "than the current policy-revision <{}> for thing <{}>: <{}>.", policyRevision, thingId,