private void addOpenjdkExtension(final OperationContext context, final Map<PathAddress, ModelNode> migrateOperations) { final PathAddress extensionAddress = PathAddress.EMPTY_ADDRESS.append(OPENJDK_EXTENSION_ELEMENT); OperationEntry addEntry = context.getRootResourceRegistration().getOperationEntry(extensionAddress, ADD); final ModelNode addOperation = Util.createAddOperation(extensionAddress); if (describe) { migrateOperations.put(extensionAddress, addOperation); } else { context.addStep(context.getResult().get(extensionAddress.toString()), addOperation, addEntry.getOperationHandler(), MODEL); } }
@Override public void execute(OperationContext context, ModelNode operation) { operationDeprecated(context, operation); PathAddress address = context.getCurrentAddress(); String protocol = operation.require(AbstractProtocolResourceDefinition.DeprecatedAttribute.TYPE.getName()).asString(); PathElement protocolPath = ProtocolResourceDefinition.pathElement(protocol); PathAddress protocolAddress = address.append(protocolPath); ModelNode protocolOperation = Util.createAddOperation(protocolAddress); OperationEntry addOperationEntry = context.getResourceRegistration().getOperationEntry(PathAddress.pathAddress(protocolPath), ModelDescriptionConstants.ADD); for (AttributeDefinition attribute : addOperationEntry.getOperationDefinition().getParameters()) { String name = attribute.getName(); if (operation.hasDefined(name)) { protocolOperation.get(name).set(operation.get(name)); } } context.addStep(protocolOperation, addOperationEntry.getOperationHandler(), OperationContext.Stage.MODEL, true); } };
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { operationDeprecated(context, operation); PathAddress address = translateProxyPath(context); String type = operation.require(LoadMetricResourceDefinition.Attribute.TYPE.getName()).asString(); PathAddress metricPath = PathAddress.pathAddress(DynamicLoadProviderResourceDefinition.LEGACY_PATH, LoadMetricResourceDefinition.pathElement(type)); PathAddress metricPathAddress = address.append(metricPath); ModelNode metricOperation = Util.createAddOperation(metricPathAddress); OperationEntry addOperationEntry = context.getResourceRegistration().getOperationEntry(PathAddress.pathAddress(metricPath), ModelDescriptionConstants.ADD); for (AttributeDefinition attribute : addOperationEntry.getOperationDefinition().getParameters()) { String name = attribute.getName(); if (operation.hasDefined(name)) { metricOperation.get(name).set(operation.get(name)); } } context.addStep(metricOperation, addOperationEntry.getOperationHandler(), OperationContext.Stage.MODEL, true); } };
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { operationDeprecated(context, operation); PathAddress address = translateProxyPath(context); String type = operation.require(CustomLoadMetricResourceDefinition.Attribute.CLASS.getName()).asString(); PathAddress metricPath = PathAddress.pathAddress(DynamicLoadProviderResourceDefinition.LEGACY_PATH, LoadMetricResourceDefinition.pathElement(type)); PathAddress metricPathAddress = address.append(metricPath); ModelNode metricOperation = Util.createAddOperation(metricPathAddress); OperationEntry addOperationEntry = context.getResourceRegistration().getOperationEntry(PathAddress.pathAddress(metricPath), ModelDescriptionConstants.ADD); for (AttributeDefinition attribute : addOperationEntry.getOperationDefinition().getParameters()) { String name = attribute.getName(); if (operation.hasDefined(name)) { metricOperation.get(name).set(operation.get(name)); } } context.addStep(metricOperation, addOperationEntry.getOperationHandler(), OperationContext.Stage.MODEL, true); } };
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { operationDeprecated(context, operation); PathAddress address = translateProxyPath(context); String type = operation.require(LoadMetricResourceDefinition.Attribute.TYPE.getName()).asString(); PathAddress metricPath = PathAddress.pathAddress(DynamicLoadProviderResourceDefinition.LEGACY_PATH, LoadMetricResourceDefinition.pathElement(type)); PathAddress metricPathAddress = address.append(metricPath); ModelNode metricOperation = Util.createRemoveOperation(metricPathAddress); OperationEntry removeOperationEntry = context.getResourceRegistration().getOperationEntry(PathAddress.pathAddress(metricPath), ModelDescriptionConstants.REMOVE); context.addStep(metricOperation, removeOperationEntry.getOperationHandler(), OperationContext.Stage.MODEL, true); } };
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { operationDeprecated(context, operation); PathAddress address = translateProxyPath(context); String type = operation.require(CustomLoadMetricResourceDefinition.Attribute.CLASS.getName()).asString(); PathAddress metricPath = PathAddress.pathAddress(DynamicLoadProviderResourceDefinition.LEGACY_PATH, LoadMetricResourceDefinition.pathElement(type)); PathAddress metricPathAddress = address.append(metricPath); ModelNode metricOperation = Util.createRemoveOperation(metricPathAddress); OperationEntry removeOperationEntry = context.getResourceRegistration().getOperationEntry(PathAddress.pathAddress(metricPath), ModelDescriptionConstants.REMOVE); context.addStep(metricOperation, removeOperationEntry.getOperationHandler(), OperationContext.Stage.MODEL, true); } };
context.addStep(transportOperation, addOperationEntry.getOperationHandler(), OperationContext.Stage.MODEL); context.addStep(protocolOperation, addOperationEntry.getOperationHandler(), OperationContext.Stage.MODEL);
default OperationStepHandler getOperationStepHandler(String operationName, PathAddress address, ModelNode operation, OperationEntry operationEntry) { return operationEntry.getOperationHandler(); }
/** {@inheritDoc} */ @Override public final OperationStepHandler getOperationHandler(final PathAddress pathAddress, final String operationName) { OperationEntry entry = getOperationEntry(pathAddress, operationName); return entry == null ? null : entry.getOperationHandler(); }
/** {@inheritDoc} */ @Override public final OperationStepHandler getOperationHandler(final PathAddress pathAddress, final String operationName) { OperationEntry entry = getOperationEntry(pathAddress, operationName); return entry == null ? null : entry.getOperationHandler(); }
/** {@inheritDoc} */ @Override public final OperationStepHandler getOperationHandler(final PathAddress pathAddress, final String operationName) { OperationEntry entry = getOperationEntry(pathAddress, operationName); return entry == null ? null : entry.getOperationHandler(); }
/** {@inheritDoc} */ @Override public final OperationStepHandler getOperationHandler(final PathAddress pathAddress, final String operationName) { OperationEntry entry = getOperationEntry(pathAddress, operationName); return entry == null ? null : entry.getOperationHandler(); }
@Override public OperationStepHandler getOperationHandler(PathAddress address, String operationName) { return getOperationEntry(address, operationName).getOperationHandler(); }
private void addOpenjdkExtension(final OperationContext context, final Map<PathAddress, ModelNode> migrateOperations) { final PathAddress extensionAddress = PathAddress.EMPTY_ADDRESS.append(OPENJDK_EXTENSION_ELEMENT); OperationEntry addEntry = context.getRootResourceRegistration().getOperationEntry(extensionAddress, ADD); final ModelNode addOperation = Util.createAddOperation(extensionAddress); if (describe) { migrateOperations.put(extensionAddress, addOperation); } else { context.addStep(context.getResult().get(extensionAddress.toString()), addOperation, addEntry.getOperationHandler(), MODEL); } }
private void addStandaloneReport(OperationContext context, final Map<String, GlobalOperationHandlers.AvailableResponse> responseMap) { ModelNode reportOperation = Util.getEmptyOperation(SUB_OPERATION_NAME, PathAddress.EMPTY_ADDRESS.toModelNode()); final ModelNode response = new ModelNode(); GlobalOperationHandlers.AvailableResponse availableResponse = new GlobalOperationHandlers.AvailableResponse(response); OperationEntry entry = context.getResourceRegistration().getOperationEntry(PathAddress.EMPTY_ADDRESS, SUB_OPERATION_NAME); OperationStepHandler osh = entry.getOperationHandler(); GlobalOperationHandlers.AvailableResponseWrapper wrapper = new GlobalOperationHandlers.AvailableResponseWrapper(osh, availableResponse); context.addStep(response, reportOperation, wrapper, OperationContext.Stage.RUNTIME); responseMap.put("", availableResponse); ControllerLogger.ROOT_LOGGER.debug("We are asking the standalone server its report"); }
private void addHostReport(OperationContext context, PathAddress address, String host, final Map<String, GlobalOperationHandlers.AvailableResponse> responseMap) { ModelNode reportOperation = Util.getEmptyOperation(SUB_OPERATION_NAME, address.toModelNode()); final ModelNode response = new ModelNode(); GlobalOperationHandlers.AvailableResponse availableResponse = new GlobalOperationHandlers.AvailableResponse(response); responseMap.put(host, availableResponse); OperationEntry entry = context.getRootResourceRegistration().getOperationEntry(address, SUB_OPERATION_NAME); if (entry != null) { OperationStepHandler osh = entry.getOperationHandler(); GlobalOperationHandlers.AvailableResponseWrapper wrapper = new GlobalOperationHandlers.AvailableResponseWrapper(osh, availableResponse); context.addStep(response, reportOperation, wrapper, OperationContext.Stage.RUNTIME); ControllerLogger.ROOT_LOGGER.debugf("We are asking the host %s its report", host); } }
private void addStandaloneReport(OperationContext context, final Map<String, GlobalOperationHandlers.AvailableResponse> responseMap) { ModelNode reportOperation = Util.getEmptyOperation(SUB_OPERATION_NAME, PathAddress.EMPTY_ADDRESS.toModelNode()); final ModelNode response = new ModelNode(); GlobalOperationHandlers.AvailableResponse availableResponse = new GlobalOperationHandlers.AvailableResponse(response); OperationEntry entry = context.getResourceRegistration().getOperationEntry(PathAddress.EMPTY_ADDRESS, SUB_OPERATION_NAME); OperationStepHandler osh = entry.getOperationHandler(); GlobalOperationHandlers.AvailableResponseWrapper wrapper = new GlobalOperationHandlers.AvailableResponseWrapper(osh, availableResponse); context.addStep(response, reportOperation, wrapper, OperationContext.Stage.RUNTIME); responseMap.put("", availableResponse); ControllerLogger.ROOT_LOGGER.debug("We are asking the standalone server its report"); }
private void addServerReport(OperationContext context, PathAddress address, String server, final Map<String, GlobalOperationHandlers.AvailableResponse> responseMap) { ModelNode reportOperation = Util.getEmptyOperation(SUB_OPERATION_NAME, address.toModelNode()); final ModelNode response = new ModelNode(); GlobalOperationHandlers.AvailableResponse availableResponse = new GlobalOperationHandlers.AvailableResponse(response); responseMap.put(server, availableResponse); OperationEntry entry = context.getRootResourceRegistration().getOperationEntry(address, SUB_OPERATION_NAME); if (entry != null) { OperationStepHandler osh = entry.getOperationHandler(); GlobalOperationHandlers.AvailableResponseWrapper wrapper = new GlobalOperationHandlers.AvailableResponseWrapper(osh, availableResponse); context.addStep(response, reportOperation, wrapper, OperationContext.Stage.RUNTIME); ControllerLogger.ROOT_LOGGER.debugf("We are asking the server %s its report", server); } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { operationDeprecated(context, operation); PathAddress address = translateProxyPath(context); String type = operation.require(LoadMetricResourceDefinition.Attribute.TYPE.getName()).asString(); PathAddress metricPath = PathAddress.pathAddress(DynamicLoadProviderResourceDefinition.LEGACY_PATH, LoadMetricResourceDefinition.pathElement(type)); PathAddress metricPathAddress = address.append(metricPath); ModelNode metricOperation = Util.createRemoveOperation(metricPathAddress); OperationEntry removeOperationEntry = context.getResourceRegistration().getOperationEntry(PathAddress.pathAddress(metricPath), ModelDescriptionConstants.REMOVE); context.addStep(metricOperation, removeOperationEntry.getOperationHandler(), OperationContext.Stage.MODEL, true); } };
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { operationDeprecated(context, operation); PathAddress address = translateProxyPath(context); String type = operation.require(CustomLoadMetricResourceDefinition.Attribute.CLASS.getName()).asString(); PathAddress metricPath = PathAddress.pathAddress(DynamicLoadProviderResourceDefinition.LEGACY_PATH, LoadMetricResourceDefinition.pathElement(type)); PathAddress metricPathAddress = address.append(metricPath); ModelNode metricOperation = Util.createRemoveOperation(metricPathAddress); OperationEntry removeOperationEntry = context.getResourceRegistration().getOperationEntry(PathAddress.pathAddress(metricPath), ModelDescriptionConstants.REMOVE); context.addStep(metricOperation, removeOperationEntry.getOperationHandler(), OperationContext.Stage.MODEL, true); } };