throw new IllegalStateException(PatchLogger.ROOT_LOGGER.failedToLoadInfo(installedIdentity.getIdentity().getName()), e); final PatchingHistory.Iterator i = PatchingHistory.Factory.iterator(installedIdentity, info); if(i.hasNextCP()) { i.nextCP();
throw new IllegalStateException(PatchLogger.ROOT_LOGGER.failedToLoadInfo(installedIdentity.getIdentity().getName()), e); final PatchingHistory.Iterator i = PatchingHistory.Factory.iterator(installedIdentity, info); if(i.hasNextCP()) { i.nextCP();
@Override protected void execute(final OperationContext context, final ModelNode operation, final InstalledIdentity installedIdentity) throws OperationFailedException { String patchId = PatchResourceDefinition.PATCH_ID_OPTIONAL.resolveModelAttribute(context, operation).asStringOrNull(); assert patchId != null; // the overridden execute(OperationContext context, ModelNode operation) ensures not final boolean verbose = PatchResourceDefinition.VERBOSE.resolveModelAttribute(context, operation).asBoolean(); final PatchableTarget.TargetInfo info; try { info = installedIdentity.getIdentity().loadTargetInfo(); } catch (Exception e) { throw new OperationFailedException(PatchLogger.ROOT_LOGGER.failedToLoadInfo(installedIdentity.getIdentity().getName()), e); } final PatchingHistory.Iterator i = PatchingHistory.Factory.iterator(installedIdentity, info); final ModelNode result = patchIdInfo(context, patchId, verbose, i); if (result == null) { context.getFailureDescription().set(PatchLogger.ROOT_LOGGER.patchNotFoundInHistory(patchId).getLocalizedMessage()); } else { context.getResult().set(result); } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); }
@Override protected void execute(final OperationContext context, final ModelNode operation, final InstalledIdentity installedIdentity) throws OperationFailedException { String patchId = PatchResourceDefinition.PATCH_ID_OPTIONAL.resolveModelAttribute(context, operation).asStringOrNull(); assert patchId != null; // the overridden execute(OperationContext context, ModelNode operation) ensures not final boolean verbose = PatchResourceDefinition.VERBOSE.resolveModelAttribute(context, operation).asBoolean(); final PatchableTarget.TargetInfo info; try { info = installedIdentity.getIdentity().loadTargetInfo(); } catch (Exception e) { throw new OperationFailedException(PatchLogger.ROOT_LOGGER.failedToLoadInfo(installedIdentity.getIdentity().getName()), e); } final PatchingHistory.Iterator i = PatchingHistory.Factory.iterator(installedIdentity, info); final ModelNode result = patchIdInfo(context, patchId, verbose, i); if (result == null) { context.getFailureDescription().set(PatchLogger.ROOT_LOGGER.patchNotFoundInHistory(patchId).getLocalizedMessage()); } else { context.getResult().set(result); } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); }
public static Iterator iterator(final InstalledIdentity mgr, final PatchableTarget.TargetInfo info) { return iterator(mgr, info, false); }
public static Iterator iterator(final InstalledIdentity mgr, final PatchableTarget.TargetInfo info) { return iterator(mgr, info, false); }
@Override public Iterator iterator(TargetInfo info, boolean excludeAgedOut) throws PatchingException { return Factory.iterator(installedIdentity, info, excludeAgedOut); } };
/** * Goes back in rollback history adding the patch id and it's application timestamp * to the resulting list. */ private static void fillHistoryIn(InstalledIdentity installedImage, PatchableTarget.TargetInfo info, ModelNode result, boolean excludeAgedOut) throws PatchingException { final Iterator i = iterator(installedImage, info, excludeAgedOut); while(i.hasNext()) { final Entry next = i.next(); fillHistoryIn(result, next); } }
@Override public Iterator iterator(TargetInfo info, boolean excludeAgedOut) throws PatchingException { return Factory.iterator(installedIdentity, info, excludeAgedOut); } };
/** * Goes back in rollback history adding the patch id and it's application timestamp * to the resulting list. */ private static void fillHistoryIn(InstalledIdentity installedImage, PatchableTarget.TargetInfo info, ModelNode result, boolean excludeAgedOut) throws PatchingException { final Iterator i = iterator(installedImage, info, excludeAgedOut); while(i.hasNext()) { final Entry next = i.next(); fillHistoryIn(result, next); } }