public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // Log that this is deprecated ConnectorLogger.ROOT_LOGGER.legacyDisableEnableOperation(operation.get(OP).asString()); // Just delegate to write-attribute. ModelNode writeAttributeOp = getWriteAttributeOperation(context.getCurrentAddress(), Constants.ENABLED.getName(), enabled); OperationStepHandler writeHandler = context.getResourceRegistration().getOperationHandler(PathAddress.EMPTY_ADDRESS, WRITE_ATTRIBUTE_OPERATION); // set the addFirst param to 'true' so the write-attribute runs before any other steps already registered; // i.e. in the logically equivalent spot in the sequence to this step context.addStep(writeAttributeOp, writeHandler, OperationContext.Stage.MODEL, true); } }
if (!oldPropValue.equals(value)) { ModelNode writeOp = Util.getWriteAttributeOperation(legacyAddress.append(PathElement.pathElement(PROPERTY, key)), VALUE, value); operations.add(writeOp);
private void testNonMapTransformersWork(KernelServices services, ModelVersion version) throws Exception { final PathAddress stackAddr = PathAddress.pathAddress(SUBSYSTEM, getMainSubsystemName()).append("stack", "test"); ModelNode addStack = Util.createAddOperation(stackAddr); executeOpInBothControllersWithAttachments(services, version, addStack); final PathAddress transportAddr = stackAddr.append("transport", "tcp"); ModelNode addTransport = Util.createAddOperation(transportAddr); addTransport.get(SocketBindingProtocolResourceDefinition.Attribute.SOCKET_BINDING.getName()).set("some-binding"); addTransport.get(MODULE).set("do.reject"); TransformedOperation op = services.executeInMainAndGetTheTransformedOperation(addTransport, version); Assert.assertTrue(op.rejectOperation(success())); final PathAddress protocolAddr = stackAddr.append("protocol", "PING"); ModelNode addProtocol = Util.createAddOperation(protocolAddr); addProtocol.get(MODULE).set("do.reject"); op = services.executeInMainAndGetTheTransformedOperation(addProtocol, version); Assert.assertTrue(op.rejectOperation(success())); op = services.executeInMainAndGetTheTransformedOperation(Util.getWriteAttributeOperation(transportAddr, MODULE, "reject.this"), version); Assert.assertTrue(op.rejectOperation(success())); op = services.executeInMainAndGetTheTransformedOperation(Util.getWriteAttributeOperation(protocolAddr, MODULE, "reject.this"), version); Assert.assertTrue(op.rejectOperation(success())); }
private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final String value) { if (value != null && !value.isEmpty()) { final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value); operationList.add(update); } } /**
private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final String value) { if (value != null && !value.isEmpty()) { final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value); operationList.add(update); } } /**
private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value); operationList.add(update); } } private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value); operationList.add(update); } } private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value); operationList.add(update); } } private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value); operationList.add(update); } }
private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value); operationList.add(update); } } private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value); operationList.add(update); } }
private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value); operationList.add(update); } } private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value); operationList.add(update); } }
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value); operationList.add(update); } }
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value); operationList.add(update); } }
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value); operationList.add(update); } }
private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value); operationList.add(update); } } private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value); operationList.add(update); } }
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) { if (value != null && value.isDefined() && value.asString().length() > 0) { final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value); operationList.add(update); } }
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // Log that this is deprecated ConnectorLogger.ROOT_LOGGER.legacyDisableEnableOperation(operation.get(OP).asString()); // Just delegate to write-attribute. ModelNode writeAttributeOp = getWriteAttributeOperation(context.getCurrentAddress(), Constants.ENABLED.getName(), enabled); OperationStepHandler writeHandler = context.getResourceRegistration().getOperationHandler(PathAddress.EMPTY_ADDRESS, WRITE_ATTRIBUTE_OPERATION); // set the addFirst param to 'true' so the write-attribute runs before any other steps already registered; // i.e. in the logically equivalent spot in the sequence to this step context.addStep(writeAttributeOp, writeHandler, OperationContext.Stage.MODEL, true); } }