/** * Aggregates intents of a binding by walking the implementation and structural hierarchies of the parent. * * @param binding the binding * @return the aggregated intents */ protected Set<QName> aggregateIntents(LogicalBinding<?> binding) throws PolicyResolutionException { Bindable parent = binding.getParent(); Set<QName> aggregatedIntents = new LinkedHashSet<>(); // add binding intents aggregatedIntents.addAll(binding.getIntents()); validateIntents(binding); if (parent instanceof LogicalReference) { return aggregateReferenceIntents((LogicalReference) parent, aggregatedIntents); } else if (parent instanceof LogicalService) { return aggregateServiceIntents((LogicalService) parent, aggregatedIntents); } else { // channel LogicalChannel channel = (LogicalChannel) parent; aggregatedIntents.addAll(channel.getDefinition().getIntents()); aggregatedIntents.addAll(channel.getIntents()); return aggregatedIntents; } }