private void validateExchangeDeclareArguments(final Map<String, Object> attributes, final Model model) { final ConfiguredObjectTypeRegistry typeRegistry = model.getTypeRegistry(); final List<ConfiguredObjectAttribute<?, ?>> types = new ArrayList<>(typeRegistry.getAttributeTypes(Exchange.class).values()); typeRegistry.getTypeSpecialisations(Exchange.class).forEach(type -> types.addAll(typeRegistry.getTypeSpecificAttributes(type))); final Set<String> unsupported = attributes.keySet() .stream() .filter(name -> types.stream().noneMatch(a -> Objects.equals(name, a.getName()) && !a.isDerived())) .collect(Collectors.toSet()); if (!unsupported.isEmpty()) { throw new IllegalArgumentException(String.format( "Unsupported exchange declare arguments : %s", String.join(",", unsupported))); } }
private void validateExchangeDeclareArguments(final Map<String, Object> attributes) { final ConfiguredObjectTypeRegistry typeRegistry = getModel().getTypeRegistry(); final List<ConfiguredObjectAttribute<?, ?>> types = new ArrayList<>(typeRegistry.getAttributeTypes(Exchange.class).values()); typeRegistry.getTypeSpecialisations(Exchange.class).forEach(type -> types.addAll(typeRegistry.getTypeSpecificAttributes(type))); final Set<String> unsupported = attributes.keySet() .stream() .filter(name -> types.stream().noneMatch(a -> Objects.equals(name, a.getName()) && !a.isDerived())) .collect(Collectors.toSet()); if (!unsupported.isEmpty()) { throw new IllegalArgumentException(String.format( "Unsupported exchange declare arguments : %s", String.join(",", unsupported))); } }
private Map<String, Map> processCategory(final Class<? extends ConfiguredObject> clazz, final Model model) { Map<String, Map> typeToDataMap = new TreeMap<>(); ConfiguredObjectTypeRegistry typeRegistry = model.getTypeRegistry(); for (Class<? extends ConfiguredObject> type : typeRegistry.getTypeSpecialisations(clazz)) { typeToDataMap.put(ConfiguredObjectTypeRegistry.getType(type), processType(type, model)); } return typeToDataMap; }
final List<ConfiguredObjectAttribute<?, ?>> attributeTypes = new ArrayList<>(typeRegistry.getAttributeTypes(Queue.class).values()); typeRegistry.getTypeSpecialisations(Queue.class) .forEach(type -> attributeTypes.addAll(typeRegistry.getTypeSpecificAttributes(type)));
.getTypeRegistry().getTypeSpecialisations(configuredClass)); _typeSpecialisations.putIfAbsent(configuredClass, types);