public static ModelNode getHistory(InstalledIdentity installedImage, PatchableTarget.TargetInfo info, boolean excludeAgedOut) throws PatchingException { final ModelNode result = new ModelNode(); result.setEmptyList(); fillHistoryIn(installedImage, info, result, excludeAgedOut); return result; }
IdentityPatchContext(final File backup, final PatchContentProvider contentProvider, final ContentVerificationPolicy contentPolicy, final InstallationManager.InstallationModification modification, final PatchingTaskContext.Mode mode, final InstalledImage installedImage) { this.miscTargetRoot = installedImage.getJbossHome(); this.mode = mode; this.contentProvider = contentProvider; this.contentPolicy = contentPolicy; this.modification = modification; this.installedImage = installedImage; this.history = PatchingHistory.Factory.getHistory(modification.getUnmodifiedInstallationState()); if (backup != null) { this.miscBackup = new File(backup, PatchContentLoader.MISC); this.configBackup = new File(backup, Constants.CONFIGURATION); } else { this.miscBackup = null; // This will trigger a failure when the root is actually needed this.configBackup = null; } this.identityEntry = new IdentityEntry(modification, null); }
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); }
IdentityPatchContext(final File backup, final PatchContentProvider contentProvider, final ContentVerificationPolicy contentPolicy, final InstallationManager.InstallationModification modification, final PatchingTaskContext.Mode mode, final InstalledImage installedImage) { this.miscTargetRoot = installedImage.getJbossHome(); this.mode = mode; this.contentProvider = contentProvider; this.contentPolicy = contentPolicy; this.modification = modification; this.installedImage = installedImage; this.history = PatchingHistory.Factory.getHistory(modification.getUnmodifiedInstallationState()); if (backup != null) { this.miscBackup = new File(backup, PatchContentLoader.MISC); this.configBackup = new File(backup, Constants.CONFIGURATION); } else { this.miscBackup = null; // This will trigger a failure when the root is actually needed this.configBackup = null; } this.identityEntry = new IdentityEntry(modification, null); }
public static ModelNode getHistory(InstalledIdentity installedImage, PatchableTarget.TargetInfo info) throws PatchingException { return getHistory(installedImage, info, false); }
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 ModelNode getHistory(TargetInfo info, boolean excludeAgedOut) throws PatchingException { return Factory.getHistory(installedIdentity, info, excludeAgedOut); }
@Override public ModelNode getHistory(TargetInfo info, boolean excludeAgedOut) throws PatchingException { return Factory.getHistory(installedIdentity, info, excludeAgedOut); }
public static ModelNode getHistory(InstalledIdentity installedImage, PatchableTarget.TargetInfo info) throws PatchingException { return getHistory(installedImage, info, false); }
@Override protected void execute(final OperationContext context, final ModelNode operation, final InstalledIdentity installedIdentity) throws OperationFailedException { final boolean excludeAgedOut = PatchResourceDefinition.EXCLUDE_AGEDOUT.resolveModelAttribute(context, operation).asBoolean(); try { final PatchableTarget.TargetInfo info = installedIdentity.getIdentity().loadTargetInfo(); final ModelNode result = PatchingHistory.Factory.getHistory(installedIdentity, info, excludeAgedOut); context.getResult().set(result); } catch (Throwable t) { PatchLogger.ROOT_LOGGER.debugf(t, "failed to get history"); throw PatchLogger.ROOT_LOGGER.failedToShowHistory(t); } } }
@Override protected void execute(final OperationContext context, final ModelNode operation, final InstalledIdentity installedIdentity) throws OperationFailedException { final boolean excludeAgedOut = PatchResourceDefinition.EXCLUDE_AGEDOUT.resolveModelAttribute(context, operation).asBoolean(); try { final PatchableTarget.TargetInfo info = installedIdentity.getIdentity().loadTargetInfo(); final ModelNode result = PatchingHistory.Factory.getHistory(installedIdentity, info, excludeAgedOut); context.getResult().set(result); } catch (Throwable t) { PatchLogger.ROOT_LOGGER.debugf(t, "failed to get history"); throw PatchLogger.ROOT_LOGGER.failedToShowHistory(t); } } }
@Override public PatchingHistory getPatchingHistory(String streamName) throws PatchingException { final InstalledIdentity identity = streamName == null ? manager.getDefaultIdentity() : manager.getInstalledIdentity(streamName, null); return PatchingHistory.Factory.getHistory(identity); }
@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); } };
@Override public PatchingHistory getPatchingHistory(String streamName) throws PatchingException { final InstalledIdentity identity = streamName == null ? manager.getDefaultIdentity() : manager.getInstalledIdentity(streamName, null); return PatchingHistory.Factory.getHistory(identity); }