/** * Creates a describe operation using the specified address. * @param address a resource path * @return a describe operation */ public static ModelNode createDescribeOperation(PathAddress address) { return Util.createOperation(ModelDescriptionConstants.DESCRIBE, address); }
public static ModelNode createReadResourceOperation(PathAddress address) { return Util.createOperation(ModelDescriptionConstants.READ_RESOURCE_OPERATION, address); }
/** * Creates a composite operation using the specified operation steps. * @param operations steps * @return a composite operation */ public static ModelNode createCompositeOperation(List<ModelNode> operations) { ModelNode operation = Util.createOperation(ModelDescriptionConstants.COMPOSITE, PathAddress.EMPTY_ADDRESS); ModelNode steps = operation.get(ModelDescriptionConstants.STEPS); for (ModelNode step: operations) { steps.add(step); } return operation; }
private static ModelNode createAttributeOperation(String operationName, PathAddress address, Attribute attribute) { ModelNode operation = Util.createOperation(operationName, address); operation.get(ModelDescriptionConstants.NAME).set(attribute.getName()); return operation; }
public static ModelNode createMapClearOperation(PathAddress address, Attribute attribute) { ModelNode operation = Util.createOperation(MapOperations.MAP_CLEAR_DEFINITION, address); operation.get(ModelDescriptionConstants.NAME).set(attribute.getName()); return operation; }
@Override public ModelNode transformOperation(ModelNode operation) { if (operation.get(NAME).asString().equals(PROPERTIES)) { String key = operation.get("key").asString(); PathAddress address = Operations.getPathAddress(operation); ModelNode transformedOperation = Util.createOperation(READ_ATTRIBUTE_OPERATION, address.append(PathElement.pathElement(PROPERTY, key))); transformedOperation.get(NAME).set(VALUE); return transformedOperation; } return operation; } }
@Override public ModelNode transformOperation(ModelNode operation) { String attributeName = Operations.getAttributeName(operation); if (Attribute.ALIASES.getName().equals(attributeName)) { ModelNode value = Operations.getAttributeValue(operation); PathAddress address = Operations.getPathAddress(operation); ModelNode transformedOperation = Util.createOperation(ALIAS_ADD, address); transformedOperation.get(ALIAS.getName()).set(value); return transformedOperation; } return operation; } };
@Override public ModelNode transformOperation(ModelNode operation) { String attributeName = Operations.getAttributeName(operation); if (Attribute.ALIASES.getName().equals(attributeName)) { ModelNode value = Operations.getAttributeValue(operation); PathAddress address = Operations.getPathAddress(operation); ModelNode transformedOperation = Util.createOperation(ALIAS_REMOVE, address); transformedOperation.get(ALIAS.getName()).set(value); return transformedOperation; } return operation; } };
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress address = context.getCurrentAddress().append(BinaryTableResourceDefinition.PATH); ModelNode readResourceOperation = Util.createOperation(ModelDescriptionConstants.READ_RESOURCE_OPERATION, address); operation.get(ModelDescriptionConstants.ATTRIBUTES_ONLY).set(true); context.addStep(readResourceOperation, new ReadResourceHandler(), context.getCurrentStage()); } };
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress address = context.getCurrentAddress().append(StringTableResourceDefinition.PATH); ModelNode readResourceOperation = Util.createOperation(ModelDescriptionConstants.READ_RESOURCE_OPERATION, address); operation.get(ModelDescriptionConstants.ATTRIBUTES_ONLY).set(true); context.addStep(readResourceOperation, new ReadResourceHandler(), context.getCurrentStage()); } };
@SuppressWarnings("deprecation") @Override public ModelNode transformOperation(ModelNode operation) { PathAddress address = Operations.getPathAddress(operation); String protocol = address.getLastElement().getValue(); PathAddress stackAddress = address.getParent(); ModelNode legacyOperation = Util.createOperation("remove-protocol", stackAddress); legacyOperation.get(AbstractProtocolResourceDefinition.DeprecatedAttribute.TYPE.getName()).set(protocol); return legacyOperation; } };
Assert.assertEquals(SUCCESS, result.get(OUTCOME).asString()); op = Util.createOperation(ModelDescriptionConstants.READ_RESOURCE_DESCRIPTION_OPERATION, getSubsystemAddress()); op.get(ModelDescriptionConstants.INCLUDE_ALIASES).set("true"); op.get(ModelDescriptionConstants.RECURSIVE).set("true");
public static ModelNode getRemoveSchemaLocationOperation(ModelNode address, String schemaURI) { ModelNode op = Util.createOperation(OPERATION_NAME, PathAddress.pathAddress(address)); op.get(URI.getName()).set(schemaURI); return op; }
public static ModelNode getRemoveSchemaLocationOperation(ModelNode address, String schemaURI) { ModelNode op = Util.createOperation(OPERATION_NAME, PathAddress.pathAddress(address)); op.get(URI.getName()).set(schemaURI); return op; }
public static ModelNode getAddSchemaLocationOperation(ModelNode address, String schemaUrl, String schemaLocation) { ModelNode op = Util.createOperation(OPERATION_NAME, PathAddress.pathAddress(address)); op.get(URI.getName()).set(schemaUrl); op.get(SCHEMA_LOCATION.getName()).set(schemaLocation); return op; }
public static ModelNode getAddNamespaceOperation(ModelNode address, String prefix, String uri) { ModelNode op = Util.createOperation(OPERATION_NAME, PathAddress.pathAddress(address)); op.get(NAMESPACE.getName()).set(prefix); op.get(URI.getName()).set(uri); return op; }
public static ModelNode getAddNamespaceOperation(ModelNode address, String prefix, String uri) { ModelNode op = Util.createOperation(OPERATION_NAME, PathAddress.pathAddress(address)); op.get(NAMESPACE.getName()).set(prefix); op.get(URI.getName()).set(uri); return op; }
public static ModelNode getAddSchemaLocationOperation(ModelNode address, String schemaUrl, String schemaLocation) { ModelNode op = Util.createOperation(OPERATION_NAME, PathAddress.pathAddress(address)); op.get(URI.getName()).set(schemaUrl); op.get(SCHEMA_LOCATION.getName()).set(schemaLocation); return op; }
public static ModelNode getAddNamespaceOperation(ModelNode address, String prefix, String uri) { ModelNode op = Util.createOperation(OPERATION_NAME, PathAddress.pathAddress(address)); op.get(NAMESPACE.getName()).set(prefix); op.get(URI.getName()).set(uri); return op; }
public static ModelNode getAddSchemaLocationOperation(ModelNode address, String schemaUrl, String schemaLocation) { ModelNode op = Util.createOperation(OPERATION_NAME, PathAddress.pathAddress(address)); op.get(URI.getName()).set(schemaUrl); op.get(SCHEMA_LOCATION.getName()).set(schemaLocation); return op; }