AttributeAccess attribute = registration.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attributeName); AttributeDefinition definition = attribute.getAttributeDefinition(); if ((attribute.getStorageType() == AttributeAccess.Storage.CONFIGURATION) && !translations.containsKey(definition)) { definition.validateAndSet(operation, model);
/** * Get the storage type. * * @return the storage type */ public AttributeAccess.Storage getStorageType() { return attributeAccess == null ? null : attributeAccess.getStorageType(); }
/** * Get the storage type. * * @return the storage type */ public AttributeAccess.Storage getStorageType() { return attributeAccess == null ? null : attributeAccess.getStorageType(); }
/** * Get the storage type. * * @return the storage type */ public AttributeAccess.Storage getStorageType() { return attributeAccess == null ? null : attributeAccess.getStorageType(); }
private void doExecuteInternal(OperationContext context, ModelNode operation, AttributeAccess attributeAccess, String attributeName, ModelNode currentValue, boolean useEnhancedSyntax, String attributeExpression) throws OperationFailedException { if (useEnhancedSyntax){ if (attributeAccess.getStorageType() == AttributeAccess.Storage.CONFIGURATION) { operation = getEnhancedSyntaxResolvedOperation(operation, currentValue, attributeName, attributeExpression); } else { assert attributeAccess.getStorageType() == AttributeAccess.Storage.RUNTIME; // Resolution must be postponed to RUNTIME stage for Storage.RUNTIME attributes. final ModelNode originalOperation = operation; // final vars so they can be accessed from lambda final ModelNode resolvedOperation = operation.clone(); operation = resolvedOperation; context.addStep((context1, operation1) -> { ModelNode resolved = getEnhancedSyntaxResolvedOperation(originalOperation, currentValue, attributeName, attributeExpression); resolvedOperation.get(ModelDescriptionConstants.NAME).set(resolved.get(ModelDescriptionConstants.NAME)); resolvedOperation.get(ModelDescriptionConstants.VALUE).set(resolved.get(ModelDescriptionConstants.VALUE)); }, OperationContext.Stage.RUNTIME); } } OperationStepHandler writeHandler = attributeAccess.getWriteHandler(); ClassLoader oldTccl = WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(writeHandler.getClass()); try { writeHandler.execute(context, operation); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); } } private void emitAttributeValueWrittenNotification(OperationContext context, PathAddress address, String attributeName, ModelNode oldValue, ModelNode newValue) {
private void doExecuteInternal(OperationContext context, ModelNode operation, AttributeAccess attributeAccess, String attributeName, ModelNode currentValue, boolean useEnhancedSyntax, String attributeExpression) throws OperationFailedException { if (useEnhancedSyntax){ if (attributeAccess.getStorageType() == AttributeAccess.Storage.CONFIGURATION) { operation = getEnhancedSyntaxResolvedOperation(operation, currentValue, attributeName, attributeExpression); } else { assert attributeAccess.getStorageType() == AttributeAccess.Storage.RUNTIME; // Resolution must be postponed to RUNTIME stage for Storage.RUNTIME attributes. final ModelNode originalOperation = operation; // final vars so they can be accessed from lambda final ModelNode resolvedOperation = operation.clone(); operation = resolvedOperation; context.addStep((context1, operation1) -> { ModelNode resolved = getEnhancedSyntaxResolvedOperation(originalOperation, currentValue, attributeName, attributeExpression); resolvedOperation.get(ModelDescriptionConstants.NAME).set(resolved.get(ModelDescriptionConstants.NAME)); resolvedOperation.get(ModelDescriptionConstants.VALUE).set(resolved.get(ModelDescriptionConstants.VALUE)); }, OperationContext.Stage.RUNTIME); } } OperationStepHandler writeHandler = attributeAccess.getWriteHandler(); ClassLoader oldTccl = WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(writeHandler.getClass()); try { writeHandler.execute(context, operation); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); } } private void emitAttributeValueWrittenNotification(OperationContext context, PathAddress address, String attributeName, ModelNode oldValue, ModelNode newValue) {
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: } } }
for (String attr : attributeNames) { AttributeAccess attributeAccess = registration.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attr); if (attributeAccess.getStorageType() == AttributeAccess.Storage.CONFIGURATION) { AttributeDefinition def = attributeAccess.getAttributeDefinition(); if (def != null) {
for (String attr : attributeNames) { AttributeAccess attributeAccess = registration.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attr); if (attributeAccess.getStorageType() == AttributeAccess.Storage.CONFIGURATION) { AttributeDefinition def = attributeAccess.getAttributeDefinition(); if (def != null) {
private CapabilityRegistry.RuntimeStatus getStepExecutionStatus(Step step) { if (booting || currentStage != Stage.RUNTIME || !RUNTIME_LIMITED_STATES.contains(processState.getState()) || (step.operationDefinition != null && (step.operationDefinition.getFlags().contains(OperationEntry.Flag.READ_ONLY) || step.operationDefinition.getFlags().contains(OperationEntry.Flag.RUNTIME_ONLY)))) { return RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; } ImmutableManagementResourceRegistration mrr = step.getManagementResourceRegistration(getManagementModel()); if (mrr != null) { if (mrr.isRuntimeOnly()) { return RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; } String opName = step.operationDefinition != null ? step.operationDefinition.getName() : null; if ((WRITE_ATTRIBUTE_OPERATION.equals(opName) || UNDEFINE_ATTRIBUTE_OPERATION.equals(opName)) && step.operation.hasDefined(NAME)) { String attrName = step.operation.get(NAME).asString(); AttributeAccess aa = mrr.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attrName); if (aa != null && aa.getStorageType() == AttributeAccess.Storage.RUNTIME) { return RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; } } } return getStepCapabilityStatus(step); }
for (String attr : attributeNames) { AttributeAccess attributeAccess = registration.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attr); if (attributeAccess.getStorageType() == AttributeAccess.Storage.CONFIGURATION) { AttributeDefinition def = attributeAccess.getAttributeDefinition(); if (def != null) {
for (String attr : attributeNames) { AttributeAccess attributeAccess = registration.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attr); if (attributeAccess.getStorageType() == AttributeAccess.Storage.CONFIGURATION) { AttributeDefinition def = attributeAccess.getAttributeDefinition(); if (def != null) {
private CapabilityRegistry.RuntimeStatus getStepExecutionStatus(Step step) { if (booting || currentStage != Stage.RUNTIME || !RUNTIME_LIMITED_STATES.contains(processState.getState()) || (step.operationDefinition != null && (step.operationDefinition.getFlags().contains(OperationEntry.Flag.READ_ONLY) || step.operationDefinition.getFlags().contains(OperationEntry.Flag.RUNTIME_ONLY)))) { return RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; } ImmutableManagementResourceRegistration mrr = step.getManagementResourceRegistration(getManagementModel()); if (mrr != null) { if (mrr.isRuntimeOnly()) { return RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; } String opName = step.operationDefinition != null ? step.operationDefinition.getName() : null; if ((WRITE_ATTRIBUTE_OPERATION.equals(opName) || UNDEFINE_ATTRIBUTE_OPERATION.equals(opName)) && step.operation.hasDefined(NAME)) { String attrName = step.operation.get(NAME).asString(); AttributeAccess aa = mrr.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attrName); if (aa != null && aa.getStorageType() == AttributeAccess.Storage.RUNTIME) { return RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; } } } return getStepCapabilityStatus(step); }
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; }
final AttributeDefinition ad = access.getAttributeDefinition(); if ((aliases || !access.getFlags().contains(AttributeAccess.Flag.ALIAS)) && (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;
final AttributeDefinition ad = access.getAttributeDefinition(); if ((aliases || !access.getFlags().contains(AttributeAccess.Flag.ALIAS)) && (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;
for (String name : reg.getAttributeNames(PathAddress.EMPTY_ADDRESS)) { AttributeAccess aa = reg.getAttributeAccess(PathAddress.EMPTY_ADDRESS, name); if (aa.getStorageType() == AttributeAccess.Storage.RUNTIME){ allFields.remove(name); continue;
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; }