@Override public DescriptionProvider getModelDescription(PathAddress address) { return delegate.getModelDescription(address); }
@Override public DescriptionProvider getModelDescription(PathAddress address) { return delegate.getModelDescription(address); }
@Override public DescriptionProvider getModelDescription(PathAddress address) { return delegate.getModelDescription(address); }
@Override public DescriptionProvider getModelDescription(PathAddress address) { return delegate.getModelDescription(address); }
private MBeanInfoFactory(final ObjectName name, final TypeConverters converters, final ConfiguredDomains configuredDomains, final boolean standalone, final PathAddress address, final ImmutableManagementResourceRegistration resourceRegistration) { this.name = name; this.converters = converters; this.configuredDomains = configuredDomains; this.standalone = standalone; this.legacy = configuredDomains.isLegacyDomain(name); this.resourceRegistration = resourceRegistration; DescriptionProvider provider = resourceRegistration.getModelDescription(PathAddress.EMPTY_ADDRESS); providedDescription = provider != null ? provider.getModelDescription(null) : new ModelNode(); this.pathAddress = address; }
private MBeanInfoFactory(final ObjectName name, final TypeConverters converters, final ConfiguredDomains configuredDomains, final MutabilityChecker mutabilityChecker, final PathAddress address, final ImmutableManagementResourceRegistration resourceRegistration) { this.name = name; this.converters = converters; this.configuredDomains = configuredDomains; this.mutabilityChecker = mutabilityChecker; this.legacy = configuredDomains.isLegacyDomain(name); this.resourceRegistration = resourceRegistration; DescriptionProvider provider = resourceRegistration.getModelDescription(PathAddress.EMPTY_ADDRESS); providedDescription = provider != null ? provider.getModelDescription(null) : new ModelNode(); this.pathAddress = address; }
private MBeanInfoFactory(final ObjectName name, final TypeConverters converters, final ConfiguredDomains configuredDomains, final boolean standalone, final PathAddress address, final ImmutableManagementResourceRegistration resourceRegistration) { this.name = name; this.converters = converters; this.configuredDomains = configuredDomains; this.standalone = standalone; this.legacy = configuredDomains.isLegacyDomain(name); this.resourceRegistration = resourceRegistration; DescriptionProvider provider = resourceRegistration.getModelDescription(PathAddress.EMPTY_ADDRESS); providedDescription = provider != null ? provider.getModelDescription(null) : new ModelNode(); this.pathAddress = address; }
private ModelNode getNodeDescription(ImmutableManagementResourceRegistration registry, OperationContext context, ModelNode operation) throws OperationFailedException { final DescriptionProvider descriptionProvider = registry.getModelDescription(PathAddress.EMPTY_ADDRESS); final Locale locale = GlobalOperationHandlers.getLocale(context, operation); return descriptionProvider.getModelDescription(locale); }
private ModelNode getNodeDescription(ImmutableManagementResourceRegistration registry, OperationContext context, ModelNode operation) throws OperationFailedException { final DescriptionProvider descriptionProvider = registry.getModelDescription(PathAddress.EMPTY_ADDRESS); final Locale locale = GlobalOperationHandlers.getLocale(context, operation); return descriptionProvider.getModelDescription(locale); }
public static ModelNode readFullModelDescription(PathAddress address, ImmutableManagementResourceRegistration reg) { ModelNode node = new ModelNode(); node.get(ModelDescriptionConstants.MODEL_DESCRIPTION).set(reg.getModelDescription(PathAddress.EMPTY_ADDRESS).getModelDescription(Locale.getDefault())); node.get(ModelDescriptionConstants.ADDRESS).set(address.toModelNode()); for (PathElement pe : reg.getChildAddresses(PathAddress.EMPTY_ADDRESS)) { ModelNode children = node.get(ModelDescriptionConstants.CHILDREN); ImmutableManagementResourceRegistration sub = reg.getSubModel(PathAddress.pathAddress(pe)); children.add(readFullModelDescription(address.append(pe), sub)); } return node; }
public static ModelNode readFullModelDescription(PathAddress address, ImmutableManagementResourceRegistration reg) { ModelNode node = new ModelNode(); node.get(ModelDescriptionConstants.MODEL_DESCRIPTION).set(reg.getModelDescription(PathAddress.EMPTY_ADDRESS).getModelDescription(Locale.getDefault())); node.get(ModelDescriptionConstants.ADDRESS).set(address.toModelNode()); for (PathElement pe : reg.getChildAddresses(PathAddress.EMPTY_ADDRESS)) { ModelNode children = node.get(ModelDescriptionConstants.CHILDREN); ImmutableManagementResourceRegistration sub = reg.getSubModel(PathAddress.pathAddress(pe)); children.add(readFullModelDescription(address.append(pe), sub)); } return node; }
public static ModelNode readFullModelDescription(PathAddress address, ImmutableManagementResourceRegistration reg) { ModelNode node = new ModelNode(); node.get(ModelDescriptionConstants.MODEL_DESCRIPTION).set(reg.getModelDescription(PathAddress.EMPTY_ADDRESS).getModelDescription(Locale.getDefault())); node.get(ModelDescriptionConstants.ADDRESS).set(address.toModelNode()); for (PathElement pe : reg.getChildAddresses(PathAddress.EMPTY_ADDRESS)) { ModelNode children = node.get(ModelDescriptionConstants.CHILDREN); ImmutableManagementResourceRegistration sub = reg.getSubModel(PathAddress.pathAddress(pe)); children.add(readFullModelDescription(address.append(pe), sub)); } return node; }
public static ModelNode readFullModelDescription(PathAddress address, ImmutableManagementResourceRegistration reg) { ModelNode node = new ModelNode(); node.get(ModelDescriptionConstants.MODEL_DESCRIPTION).set(reg.getModelDescription(PathAddress.EMPTY_ADDRESS).getModelDescription(Locale.getDefault())); node.get(ModelDescriptionConstants.ADDRESS).set(address.toModelNode()); for (PathElement pe : reg.getChildAddresses(PathAddress.EMPTY_ADDRESS)) { ModelNode children = node.get(ModelDescriptionConstants.CHILDREN); ImmutableManagementResourceRegistration sub = reg.getSubModel(PathAddress.pathAddress(pe)); children.add(readFullModelDescription(address.append(pe), sub)); } return node; }
private ModelNode getAttributeDescription(String attributeName, ImmutableManagementResourceRegistration registration, Map<String, AttributeAccess> attributes) { AttributeAccess aa = attributes.get(attributeName); AttributeDefinition ad = aa.getAttributeDefinition(); ModelNode desc; if (ad != null) { if (!COMPLEX_TYPES.contains(ad.getType())) { desc = ad.getNoTextDescription(false); } else { // the simple no-text description is not enough to get value-type; ask for the full desc ModelNode wrapped = new ModelNode(); ad.addResourceAttributeDescription(wrapped, NonResolvingResourceDescriptionResolver.INSTANCE, null, NonResolvingResourceDescriptionResolver.INSTANCE.getResourceBundle(null)); desc = wrapped.get(ATTRIBUTES, attributeName); } } else { // We shouldn't be getting here any more, but just in case desc = registration.getModelDescription(PathAddress.EMPTY_ADDRESS).getModelDescription(null).get(ATTRIBUTES, attributeName); } return desc; }
private Object getAttribute(final ResourceAndRegistration reg, final PathAddress address, final ObjectName name, final String attribute) throws ReflectionException, AttributeNotFoundException, InstanceNotFoundException { final ImmutableManagementResourceRegistration registration = getMBeanRegistration(address, reg); final DescriptionProvider provider = registration.getModelDescription(PathAddress.EMPTY_ADDRESS); if (provider == null) { throw MESSAGES.descriptionProviderNotFound(address); } final ModelNode description = provider.getModelDescription(null); final String attributeName = findAttributeName(description.get(ATTRIBUTES), attribute); ModelNode op = new ModelNode(); op.get(OP).set(READ_ATTRIBUTE_OPERATION); op.get(OP_ADDR).set(address.toModelNode()); op.get(NAME).set(attributeName); ModelNode result = execute(op); String error = getFailureDescription(result); if (error != null) { throw new AttributeNotFoundException(error); } return converters.fromModelNode(description.require(ATTRIBUTES).require(attributeName), result.get(RESULT)); }
private void setAttribute(final ResourceAndRegistration reg, final PathAddress address, final ObjectName name, final Attribute attribute) throws InvalidAttributeValueException, AttributeNotFoundException, InstanceNotFoundException { final ImmutableManagementResourceRegistration registration = getMBeanRegistration(address, reg); final DescriptionProvider provider = registration.getModelDescription(PathAddress.EMPTY_ADDRESS); if (provider == null) { throw MESSAGES.descriptionProviderNotFound(address); } final ModelNode description = provider.getModelDescription(null); final String attributeName = findAttributeName(description.get(ATTRIBUTES), attribute.getName()); if (!standalone) { throw MESSAGES.attributeNotWritable(attribute); } ModelNode op = new ModelNode(); op.get(OP).set(WRITE_ATTRIBUTE_OPERATION); op.get(OP_ADDR).set(address.toModelNode()); op.get(NAME).set(attributeName); try { op.get(VALUE).set(converters.toModelNode(description.require(ATTRIBUTES).require(attributeName), attribute.getValue())); } catch (ClassCastException e) { throw MESSAGES.invalidAttributeType(e, attribute.getName()); } ModelNode result = execute(op); String error = getFailureDescription(result); if (error != null) { throw new InvalidAttributeValueException(error); } }
private Object getAttribute(final ResourceAndRegistration reg, final PathAddress address, final ObjectName name, final String attribute, final ResourceAccessControl accessControl) throws ReflectionException, AttributeNotFoundException, InstanceNotFoundException { final ImmutableManagementResourceRegistration registration = getMBeanRegistration(address, reg); final DescriptionProvider provider = registration.getModelDescription(PathAddress.EMPTY_ADDRESS); if (provider == null) { throw MESSAGES.descriptionProviderNotFound(address); } final ModelNode description = provider.getModelDescription(null); final String attributeName = findAttributeName(description.get(ATTRIBUTES), attribute); if (!accessControl.isReadableAttribute(attributeName)) { throw MESSAGES.notAuthorizedToReadAttribute(attributeName); } ModelNode op = new ModelNode(); op.get(OP).set(READ_ATTRIBUTE_OPERATION); op.get(OP_ADDR).set(address.toModelNode()); op.get(NAME).set(attributeName); ModelNode result = execute(op); String error = getFailureDescription(result); if (error != null) { throw new AttributeNotFoundException(error); } return converters.fromModelNode(description.require(ATTRIBUTES).require(attributeName), result.get(RESULT)); }
private boolean isRequiredConfigFromDescription(String attrName, ImmutableManagementResourceRegistration resourceRegistration) { PathAddress address = targetResource.getResourceAddress(); ModelNode resourceDescription = resourceDescriptions.get(address); if (resourceDescription == null) { resourceDescription = resourceRegistration.getModelDescription(PathAddress.EMPTY_ADDRESS).getModelDescription(Locale.ENGLISH); resourceDescriptions.put(address, resourceDescription); } if (resourceDescription.hasDefined(ATTRIBUTES)) { ModelNode attributes = resourceDescription.get(ATTRIBUTES); if (attributes.hasDefined(attrName)) { ModelNode attrDesc = attributes.get(attrName); if (attrDesc.hasDefined(REQUIRED)) { return attrDesc.get(REQUIRED).asBoolean(); } else if (attrDesc.hasDefined(NILLABLE)) { return !attrDesc.get(NILLABLE).asBoolean() || attrDesc.hasDefined(ModelDescriptionConstants.DEFAULT) || (attrDesc.hasDefined(NIL_SIGNIFICANT) && attrDesc.get(NIL_SIGNIFICANT).asBoolean()); } return true; } } return false; }
private void setAttribute(final ResourceAndRegistration reg, final PathAddress address, final ObjectName name, final Attribute attribute, ResourceAccessControl accessControl) throws InvalidAttributeValueException, AttributeNotFoundException, InstanceNotFoundException { final ImmutableManagementResourceRegistration registration = getMBeanRegistration(address, reg); final DescriptionProvider provider = registration.getModelDescription(PathAddress.EMPTY_ADDRESS); if (provider == null) { throw MESSAGES.descriptionProviderNotFound(address);
String jmxAttributeName = NameConverter.convertToCamelCase(attributeName); try { ModelNode modelDescription = getHelper(source).getMBeanRegistration(source).getModelDescription(PathAddress.EMPTY_ADDRESS).getModelDescription(null); ModelNode attributeDescription = modelDescription.get(ATTRIBUTES, attributeName); TypeConverters converters = getHelper(source).getConverters();