private Predicate<ConfiguredObject<?>> buildFilterPredicates(final Map<String, List<String>> parameters) { return parameters.entrySet().stream() .filter(entry -> !RESERVED_PARAMS.contains(entry.getKey())) .map(entry -> { final String paramName = entry.getKey(); final List<String> allowedValues = entry.getValue(); return (Predicate<ConfiguredObject<?>>) object -> { Object value = object.getAttribute(paramName); return allowedValues.contains(String.valueOf(value)); }; }).reduce(Predicate::and).orElse(t -> true); }
private Object getValue(final ConfiguredObject<?> object) { if(SPECIAL_ATTRIBUTES.contains(_propertyName)) { if(PARENT_ATTR.equals(_propertyName)) { return object.getParent(); } else { return null; } } else { return object.getAttributeNames().contains(_propertyName) ? object.getAttribute(_propertyName) : object.getStatistics().get(_propertyName); } }
@Override public Object getAttribute(final String name) { return convertIntoLegacyIfRequired(name, _configuredObject.getAttribute(name)); }
Object value = referrer.getAttribute(name); if (value != null)
@Override public Object evaluate(final ConfiguredObject<?> object) { Object propertyValue = object == null ? null : object.getAttribute(_propertyName); if(propertyValue instanceof Collection) { Iterator iter = ((Collection)propertyValue).iterator(); int pos = 0; while(iter.hasNext() && pos < _index) { iter.next(); } if(pos == _index && iter.hasNext()) { return iter.next(); } } return null; } }
converterOptions.isUseActualValues() ? confObject.getActualAttributes().get(name) : confObject.getAttribute(name); if (value instanceof ConfiguredObject) value = confObject.getAttribute(name);
Object returnVal = _object.getAttribute(attrName); String returnString; if (returnVal == null)
private void setQueueProperties(ConfiguredObject<?> queue, ObjectProperties properties) { properties.setName((String)queue.getAttribute(Exchange.NAME)); Object lifeTimePolicy = queue.getAttribute(ConfiguredObject.LIFETIME_POLICY); properties.put(ObjectProperties.Property.AUTO_DELETE, lifeTimePolicy != LifetimePolicy.PERMANENT); properties.put(ObjectProperties.Property.TEMPORARY, lifeTimePolicy != LifetimePolicy.PERMANENT); properties.put(ObjectProperties.Property.DURABLE, (Boolean)queue.getAttribute(ConfiguredObject.DURABLE)); properties.put(ObjectProperties.Property.EXCLUSIVE, queue.getAttribute(Queue.EXCLUSIVE) != ExclusivityPolicy.NONE); if (queue.getAttribute(Queue.CREATED_BY) != null) { properties.put(ObjectProperties.Property.CREATED_BY, (String) queue.getAttribute(Queue.CREATED_BY)); } Object alternateBinding = queue.getAttribute(Queue.ALTERNATE_BINDING); if (alternateBinding instanceof AlternateBinding) { String name = ((AlternateBinding)alternateBinding).getDestination(); if (name != null && !"".equals(name)) { properties.put(ObjectProperties.Property.ALTERNATE, name); } } String owner = (String)queue.getAttribute(Queue.OWNER); if (owner != null) { properties.put(ObjectProperties.Property.OWNER, owner); } VirtualHost virtualHost = (VirtualHost) queue.getParent(); properties.put(ObjectProperties.Property.VIRTUALHOST_NAME, (String)virtualHost.getAttribute(VirtualHost.NAME)); }
Map<String, String> context = (Map<String, String>) proxyForValidation.getAttribute(CONTEXT); if (context.containsKey(BROKER_FAIL_STARTUP_WITH_ERRORED_CHILD_SCOPE))
Object returnVal = ancestorOrSelf.getAttribute(attributeName); String returnString; if (returnVal == null)
String objectName = (String) configuredObject.getAttribute(ConfiguredObject.NAME); String operationName = operation.getName().equals(operation.getType().name()) ? operation.getName() .append(parent.getAttribute(ConfiguredObject.NAME)) .append("'");
protected Object getValue(final ConfiguredObjectAttribute attribute) { Object value; if(!attribute.isDerived()) { ConfiguredSettableAttribute settableAttr = (ConfiguredSettableAttribute) attribute; value = _attributes.get(attribute.getName()); if (value == null && !"".equals(settableAttr.defaultValue())) { value = settableAttr.defaultValue(); } return convert(settableAttr, value); } else { if(_attributes.containsKey(attribute.getName())) { return _attributes.get(attribute.getName()); } else if(_configuredObject != null) { return _configuredObject.getAttribute(attribute.getName()); } else { return null; } } }
properties.put(ObjectProperties.Property.VIRTUALHOST_NAME, (String)virtualHost.getAttribute(VirtualHost.NAME)); if (object.getAttribute(ConfiguredObject.CREATED_BY) != null) properties.put(ObjectProperties.Property.CREATED_BY, (String) object.getAttribute(ConfiguredObject.CREATED_BY));
String createdBy = configuredObject instanceof ConfiguredObject<?> ? (String) ((ConfiguredObject) configuredObject).getAttribute(ConfiguredObject.CREATED_BY) : null; final ObjectProperties properties = new ObjectProperties();
String createdBy = configuredObject instanceof ConfiguredObject<?> ? (String) ((ConfiguredObject) configuredObject).getAttribute(ConfiguredObject.CREATED_BY) : null;
private ObjectProperties createObjectPropertiesForMethod(final PermissionedObject permissionedObject, final String methodName) { ObjectProperties properties = new ObjectProperties(permissionedObject.getName()); properties.put(ObjectProperties.Property.METHOD_NAME, methodName); if (permissionedObject instanceof ConfiguredObject<?>) { ConfiguredObject<?> configuredObject = ((ConfiguredObject) permissionedObject); Model model = configuredObject.getModel(); VirtualHost<?> virtualHost = model.getAncestor(VirtualHost.class, configuredObject); final String componentName; if (virtualHost != null) { properties.put(ObjectProperties.Property.VIRTUALHOST_NAME, virtualHost.getName()); componentName = buildHierarchicalCategoryName(configuredObject, virtualHost); } else { componentName = buildHierarchicalCategoryName(configuredObject, model.getAncestor(Broker.class, configuredObject)); } properties.put(ObjectProperties.Property.COMPONENT, componentName); final String createdBy = (String) configuredObject.getAttribute(ConfiguredObject.CREATED_BY); if (createdBy != null) { properties.put(ObjectProperties.Property.CREATED_BY, createdBy); } } return properties; }