@Override public ModelNode getNoTextDescription(boolean forOperation) { final ModelNode model = super.getNoTextDescription(forOperation); final ModelNode valueType = model.get(VALUE_TYPE); for (final AttributeDefinition def : NESTED_ATTRIBUTES) { final AttributeDefinition current; if (NESTED_LIST_ATTRIBUTES.contains(def)) { current = wrapAsList(def); } else { current = def; } final ModelNode m = current.getNoTextDescription(forOperation); m.remove(ALTERNATIVES); valueType.get(current.getName()).set(m); } return model; } };
@Override public ModelNode getNoTextDescription(boolean forOperation) { final ModelNode model = super.getNoTextDescription(forOperation); final ModelNode valueType = model.get(VALUE_TYPE); for (final AttributeDefinition def : NESTED_ATTRIBUTES) { final AttributeDefinition current; if (NESTED_LIST_ATTRIBUTES.contains(def)) { current = wrapAsList(def); } else { current = def; } final ModelNode m = current.getNoTextDescription(forOperation); m.remove(ALTERNATIVES); valueType.get(current.getName()).set(m); } return model; } };
@Override public ModelNode getNoTextDescription(boolean forOperation) { final ModelNode model = super.getNoTextDescription(forOperation); final ModelNode valueType = model.get(VALUE_TYPE); for (final AttributeDefinition def : NESTED_ATTRIBUTES) { final AttributeDefinition current; if (NESTED_LIST_ATTRIBUTES.contains(def)) { current = wrapAsList(def); } else { current = def; } final ModelNode m = current.getNoTextDescription(forOperation); m.remove(ALTERNATIVES); valueType.get(current.getName()).set(m); } return model; } };
@Override public ModelNode getNoTextDescription(boolean forOperation) { final ModelNode model = super.getNoTextDescription(forOperation); final ModelNode valueType = model.get(VALUE_TYPE); for (final AttributeDefinition def : NESTED_ATTRIBUTES) { final AttributeDefinition current; if (NESTED_LIST_ATTRIBUTES.contains(def)) { current = wrapAsList(def); } else { current = def; } final ModelNode m = current.getNoTextDescription(forOperation); m.remove(ALTERNATIVES); valueType.get(current.getName()).set(m); } return model; } };
/** * Creates a returns a basic model node describing a parameter that sets this attribute, after attaching it to the * given overall operation description model node. The node describing the parameter is returned to make it easy * to perform further modification. * * @param bundle resource bundle to use for text descriptions * @param prefix prefix to prepend to the attribute name key when looking up descriptions * @param operationDescription the overall resource description * @return the attribute description node */ public ModelNode addOperationReplyDescription(final ResourceBundle bundle, final String prefix, final ModelNode operationDescription) { final ModelNode param = getNoTextDescription(true); param.get(ModelDescriptionConstants.DESCRIPTION).set(getAttributeTextDescription(bundle, prefix)); final ModelNode result = operationDescription.get(ModelDescriptionConstants.REPLY_PROPERTIES, getName()).set(param); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(getAttributeDeprecatedDescription(bundle, prefix)); } return result; }
/** * Creates a returns a basic model node describing a parameter that sets this attribute, after attaching it to the * given overall operation description model node. The node describing the parameter is returned to make it easy * to perform further modification. * * @param bundle resource bundle to use for text descriptions * @param prefix prefix to prepend to the attribute name key when looking up descriptions * @param operationDescription the overall resource description * @return the attribute description node */ public ModelNode addOperationParameterDescription(final ResourceBundle bundle, final String prefix, final ModelNode operationDescription) { final ModelNode param = getNoTextDescription(true); param.get(ModelDescriptionConstants.DESCRIPTION).set(getAttributeTextDescription(bundle, prefix)); final ModelNode result = operationDescription.get(ModelDescriptionConstants.REQUEST_PROPERTIES, getName()).set(param); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(getAttributeDeprecatedDescription(bundle, prefix)); } return result; }
/** * Creates a returns a basic model node describing a parameter that sets this attribute, after attaching it to the * given overall operation description model node. The node describing the parameter is returned to make it easy * to perform further modification. * * @param bundle resource bundle to use for text descriptions * @param prefix prefix to prepend to the attribute name key when looking up descriptions * @param operationDescription the overall resource description * @return the attribute description node */ public ModelNode addOperationReplyDescription(final ResourceBundle bundle, final String prefix, final ModelNode operationDescription) { final ModelNode param = getNoTextDescription(true); param.get(ModelDescriptionConstants.DESCRIPTION).set(getAttributeTextDescription(bundle, prefix)); final ModelNode result = operationDescription.get(ModelDescriptionConstants.REPLY_PROPERTIES, getName()).set(param); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(getAttributeDeprecatedDescription(bundle, prefix)); } return result; }
/** * Creates a returns a basic model node describing a parameter that sets this attribute, after attaching it to the * given overall operation description model node. The node describing the parameter is returned to make it easy * to perform further modification. * * @param bundle resource bundle to use for text descriptions * @param prefix prefix to prepend to the attribute name key when looking up descriptions * @param operationDescription the overall resource description * @return the attribute description node */ public ModelNode addOperationParameterDescription(final ResourceBundle bundle, final String prefix, final ModelNode operationDescription) { final ModelNode param = getNoTextDescription(true); param.get(ModelDescriptionConstants.DESCRIPTION).set(getAttributeTextDescription(bundle, prefix)); final ModelNode result = operationDescription.get(ModelDescriptionConstants.REQUEST_PROPERTIES, getName()).set(param); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(getAttributeDeprecatedDescription(bundle, prefix)); } return result; }
/** * Creates a returns a basic model node describing a parameter that sets this attribute, after attaching it to the * given overall operation description model node. The node describing the parameter is returned to make it easy * to perform further modification. * * @param bundle resource bundle to use for text descriptions * @param prefix prefix to prepend to the attribute name key when looking up descriptions * @param operationDescription the overall resource description * @return the attribute description node */ public ModelNode addOperationParameterDescription(final ResourceBundle bundle, final String prefix, final ModelNode operationDescription) { final ModelNode param = getNoTextDescription(true); param.get(ModelDescriptionConstants.DESCRIPTION).set(getAttributeTextDescription(bundle, prefix)); final ModelNode result = operationDescription.get(ModelDescriptionConstants.REQUEST_PROPERTIES, getName()).set(param); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(getAttributeDeprecatedDescription(bundle, prefix)); } return result; }
/** * Creates a returns a basic model node describing a parameter that sets this attribute, after attaching it to the * given overall operation description model node. The node describing the parameter is returned to make it easy * to perform further modification. * * @param bundle resource bundle to use for text descriptions * @param prefix prefix to prepend to the attribute name key when looking up descriptions * @param operationDescription the overall resource description * @return the attribute description node */ public ModelNode addOperationParameterDescription(final ResourceBundle bundle, final String prefix, final ModelNode operationDescription) { final ModelNode param = getNoTextDescription(true); param.get(ModelDescriptionConstants.DESCRIPTION).set(getAttributeTextDescription(bundle, prefix)); final ModelNode result = operationDescription.get(ModelDescriptionConstants.REQUEST_PROPERTIES, getName()).set(param); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(getAttributeDeprecatedDescription(bundle, prefix)); } return result; }
/** * Creates a returns a basic model node describing the attribute, after attaching it to the given overall resource * description model node. The node describing the attribute is returned to make it easy to perform further * modification. * * @param bundle resource bundle to use for text descriptions * @param prefix prefix to prepend to the attribute name key when looking up descriptions * @param resourceDescription the overall resource description * @return the attribute description node */ public ModelNode addResourceAttributeDescription(final ResourceBundle bundle, final String prefix, final ModelNode resourceDescription) { final ModelNode attr = getNoTextDescription(false); attr.get(ModelDescriptionConstants.DESCRIPTION).set(getAttributeTextDescription(bundle, prefix)); final ModelNode result = resourceDescription.get(ModelDescriptionConstants.ATTRIBUTES, getName()).set(attr); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(getAttributeDeprecatedDescription(bundle, prefix)); } return result; }
/** * Creates a returns a basic model node describing the attribute, after attaching it to the given overall resource * description model node. The node describing the attribute is returned to make it easy to perform further * modification. * * @param bundle resource bundle to use for text descriptions * @param prefix prefix to prepend to the attribute name key when looking up descriptions * @param resourceDescription the overall resource description * @return the attribute description node */ public ModelNode addResourceAttributeDescription(final ResourceBundle bundle, final String prefix, final ModelNode resourceDescription) { final ModelNode attr = getNoTextDescription(false); attr.get(ModelDescriptionConstants.DESCRIPTION).set(getAttributeTextDescription(bundle, prefix)); final ModelNode result = resourceDescription.get(ModelDescriptionConstants.ATTRIBUTES, getName()).set(attr); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(getAttributeDeprecatedDescription(bundle, prefix)); } addAccessConstraints(result, bundle.getLocale()); return result; }
/** * Creates a returns a basic model node describing the attribute, after attaching it to the given overall resource * description model node. The node describing the attribute is returned to make it easy to perform further * modification. * * @param bundle resource bundle to use for text descriptions * @param prefix prefix to prepend to the attribute name key when looking up descriptions * @param resourceDescription the overall resource description * @return the attribute description node */ public ModelNode addResourceAttributeDescription(final ResourceBundle bundle, final String prefix, final ModelNode resourceDescription) { final ModelNode attr = getNoTextDescription(false); attr.get(ModelDescriptionConstants.DESCRIPTION).set(getAttributeTextDescription(bundle, prefix)); final ModelNode result = resourceDescription.get(ModelDescriptionConstants.ATTRIBUTES, getName()).set(attr); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(getAttributeDeprecatedDescription(bundle, prefix)); } addAccessConstraints(result, bundle.getLocale()); return result; }
/** * Creates a returns a basic model node describing the attribute, after attaching it to the given overall resource * description model node. The node describing the attribute is returned to make it easy to perform further * modification. * * @param bundle resource bundle to use for text descriptions * @param prefix prefix to prepend to the attribute name key when looking up descriptions * @param resourceDescription the overall resource description * @return the attribute description node */ public ModelNode addResourceAttributeDescription(final ResourceBundle bundle, final String prefix, final ModelNode resourceDescription) { final ModelNode attr = getNoTextDescription(false); attr.get(ModelDescriptionConstants.DESCRIPTION).set(getAttributeTextDescription(bundle, prefix)); final ModelNode result = resourceDescription.get(ModelDescriptionConstants.ATTRIBUTES, getName()).set(attr); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(getAttributeDeprecatedDescription(bundle, prefix)); } addAccessConstraints(result, bundle.getLocale()); return result; }
/** * Creates a returns a basic model node describing a parameter that sets this attribute, after attaching it to the * given overall operation description model node. The node describing the parameter is returned to make it easy * to perform further modification. * * @param resourceDescription the overall resource description * @param operationName the operation name * @param resolver provider of localized text descriptions * @param locale locale to pass to the resolver * @param bundle bundle to pass to the resolver * @return the attribute description node */ public ModelNode addOperationParameterDescription(final ModelNode resourceDescription, final String operationName, final ResourceDescriptionResolver resolver, final Locale locale, final ResourceBundle bundle) { final ModelNode param = getNoTextDescription(true); final String description = resolver.getOperationParameterDescription(operationName, getName(), locale, bundle); param.get(ModelDescriptionConstants.DESCRIPTION).set(description); final ModelNode result = resourceDescription.get(ModelDescriptionConstants.REQUEST_PROPERTIES, getName()).set(param); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(resolver.getOperationParameterDeprecatedDescription(operationName, getName(), locale, bundle)); } return result; }
/** * Creates a returns a basic model node describing the attribute, after attaching it to the given overall resource * description model node. The node describing the attribute is returned to make it easy to perform further * modification. * * @param resourceDescription the overall resource description * @param resolver provider of localized text descriptions * @param locale locale to pass to the resolver * @param bundle bundle to pass to the resolver * @return the attribute description node */ public ModelNode addResourceAttributeDescription(final ModelNode resourceDescription, final ResourceDescriptionResolver resolver, final Locale locale, final ResourceBundle bundle) { final ModelNode attr = getNoTextDescription(false); final String description = resolver.getResourceAttributeDescription(getName(), locale, bundle); attr.get(ModelDescriptionConstants.DESCRIPTION).set(description); final ModelNode result = resourceDescription.get(ModelDescriptionConstants.ATTRIBUTES, getName()).set(attr); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(resolver.getResourceAttributeDeprecatedDescription(getName(), locale, bundle)); } return result; }
/** * Creates a returns a basic model node describing a parameter that sets this attribute, after attaching it to the * given overall operation description model node. The node describing the parameter is returned to make it easy * to perform further modification. * * @param resourceDescription the overall resource description * @param operationName the operation name * @param resolver provider of localized text descriptions * @param locale locale to pass to the resolver * @param bundle bundle to pass to the resolver * @return the attribute description node */ public ModelNode addOperationReplyDescription(final ModelNode resourceDescription, final String operationName, final ResourceDescriptionResolver resolver, final Locale locale, final ResourceBundle bundle) { final ModelNode param = getNoTextDescription(true); String description = resolver.getOperationReplyValueTypeDescription(operationName, locale, bundle, getName()); param.get(ModelDescriptionConstants.DESCRIPTION).set(description); final ModelNode result = resourceDescription.get(ModelDescriptionConstants.REPLY_PROPERTIES, getName()).set(param); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(resolver.getOperationParameterDeprecatedDescription(operationName, getName(), locale, bundle)); } return result; }
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; }
/** * Creates a returns a basic model node describing the attribute, after attaching it to the given overall resource * description model node. The node describing the attribute is returned to make it easy to perform further * modification. * * @param resourceDescription the overall resource description * @param resolver provider of localized text descriptions * @param locale locale to pass to the resolver * @param bundle bundle to pass to the resolver * @return the attribute description node */ public ModelNode addResourceAttributeDescription(final ModelNode resourceDescription, final ResourceDescriptionResolver resolver, final Locale locale, final ResourceBundle bundle) { final ModelNode attr = getNoTextDescription(false); final String description = resolver.getResourceAttributeDescription(getName(), locale, bundle); attr.get(ModelDescriptionConstants.DESCRIPTION).set(description); final ModelNode result = resourceDescription.get(ModelDescriptionConstants.ATTRIBUTES, getName()).set(attr); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(resolver.getResourceAttributeDeprecatedDescription(getName(), locale, bundle)); } addAccessConstraints(result, locale); return result; }
/** * Creates a returns a basic model node describing the attribute, after attaching it to the given overall resource * description model node. The node describing the attribute is returned to make it easy to perform further * modification. * * @param resourceDescription the overall resource description * @param resolver provider of localized text descriptions * @param locale locale to pass to the resolver * @param bundle bundle to pass to the resolver * @return the attribute description node */ public ModelNode addResourceAttributeDescription(final ModelNode resourceDescription, final ResourceDescriptionResolver resolver, final Locale locale, final ResourceBundle bundle) { final ModelNode attr = getNoTextDescription(false); final String description = resolver.getResourceAttributeDescription(getName(), locale, bundle); attr.get(ModelDescriptionConstants.DESCRIPTION).set(description); final ModelNode result = resourceDescription.get(ModelDescriptionConstants.ATTRIBUTES, getName()).set(attr); ModelNode deprecated = addDeprecatedInfo(result); if (deprecated != null) { deprecated.get(ModelDescriptionConstants.REASON).set(resolver.getResourceAttributeDeprecatedDescription(getName(), locale, bundle)); } addAccessConstraints(result, locale); return result; }