org.jboss.as.controller.operations.common.Util.createOperation()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中org.jboss.as.controller.operations.common.Util.createOperation()方法的一些代码示例,展示了Util.createOperation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.createOperation()方法的具体详情如下:
包路径:org.jboss.as.controller.operations.common.Util
类名称:Util
方法名:createOperation

Util.createOperation介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

/**
 * 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);
}

代码示例来源:origin: wildfly/wildfly

public static ModelNode createReadResourceOperation(PathAddress address) {
  return Util.createOperation(ModelDescriptionConstants.READ_RESOURCE_OPERATION, address);
}

代码示例来源:origin: wildfly/wildfly

/**
 * 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;
}

代码示例来源:origin: wildfly/wildfly

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;
}

代码示例来源:origin: wildfly/wildfly

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;
}

代码示例来源:origin: wildfly/wildfly

@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;
  }
}

代码示例来源:origin: wildfly/wildfly

@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;
  }
};

代码示例来源:origin: wildfly/wildfly

@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;
  }
};

代码示例来源:origin: wildfly/wildfly

@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());
  }
};

代码示例来源:origin: wildfly/wildfly

@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());
  }
};

代码示例来源:origin: wildfly/wildfly

@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;
  }
};

代码示例来源:origin: wildfly/wildfly

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");

代码示例来源:origin: org.wildfly.core/wildfly-controller

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;
}

代码示例来源:origin: org.jboss.as/jboss-as-controller

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;
}

代码示例来源:origin: org.wildfly.core/wildfly-controller

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;
}

代码示例来源:origin: org.wildfly.core/wildfly-controller

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;
}

代码示例来源:origin: org.jboss.as/jboss-as-controller

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;
}

代码示例来源:origin: org.jboss.as/jboss-as-controller

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;
}

代码示例来源:origin: org.wildfly/wildfly-controller

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;
}

代码示例来源:origin: org.wildfly/wildfly-controller

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;
}

相关文章