private void validatePublishments() { Collection<PolicyDefinition> definitions = context.getPolicies().values(); for (Publishment p : context.getPublishments().values()) { //TODO: check type; check serializer types; check dedup fields existence; check extend deduplicator... Set<String> unknown = p.getPolicyIds().stream().filter(pid -> definitions.stream().anyMatch(pd -> pd.getName().equals(pid))).collect(Collectors.toSet()); if (unknown.size() > 0) { state.appendPublishemtnValidation(p.getName(), String.format("publishment %s reference unknown/uneabled policy %s!", p.getName(), unknown)); } } }
public InMemScheduleConext(IScheduleContext context) { this.topologies = new HashMap<String, Topology>(context.getTopologies()); this.usages = new HashMap<String, TopologyUsage>(context.getTopologyUsages()); this.policies = new HashMap<String, PolicyDefinition>(context.getPolicies()); this.datasources = new HashMap<String, Kafka2TupleMetadata>(context.getDataSourceMetadata()); this.policyAssignments = new HashMap<String, PolicyAssignment>(context.getPolicyAssignments()); this.schemas = new HashMap<String, StreamDefinition>(context.getStreamSchemas()); this.monitoredStreams = new HashMap<StreamGroup, MonitoredStream>(context.getMonitoredStreams()); this.publishments = new HashMap<String, Publishment>(context.getPublishments()); }
for (Publishment pub : context.getPublishments().values()) { for (String policyId : pub.getPolicyIds()) { List<Publishment> policyPubs = policyToPub.get(policyId);
private void validatePolicies() { Collection<Publishment> pubs = context.getPublishments().values(); for (PolicyDefinition pd : context.getPolicies().values()) { if (!pubs.stream().anyMatch(p -> p.getPolicyIds().contains(pd.getName()))) {
alertSpec.addBoltPolicy(boltUsage.getBoltId(), definition.getName()); for (Publishment publish : context.getPublishments().values()) { if (!publish.getPolicyIds().contains(definition.getName())) { continue;
for (Entry<String, Publishment> entry : context.getPublishments().entrySet()) { if (publishmentName.equals(entry.getKey())) { publishment = entry.getValue();