/** * Get the access type. * * @return the access type */ public AttributeAccess.AccessType getAccessType() { return attributeAccess == null ? null : attributeAccess.getAccessType(); }
/** * Get the access type. * * @return the access type */ public AttributeAccess.AccessType getAccessType() { return attributeAccess == null ? null : attributeAccess.getAccessType(); }
/** * Get the access type. * * @return the access type */ public AttributeAccess.AccessType getAccessType() { return attributeAccess == null ? null : attributeAccess.getAccessType(); }
private void processComplexAttributes(final ModelNode parentFeature, final boolean isProfile, final ImmutableManagementResourceRegistration registration) { for (AttributeAccess attAccess : registration.getAttributes(PathAddress.EMPTY_ADDRESS).values()) { if(attAccess.getStorageType() != CONFIGURATION || attAccess.getAccessType() != AttributeAccess.AccessType.READ_WRITE) { continue; } final AttributeDefinition attDef = attAccess.getAttributeDefinition(); // if(attDef.isDeprecated()) { // continue; // } switch (attDef.getType()) { case LIST: if (ObjectListAttributeDefinition.class.isAssignableFrom(attDef.getClass())) { processListAttribute(parentFeature, registration, (ObjectListAttributeDefinition) attDef); } break; case OBJECT: if (ObjectTypeAttributeDefinition.class.isAssignableFrom(attDef.getClass())) { ObjectTypeAttributeDefinition objAttDef = (ObjectTypeAttributeDefinition) attDef; processObjectAttribute(parentFeature, isProfile, registration, objAttDef); } break; default: } } }
private void processComplexAttributes(final ModelNode parentFeature, final boolean isProfile, final ImmutableManagementResourceRegistration registration) { for (AttributeAccess attAccess : registration.getAttributes(PathAddress.EMPTY_ADDRESS).values()) { if(attAccess.getStorageType() != CONFIGURATION || attAccess.getAccessType() != AttributeAccess.AccessType.READ_WRITE) { continue; } final AttributeDefinition attDef = attAccess.getAttributeDefinition(); // if(attDef.isDeprecated()) { // continue; // } switch (attDef.getType()) { case LIST: if (ObjectListAttributeDefinition.class.isAssignableFrom(attDef.getClass())) { processListAttribute(parentFeature, registration, (ObjectListAttributeDefinition) attDef); } break; case OBJECT: if (ObjectTypeAttributeDefinition.class.isAssignableFrom(attDef.getClass())) { ObjectTypeAttributeDefinition objAttDef = (ObjectTypeAttributeDefinition) attDef; processObjectAttribute(parentFeature, isProfile, registration, objAttDef); } break; default: } } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { nameValidator.validate(operation); final String attributeName = operation.require(GlobalOperationHandlers.NAME.getName()).asString(); final AttributeAccess attributeAccess = context.getResourceRegistration().getAttributeAccess(PathAddress.EMPTY_ADDRESS, attributeName); if (attributeAccess == null) { throw new OperationFailedException(new ModelNode().set(MESSAGES.unknownAttribute(attributeName))); } else if (attributeAccess.getAccessType() != AttributeAccess.AccessType.READ_WRITE) { throw new OperationFailedException(new ModelNode().set(MESSAGES.attributeNotWritable(attributeName))); } else { OperationStepHandler handler = attributeAccess.getWriteHandler(); ClassLoader oldTccl = SecurityActions.setThreadContextClassLoader(handler.getClass()); try { handler.execute(context, operation); } finally { SecurityActions.setThreadContextClassLoader(oldTccl); } } } }
boolean hasCurrent = current.add.hasDefined(attribute); boolean hasRemote = remote.add.hasDefined(attribute); if (access.getAccessType() == AttributeAccess.AccessType.READ_WRITE) { } else if (access.getAccessType() == AttributeAccess.AccessType.READ_ONLY) { ModelNode currentValue = hasCurrent ? current.add.get(attribute) : new ModelNode(); ModelNode removeValue = hasRemote ? remote.add.get(attribute) : new ModelNode();
boolean hasCurrent = current.add.hasDefined(attribute); boolean hasRemote = remote.add.hasDefined(attribute); if (access.getAccessType() == AttributeAccess.AccessType.READ_WRITE) { } else if (access.getAccessType() == AttributeAccess.AccessType.READ_ONLY) { ModelNode currentValue = hasCurrent ? current.add.get(attribute) : new ModelNode(); ModelNode removeValue = hasRemote ? remote.add.get(attribute) : new ModelNode();
private boolean isAddableAttribute(String attrName, ImmutableManagementResourceRegistration resourceRegistration) { AttributeAccess attributeAccess = resourceRegistration.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attrName); if (attributeAccess == null) { return false; } if (attributeAccess.getStorageType() == AttributeAccess.Storage.CONFIGURATION && attributeAccess.getAccessType() == AttributeAccess.AccessType.READ_WRITE) { AttributeDefinition ad = attributeAccess.getAttributeDefinition(); if (ad == null) { return false; } if (ad.isRequired() || ad.isNullSignificant()) { // must be set, presence of a default means not setting is the same as setting, // or the AD is specifically configured that null is significant return true; } } return false; }
private boolean isAddableAttribute(String attrName, ImmutableManagementResourceRegistration resourceRegistration) { AttributeAccess attributeAccess = resourceRegistration.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attrName); if (attributeAccess == null) { return false; } if (attributeAccess.getStorageType() == AttributeAccess.Storage.CONFIGURATION && attributeAccess.getAccessType() == AttributeAccess.AccessType.READ_WRITE) { AttributeDefinition ad = attributeAccess.getAttributeDefinition(); if (ad == null) { return false; } if (ad.isRequired() || ad.isNullSignificant()) { // must be set, presence of a default means not setting is the same as setting, // or the AD is specifically configured that null is significant return true; } } return false; }
&& (includeRutime || access.getStorageType() == AttributeAccess.Storage.CONFIGURATION) && (groupName == null || groupName.equals(ad.getAttributeGroup()))) { Map<AttributeDefinition.NameAndGroup, GlobalOperationHandlers.AvailableResponse> responseMap = access.getAccessType() == AttributeAccess.AccessType.METRIC ? metrics : otherAttributes; AttributeDefinition.NameAndGroup nag = ad == null ? new AttributeDefinition.NameAndGroup(attributeName) : new AttributeDefinition.NameAndGroup(ad); addReadAttributeStep(context, address, defaults, resolve, localFilteredData, registry, nag, responseMap);
&& (includeRutime || access.getStorageType() == AttributeAccess.Storage.CONFIGURATION) && (groupName == null || groupName.equals(ad.getAttributeGroup()))) { Map<AttributeDefinition.NameAndGroup, GlobalOperationHandlers.AvailableResponse> responseMap = access.getAccessType() == AttributeAccess.AccessType.METRIC ? metrics : otherAttributes; AttributeDefinition.NameAndGroup nag = ad == null ? new AttributeDefinition.NameAndGroup(attributeName) : new AttributeDefinition.NameAndGroup(ad); addReadAttributeStep(context, address, defaults, resolve, localFilteredData, registry, nag, responseMap);
private OpenMBeanAttributeInfo getAttribute(String name) { final String escapedName = NameConverter.convertToCamelCase(name); ModelNode attribute = providedDescription.require(ATTRIBUTES).require(name); AttributeAccess access = resourceRegistration.getAttributeAccess(PathAddress.EMPTY_ADDRESS, name); if (access == null) { // Check for a bogus attribute in the description that's really a child Set<String> childTypes = resourceRegistration.getChildNames(PathAddress.EMPTY_ADDRESS); if (childTypes.contains(name)) { return null; } } final boolean writable = standalone && (access != null && access.getAccessType() == AccessType.READ_WRITE); return new OpenMBeanAttributeInfoSupport( escapedName, getDescription(attribute), converters.convertToMBeanType(attribute), true, writable, false, createAttributeDescriptor(attribute)); }
private OpenMBeanAttributeInfo getAttribute(String name) { final String escapedName = NameConverter.convertToCamelCase(name); ModelNode attribute = providedDescription.require(ATTRIBUTES).require(name); AttributeAccess access = resourceRegistration.getAttributeAccess(PathAddress.EMPTY_ADDRESS, name); final boolean writable = standalone && (access != null && access.getAccessType() == AccessType.READ_WRITE); return new OpenMBeanAttributeInfoSupport( escapedName, getDescription(attribute), converters.convertToMBeanType(attribute), true, writable, false, createAttributeDescriptor(attribute)); }
private OpenMBeanAttributeInfo getAttribute(String name) { final String escapedName = NameConverter.convertToCamelCase(name); ModelNode attribute = providedDescription.require(ATTRIBUTES).require(name); AttributeAccess access = resourceRegistration.getAttributeAccess(PathAddress.EMPTY_ADDRESS, name); if (access == null) { // Check for a bogus attribute in the description that's really a child Set<String> childTypes = resourceRegistration.getChildNames(PathAddress.EMPTY_ADDRESS); if (childTypes.contains(name)) { return null; } } final boolean writable = mutabilityChecker.mutable(pathAddress) && (access != null && access.getAccessType() == AccessType.READ_WRITE); return new OpenMBeanAttributeInfoSupport( escapedName, getDescription(attribute), converters.convertToMBeanType(attribute), true, writable, false, createAttributeDescriptor(attribute)); }
if (attributeAccess == null) { throw new OperationFailedException(new ModelNode().set(MESSAGES.unknownAttribute(attributeName))); } else if (attributeAccess.getAccessType() != AttributeAccess.AccessType.READ_WRITE) { throw new OperationFailedException(new ModelNode().set(MESSAGES.attributeNotWritable(attributeName))); } else {
if (attributeAccess == null) { throw new OperationFailedException(ControllerLogger.ROOT_LOGGER.unknownAttribute(attributeName)); } else if (attributeAccess.getAccessType() != AttributeAccess.AccessType.READ_WRITE) { throw new OperationFailedException(ControllerLogger.ROOT_LOGGER.attributeNotWritable(attributeName)); } else {
private boolean isAddableAttribute(String attrName, ImmutableManagementResourceRegistration resourceRegistration) { AttributeAccess attributeAccess = resourceRegistration.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attrName); if (attributeAccess == null) { return isRequiredConfigFromDescription(attrName, resourceRegistration); } if (attributeAccess.getStorageType() == AttributeAccess.Storage.CONFIGURATION && attributeAccess.getAccessType() == AttributeAccess.AccessType.READ_WRITE) { AttributeDefinition ad = attributeAccess.getAttributeDefinition(); if (ad == null) { return isRequiredConfigFromDescription(attrName, resourceRegistration); } if (!ad.isAllowNull() || (ad.getDefaultValue() != null && ad.getDefaultValue().isDefined()) || ad.isNullSignificant()) { // must be set, presence of a default means not setting is the same as setting, // or the AD is specifically configured that null is significant return true; } } return false; }
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); if (attributeAccess.getAccessType() == AttributeAccess.AccessType.METRIC) { if (!context.getResult().isDefined() && !includeUndefinedMetricValue) {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); if (attributeAccess.getAccessType() == AttributeAccess.AccessType.METRIC) { if (!context.getResult().isDefined() && !includeUndefinedMetricValue) {