@Override protected ModelNode rollback(String streamName, String patchId, ContentPolicyBuilderImpl builder, boolean rollbackTo, boolean resetConfiguration) throws PatchingException { final ModelNode operation = createOperation(Constants.ROLLBACK, address.toModelNode(), builder); operation.get(Constants.PATCH_ID).set(patchId); operation.get(Constants.RESET_CONFIGURATION).set(resetConfiguration); operation.get(Constants.ROLLBACK_TO).set(rollbackTo); if(streamName != null) { operation.get(ModelDescriptionConstants.OP_ADDR).add(Constants.PATCH_STREAM, streamName); } return executeOp(operation); }
@Override protected ModelNode info(String streamName, String patchId, boolean verbose) throws PatchingException { final ModelNode operation = new ModelNode(); operation.get(ModelDescriptionConstants.OP).set(Constants.PATCH_INFO); operation.get(ModelDescriptionConstants.OP_ADDR).set(address.toModelNode()); operation.get(Constants.PATCH_ID).set(patchId); if(streamName != null) { operation.get(ModelDescriptionConstants.OP_ADDR).add(Constants.PATCH_STREAM, streamName); } if(verbose) { operation.get(Constants.VERBOSE).set(true); } return executeOp(operation); }
@Override protected ModelNode history(String streamName, boolean excludeAgedOut) throws PatchingException { final ModelNode operation = new ModelNode(); operation.get(OP).set(Constants.SHOW_HISTORY); operation.get(OP_ADDR).set(address.toModelNode()); if(streamName != null) { operation.get(ModelDescriptionConstants.OP_ADDR).add(Constants.PATCH_STREAM, streamName); } if(excludeAgedOut) { operation.get(Constants.EXCLUDE_AGED_OUT).set(true); } return executeOp(operation); }
@Override protected ModelNode rollbackLast(ContentPolicyBuilderImpl builder, boolean restoreConfiguration) throws PatchingException { return rollbackLast(null, builder, restoreConfiguration); }
@Override protected ModelNode info(String patchId, boolean verbose) throws PatchingException { return info(null, patchId, verbose); }
@Override protected ModelNode info() throws PatchingException { return info(null); }
@Override protected ModelNode info(String streamName, String patchId, boolean verbose) throws PatchingException { final ModelNode operation = new ModelNode(); operation.get(ModelDescriptionConstants.OP).set(Constants.PATCH_INFO); operation.get(ModelDescriptionConstants.OP_ADDR).set(address.toModelNode()); operation.get(Constants.PATCH_ID).set(patchId); if(streamName != null) { operation.get(ModelDescriptionConstants.OP_ADDR).add(Constants.PATCH_STREAM, streamName); } if(verbose) { operation.get(Constants.VERBOSE).set(true); } return executeOp(operation); }
@Override protected ModelNode info() throws PatchingException { return info(null); }
@Override protected ModelNode streams() throws PatchingException { final ModelNode operation = new ModelNode(); operation.get(ModelDescriptionConstants.OP_ADDR).set(address.toModelNode()); operation.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.READ_CHILDREN_NAMES_OPERATION); operation.get(ModelDescriptionConstants.CHILD_TYPE).set(Constants.PATCH_STREAM); return executeOp(operation); }
@Override protected ModelNode rollback(String patchId, ContentPolicyBuilderImpl builder, boolean rollbackTo, boolean resetConfiguration) throws PatchingException { return rollback(null, patchId, builder, rollbackTo, resetConfiguration); }
@Override protected ModelNode history(String streamName, boolean excludeAgedOut) throws PatchingException { final ModelNode operation = new ModelNode(); operation.get(OP).set(Constants.SHOW_HISTORY); operation.get(OP_ADDR).set(address.toModelNode()); if(streamName != null) { operation.get(ModelDescriptionConstants.OP_ADDR).add(Constants.PATCH_STREAM, streamName); } if(excludeAgedOut) { operation.get(Constants.EXCLUDE_AGED_OUT).set(true); } return executeOp(operation); }
/** * Create a host target. * * @param hostName the host name * @param client the connected controller client to the master host. * @return the remote target */ public static final PatchOperationTarget createHost(final String hostName, final ModelControllerClient client) { final PathElement host = PathElement.pathElement(HOST, hostName); final PathAddress address = PathAddress.EMPTY_ADDRESS.append(host, CORE_SERVICES); return new RemotePatchOperationTarget(address, client); }
@Override protected ModelNode applyPatch(final File file, final ContentPolicyBuilderImpl policyBuilder) throws PatchingException { final ModelNode operation = createOperation(Constants.PATCH, address.toModelNode(), policyBuilder); operation.get(INPUT_STREAM_INDEX).set(0); final OperationBuilder operationBuilder = OperationBuilder.create(operation); operationBuilder.addFileAsAttachment(file); return executeOp(operationBuilder.build()); }
@Override protected ModelNode info(String streamName) throws PatchingException { final ModelNode operation = new ModelNode(); operation.get(ModelDescriptionConstants.OP).set(Constants.PATCH_INFO); operation.get(ModelDescriptionConstants.OP_ADDR).set(address.toModelNode()); if(streamName != null) { operation.get(ModelDescriptionConstants.OP_ADDR).add(Constants.PATCH_STREAM, streamName); } operation.get(Constants.VERBOSE).set(true); return executeOp(operation); }
/** * Create a host target. * * @param hostName the host name * @param client the connected controller client to the master host. * @return the remote target */ public static final PatchOperationTarget createHost(final String hostName, final ModelControllerClient client) { final PathElement host = PathElement.pathElement(HOST, hostName); final PathAddress address = PathAddress.EMPTY_ADDRESS.append(host, CORE_SERVICES); return new RemotePatchOperationTarget(address, client); }
@Override protected ModelNode rollbackLast(ContentPolicyBuilderImpl builder, boolean restoreConfiguration) throws PatchingException { return rollbackLast(null, builder, restoreConfiguration); }
@Override protected ModelNode rollback(String patchId, ContentPolicyBuilderImpl builder, boolean rollbackTo, boolean resetConfiguration) throws PatchingException { return rollback(null, patchId, builder, rollbackTo, resetConfiguration); }
@Override protected ModelNode history(boolean excludeAgedOut) throws PatchingException { return history(null, excludeAgedOut); }
@Override protected ModelNode info(String streamName) throws PatchingException { final ModelNode operation = new ModelNode(); operation.get(ModelDescriptionConstants.OP).set(Constants.PATCH_INFO); operation.get(ModelDescriptionConstants.OP_ADDR).set(address.toModelNode()); if(streamName != null) { operation.get(ModelDescriptionConstants.OP_ADDR).add(Constants.PATCH_STREAM, streamName); } operation.get(Constants.VERBOSE).set(true); return executeOp(operation); }
/** * Create a standalone target. * * @param controllerClient the connected controller client to a standalone instance. * @return the remote target */ public static final PatchOperationTarget createStandalone(final ModelControllerClient controllerClient) { final PathAddress address = PathAddress.EMPTY_ADDRESS.append(CORE_SERVICES); return new RemotePatchOperationTarget(address, controllerClient); }