private void removeJacorbSubsystem(final PathAddress address, final Map<PathAddress, ModelNode> migrateOperations, boolean standalone) { ModelNode removeLegacySubsystemOperation = Util.createRemoveOperation(address); migrateOperations.put(address, removeLegacySubsystemOperation); if(standalone) { removeLegacySubsystemOperation = createRemoveOperation(JACORB_EXTENSION); migrateOperations.put(JACORB_EXTENSION, removeLegacySubsystemOperation); } }
/** * {@inheritDoc} */ @Override public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) { ModelNode legacyOperation = Util.createRemoveOperation(this.addressTransformer.transform(address)); return new TransformedOperation(legacyOperation, OperationResultTransformer.ORIGINAL_RESULT); } }
protected static ModelNode getTransportRemoveOperation(String stackName, String type) { return Util.createRemoveOperation(getTransportAddress(stackName, type)); }
protected static ModelNode getLegacyTransportRemoveOperation(String stackName) { return Util.createRemoveOperation(getLegacyTransportAddress(stackName)); }
protected static ModelNode getTransportPropertyRemoveOperation(String stackName, String type, String propertyName) { return Util.createRemoveOperation(getTransportPropertyAddress(stackName, type, propertyName)); }
protected static ModelNode getProtocolRemoveOperation(String stackName, String type) { return Util.createRemoveOperation(getProtocolAddress(stackName, type)); }
protected static ModelNode getSubsystemRemoveOperation() { return Util.createRemoveOperation(getSubsystemAddress()); }
protected static ModelNode getProtocolStackRemoveOperation(String stackName) { return Util.createRemoveOperation(getProtocolStackAddress(stackName)); }
protected static ModelNode getProtocolPropertyRemoveOperation(String stackName, String protocolName, String propertyName) { return Util.createRemoveOperation(getProtocolPropertyAddress(stackName, protocolName, propertyName)); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { Resource existing = context.readResource(PathAddress.EMPTY_ADDRESS); OperationStepHandler addHandler = context.getResourceRegistration().getSubModel(PathAddress.EMPTY_ADDRESS.append(newKeyName)).getOperationHandler(PathAddress.EMPTY_ADDRESS, "add"); ModelNode value = operation.get(VALUE); if (value.isDefined()) { List<ModelNode> modules = new ArrayList<ModelNode>(value.asList()); Collections.reverse(modules); //need to reverse it to make sure they are added in proper order for (ModelNode module : modules) { ModelNode addModuleOp = module.clone(); String code = addModuleOp.get(Constants.CODE).asString(); PathElement relativePath = PathElement.pathElement(newKeyName, code); PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)).append(relativePath); addModuleOp.get(OP_ADDR).set(address.toModelNode()); addModuleOp.get(OP).set(ADD); context.addStep(new ModelNode(), addModuleOp, addHandler, OperationContext.Stage.MODEL, true); } } //remove on the end to make sure it is executed first for (Resource.ResourceEntry entry : existing.getChildren(newKeyName)) { PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)).append(entry.getPathElement()); ModelNode removeModuleOp = Util.createRemoveOperation(address); context.addStep(new ModelNode(), removeModuleOp, new SecurityDomainReloadRemoveHandler(), OperationContext.Stage.MODEL, true); } } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { Resource existing = context.readResource(PathAddress.EMPTY_ADDRESS); OperationStepHandler addHandler = context.getResourceRegistration().getSubModel(PathAddress.EMPTY_ADDRESS.append(newKeyName)).getOperationHandler(PathAddress.EMPTY_ADDRESS, "add"); oldAttribute.validateOperation(operation); List<ModelNode> modules = new ArrayList<ModelNode>(operation.get(oldAttribute.getName()).asList()); Collections.reverse(modules); //need to reverse it to make sure they are added in proper order for (ModelNode module : modules) { ModelNode addModuleOp = module.clone(); String code = addModuleOp.get(Constants.CODE).asString(); PathElement relativePath = PathElement.pathElement(newKeyName, code); PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)).append(relativePath); addModuleOp.get(OP_ADDR).set(address.toModelNode()); addModuleOp.get(OP).set(ADD); context.addStep(new ModelNode(), addModuleOp, addHandler, OperationContext.Stage.MODEL, true); } //remove on the end to make sure it is executed first for (Resource.ResourceEntry entry : existing.getChildren(newKeyName)) { PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)).append(entry.getPathElement()); ModelNode removeModuleOp = Util.createRemoveOperation(address); context.addStep(new ModelNode(), removeModuleOp, new SecurityDomainReloadRemoveHandler(), 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); } };
@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) { 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 removeOperation = Util.createRemoveOperation(protocolAddress); context.addStep(removeOperation, context.getResourceRegistration().getOperationHandler(PathAddress.pathAddress(protocolPath), ModelDescriptionConstants.REMOVE), context.getCurrentStage()); } };
ModelNode removeOperation = Util.createRemoveOperation(legacyAddress.append(PathElement.pathElement(PROPERTY, prop.getKey()))); operations.add(removeOperation);
if (context.readResourceFromRoot(parentAddress, false).hasChild(path)) { context.addStep(Util.createRemoveOperation(address), context.getRootResourceRegistration().getOperationHandler(address, ModelDescriptionConstants.REMOVE), OperationContext.Stage.MODEL); context.addStep(operation, this, OperationContext.Stage.MODEL); return; context.addStep(Util.createRemoveOperation(singletonAddress), context.getRootResourceRegistration().getOperationHandler(singletonAddress, ModelDescriptionConstants.REMOVE), OperationContext.Stage.MODEL);
ModelNode remove = Util.createRemoveOperation(stackAddress.append(ProtocolResourceDefinition.pathElement("FD"))); ModelTestUtils.checkOutcome(services.executeOperation(remove)); add = Operations.createAddOperation(stackAddress.append(ProtocolResourceDefinition.pathElement("FD")), 3); //The original index of the FD protocol
/** * {@inheritDoc} */ @Override public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) { ModelNode legacyOperation = Util.createRemoveOperation(this.addressTransformer.transform(address)); return new TransformedOperation(legacyOperation, OperationResultTransformer.ORIGINAL_RESULT); } }
@Override public void removeResource() throws ManagementOperationException { if (isExistentResource()) { final PathAddress address = getResourcePathAddress(); final ModelNode op = Util.createRemoveOperation(address); serverConfiguration.executeManagementOperation(op); } }
@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); } };