@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { Resource r = context.readResource(PathAddress.EMPTY_ADDRESS, false); //to make sure resource we are removing exists! it will throw exception. super.updateModel(context, operation); recordCapabilitiesAndRequirements(context, r); }
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { checkIfLastIdentityStore(context); super.updateModel(context, operation); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress address = context.getCurrentAddress(); String configurationName = address.getElement(address.size() - 2).getValue(); String partitionManagerName = address.getElement(address.size() - 3).getValue(); String identityStoreName = address.getLastElement().getValue(); context.removeService(PartitionManagerService.createIdentityStoreServiceName(partitionManagerName, configurationName, identityStoreName)); context.completeStep(OperationContext.ResultHandler.NOOP_RESULT_HANDLER); } }, OperationContext.Stage.RUNTIME); }
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { checkIfLastIdentityStore(context); super.updateModel(context, operation); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress address = context.getCurrentAddress(); String configurationName = address.getElement(address.size() - 2).getValue(); String partitionManagerName = address.getElement(address.size() - 3).getValue(); String identityStoreName = address.getLastElement().getValue(); context.removeService(PartitionManagerService.createIdentityStoreServiceName(partitionManagerName, configurationName, identityStoreName)); context.completeStep(OperationContext.ResultHandler.NOOP_RESULT_HANDLER); } }, OperationContext.Stage.RUNTIME); }
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress partitionManagerAddress = getParentAddress(context.getCurrentAddress()); Resource partitionManagerResource = context.readResourceFromRoot(partitionManagerAddress); checkIfLastConfiguration(partitionManagerResource); ModelNode originalParentModel = Resource.Tools.readModel(partitionManagerResource); super.updateModel(context, operation); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PartitionManagerRemoveHandler.INSTANCE .removeIdentityStoreServices(context, originalParentModel, partitionManagerAddress.getLastElement().getValue(), context.getCurrentAddressValue()); context.completeStep(OperationContext.ResultHandler.NOOP_RESULT_HANDLER); } }, OperationContext.Stage.RUNTIME); }
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress partitionManagerAddress = getParentAddress(context.getCurrentAddress()); Resource partitionManagerResource = context.readResourceFromRoot(partitionManagerAddress); checkIfLastConfiguration(partitionManagerResource); ModelNode originalParentModel = Resource.Tools.readModel(partitionManagerResource); super.updateModel(context, operation); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PartitionManagerRemoveHandler.INSTANCE .removeIdentityStoreServices(context, originalParentModel, partitionManagerAddress.getLastElement().getValue(), context.getCurrentAddressValue()); context.completeStep(OperationContext.ResultHandler.NOOP_RESULT_HANDLER); } }, OperationContext.Stage.RUNTIME); }
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { super.updateModel(context, operation); PathAddress partitionManagerAddress = getParentAddress(PathAddress.pathAddress(operation.require(OP_ADDR))); Resource partitionManagerResource = context.readResourceFromRoot(partitionManagerAddress); ModelNode parentModel = Resource.Tools.readModel(partitionManagerResource); PartitionManagerAddHandler.INSTANCE.validateModel(context, partitionManagerAddress.getLastElement().getValue(), parentModel); }
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { super.updateModel(context, operation); PathAddress partitionManagerAddress = getParentAddress(PathAddress.pathAddress(operation.require(OP_ADDR))); Resource partitionManagerResource = context.readResourceFromRoot(partitionManagerAddress); ModelNode parentModel = Resource.Tools.readModel(partitionManagerResource); PartitionManagerAddHandler.INSTANCE.validateModel(context, partitionManagerAddress.getLastElement().getValue(), parentModel); }