@Override public ModelNode execute(PatchOperationTarget target) throws PatchingException { return target.applyPatch(file, this); } };
static ModelNode formatFailedResponse(final PatchingException e) { final ModelNode result = new ModelNode(); result.get(OUTCOME).set(FAILED); formatFailedResponse(e, result.get(FAILURE_DESCRIPTION)); return result; }
@Override public ModelNode execute(PatchOperationTarget target) throws PatchingException { return target.history(patchStream, excludeAgedOut); } };
PatchOperationTarget createPatchOperationTarget(CommandContext ctx) throws CommandException { final PatchOperationTarget target; final ParsedCommandLine args = ctx.getParsedCommandLine(); if (ctx.getModelControllerClient() != null) { if (distribution != null) { throw new CommandException("--distribution is not allowed when connected to the controller."); } if (modulePath != null) { throw new CommandException("--module-path is not allowed when connected to the controller."); } if (bundlePath != null) { throw new CommandException("--bundle-path is not allowed when connected to the controller."); } if (ctx.isDomainMode()) { target = PatchOperationTarget.createHost(host, ctx.getModelControllerClient()); } else { target = PatchOperationTarget.createStandalone(ctx.getModelControllerClient()); } } else { final File root = getJBossHome(); final List<File> modules = getFSArgument(modulePath, args, root, "modules"); final List<File> bundles = getFSArgument(bundlePath, args, root, "bundles"); try { target = PatchOperationTarget.createLocal(root, modules, bundles); } catch (Exception e) { throw new CommandException("Unable to apply patch to local JBOSS_HOME=" + root, e); } } return target; }
@Override public ModelNode execute(PatchOperationTarget target) throws PatchingException { return target.info(patchStream, patchId, verbose); } };
@Override public ModelNode execute(PatchOperationTarget target) throws PatchingException { return target.rollback(patchStream, patchId, this, rollbackTo, resetConfiguration); } };
@Override public ModelNode execute(PatchOperationTarget target) throws PatchingException { return target.rollbackLast(patchStream, this, resetConfiguration); } };
@Override public ModelNode execute(PatchOperationTarget target) throws PatchingException { return target.streams(); } };
static List<ModelNode> getPatches(CommandContext ctx, AbstractDistributionCommand cmd, String stream, String host) throws PatchingException, CommandException { if (ctx.isDomainMode()) { // Lookup hosts. List<String> hosts = host == null ? Util.getHosts(ctx.getModelControllerClient()) : Arrays.asList(host); List<ModelNode> patches = new ArrayList<>(); for (String h : hosts) { patches.addAll(getAllPatches(PatchOperationTarget. createHost(h, ctx.getModelControllerClient()), null)); } return patches; } else { return getPatches(cmd.createPatchOperationTarget(ctx), stream); } } }
PatchOperationTarget createPatchOperationTarget(CommandContext ctx) throws CommandException { final PatchOperationTarget target; final ParsedCommandLine args = ctx.getParsedCommandLine(); if (ctx.getModelControllerClient() != null) { if (distribution != null) { throw new CommandException("--distribution is not allowed when connected to the controller."); } if (modulePath != null) { throw new CommandException("--module-path is not allowed when connected to the controller."); } if (bundlePath != null) { throw new CommandException("--bundle-path is not allowed when connected to the controller."); } if (ctx.isDomainMode()) { target = PatchOperationTarget.createHost(host, ctx.getModelControllerClient()); } else { target = PatchOperationTarget.createStandalone(ctx.getModelControllerClient()); } } else { final File root = getJBossHome(); final List<File> modules = getFSArgument(modulePath, args, root, "modules"); final List<File> bundles = getFSArgument(bundlePath, args, root, "bundles"); try { target = PatchOperationTarget.createLocal(root, modules, bundles); } catch (Exception e) { throw new CommandException("Unable to apply patch to local JBOSS_HOME=" + root, e); } } return target; }
@Override public ModelNode execute(PatchOperationTarget target) throws PatchingException { return target.info(patchStream); } };
@Override public ModelNode execute(PatchOperationTarget target) throws PatchingException { return target.rollback(patchStream, patchId, this, rollbackTo, resetConfiguration); } };
@Override public ModelNode execute(PatchOperationTarget target) throws PatchingException { return target.rollbackLast(patchStream, this, resetConfiguration); } };
@Override public ModelNode execute(PatchOperationTarget target) throws PatchingException { return target.streams(); } };
static List<ModelNode> getPatches(CommandContext ctx, AbstractDistributionCommand cmd, String stream, String host) throws PatchingException, CommandException { if (ctx.isDomainMode()) { // Lookup hosts. List<String> hosts = host == null ? Util.getHosts(ctx.getModelControllerClient()) : Arrays.asList(host); List<ModelNode> patches = new ArrayList<>(); for (String h : hosts) { patches.addAll(getAllPatches(PatchOperationTarget. createHost(h, ctx.getModelControllerClient()), null)); } return patches; } else { return getPatches(cmd.createPatchOperationTarget(ctx), stream); } } }
target = PatchOperationTarget.createHost(hostName, ctx.getModelControllerClient()); } else { target = PatchOperationTarget.createStandalone(ctx.getModelControllerClient()); final List<File> bundles = getFSArgument(bundlePath, args, root, "bundles"); try { target = PatchOperationTarget.createLocal(root, modules, bundles); } catch (Exception e) { throw new CommandLineException("Unable to apply patch to local JBOSS_HOME=" + jbossHome, e);
static ModelNode formatFailedResponse(final PatchingException e) { final ModelNode result = new ModelNode(); result.get(OUTCOME).set(FAILED); formatFailedResponse(e, result.get(FAILURE_DESCRIPTION)); return result; }
protected ModelNode history() throws PatchingException { return history(false); } protected abstract ModelNode history(boolean excludeAgedOut) throws PatchingException;
@Override public ModelNode execute(PatchOperationTarget target) throws PatchingException { return target.info(patchStream); } };
@Override public ModelNode execute(PatchOperationTarget target) throws PatchingException { return target.applyPatch(file, this); } };