final ModelNode result = response.get(RESULT); result.get(Constants.PATCH_ID).set(next.getPatchId()); result.get(Constants.TYPE).set(next.getType().getName()); final Patch metadata = next.getMetadata(); result.get(Constants.IDENTITY_NAME).set(metadata.getIdentity().getName());
final ModelNode result = response.get(RESULT); result.get(Constants.PATCH_ID).set(next.getPatchId()); result.get(Constants.TYPE).set(next.getType().getName()); final Patch metadata = next.getMetadata(); result.get(Constants.IDENTITY_NAME).set(metadata.getIdentity().getName());
final ModelNode result = new ModelNode(); result.get(Constants.PATCH_ID).set(entry.getPatchId()); result.get(Constants.TYPE).set(entry.getType().getName()); result.get(Constants.DESCRIPTION).set(entry.getMetadata().getDescription()); final String link = entry.getMetadata().getLink();
final ModelNode result = new ModelNode(); result.get(Constants.PATCH_ID).set(entry.getPatchId()); result.get(Constants.TYPE).set(entry.getType().getName()); result.get(Constants.DESCRIPTION).set(entry.getMetadata().getDescription()); final String link = entry.getMetadata().getLink();
private void displayPatchXml(CommandContext ctx, Patch patch) throws CommandException { final Identity identity = patch.getIdentity(); SimpleTable table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", patch.getPatchId()}); table.addLine(new String[]{"Type:", identity.getPatchType().getName()}); table.addLine(new String[]{"Identity name:", identity.getName()}); table.addLine(new String[]{"Identity version:", identity.getVersion()}); table.addLine(new String[]{"Description:", patch.getDescription() == null ? "n/a" : patch.getDescription()}); if (patch.getLink() != null) { table.addLine(new String[]{"Link:", patch.getLink()}); } ctx.printLine(table.toString(false)); if (verbose) { ctx.printLine(""); ctx.printLine("ELEMENTS"); for (PatchElement e : patch.getElements()) { table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", e.getId()}); table.addLine(new String[]{"Name:", e.getProvider().getName()}); table.addLine(new String[]{"Type:", e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER}); table.addLine(new String[]{"Description:", e.getDescription()}); ctx.printLine(""); ctx.printLine(table.toString(false)); } } } }
private void displayPatchXml(CommandContext ctx, Patch patch) throws CommandException { final Identity identity = patch.getIdentity(); SimpleTable table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", patch.getPatchId()}); table.addLine(new String[]{"Type:", identity.getPatchType().getName()}); table.addLine(new String[]{"Identity name:", identity.getName()}); table.addLine(new String[]{"Identity version:", identity.getVersion()}); table.addLine(new String[]{"Description:", patch.getDescription() == null ? "n/a" : patch.getDescription()}); if (patch.getLink() != null) { table.addLine(new String[]{"Link:", patch.getLink()}); } ctx.printLine(table.toString(false)); if (verbose) { ctx.printLine(""); ctx.printLine("ELEMENTS"); for (PatchElement e : patch.getElements()) { table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", e.getId()}); table.addLine(new String[]{"Name:", e.getProvider().getName()}); table.addLine(new String[]{"Type:", e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER}); table.addLine(new String[]{"Description:", e.getDescription()}); ctx.printLine(""); ctx.printLine(table.toString(false)); } } } }
private void displayPatchXml(CommandContext ctx, Patch patch) throws CommandLineException { final Identity identity = patch.getIdentity(); SimpleTable table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", patch.getPatchId()}); table.addLine(new String[]{"Type:", identity.getPatchType().getName()}); table.addLine(new String[]{"Identity name:", identity.getName()}); table.addLine(new String[]{"Identity version:", identity.getVersion()}); table.addLine(new String[]{"Description:", patch.getDescription() == null ? "n/a" : patch.getDescription()}); if (patch.getLink() != null) { table.addLine(new String[]{"Link:", patch.getLink()}); } ctx.printLine(table.toString(false)); if(verbose.isPresent(ctx.getParsedCommandLine())) { ctx.printLine(""); ctx.printLine("ELEMENTS"); for(PatchElement e : patch.getElements()) { table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", e.getId()}); table.addLine(new String[]{"Name:", e.getProvider().getName()}); table.addLine(new String[]{"Type:", e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER}); table.addLine(new String[]{"Description:", e.getDescription()}); ctx.printLine(""); ctx.printLine(table.toString(false)); } } }
private void displayPatchXml(CommandContext ctx, Patch patch) throws CommandLineException { final Identity identity = patch.getIdentity(); SimpleTable table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", patch.getPatchId()}); table.addLine(new String[]{"Type:", identity.getPatchType().getName()}); table.addLine(new String[]{"Identity name:", identity.getName()}); table.addLine(new String[]{"Identity version:", identity.getVersion()}); table.addLine(new String[]{"Description:", patch.getDescription() == null ? "n/a" : patch.getDescription()}); if (patch.getLink() != null) { table.addLine(new String[]{"Link:", patch.getLink()}); } ctx.printLine(table.toString(false)); if(verbose.isPresent(ctx.getParsedCommandLine())) { ctx.printLine(""); ctx.printLine("ELEMENTS"); for(PatchElement e : patch.getElements()) { table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", e.getId()}); table.addLine(new String[]{"Name:", e.getProvider().getName()}); table.addLine(new String[]{"Type:", e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER}); table.addLine(new String[]{"Description:", e.getDescription()}); ctx.printLine(""); ctx.printLine(table.toString(false)); } } }
private static void fillHistoryIn(ModelNode result, Entry entry) throws PatchingException { ModelNode history = new ModelNode(); history.get(Constants.PATCH_ID).set(entry.getPatchId()); history.get(Constants.TYPE).set(entry.getType().getName()); final ModelNode appliedAtNode = history.get(Constants.APPLIED_AT); if(entry.getAppliedAt() != null) { appliedAtNode.set(entry.getAppliedAt()); } history.get(Constants.AGED_OUT).set(entry.isAgedOut()); result.add(history); } }
private static void assertUpgrade(final PatchType patchType) throws PatchingException { if (!PatchType.CUMULATIVE.equals(patchType)) { throw new PatchingException("Merging one-off patches is not supported at this point."); } }
private static void fillHistoryIn(ModelNode result, Entry entry) throws PatchingException { ModelNode history = new ModelNode(); history.get(Constants.PATCH_ID).set(entry.getPatchId()); history.get(Constants.TYPE).set(entry.getType().getName()); final ModelNode appliedAtNode = history.get(Constants.APPLIED_AT); if(entry.getAppliedAt() != null) { appliedAtNode.set(entry.getAppliedAt()); } history.get(Constants.AGED_OUT).set(entry.isAgedOut()); result.add(history); } }
private static void assertUpgrade(final PatchType patchType) throws PatchingException { if (!PatchType.CUMULATIVE.equals(patchType)) { throw new PatchingException("Merging one-off patches is not supported at this point."); } }