@Override public String next(PatchingValidationErrorHandler context) { int i = idx; if (i >= size) { throw new NoSuchElementException(); } idx = i + 1; final String patch = patches.get(i); final int nextIdx = i + 1; String nextPatch = null; if (nextIdx < size) { nextPatch = patches.get(nextIdx); } final PatchingArtifacts.PatchID patchID = new PatchingArtifacts.PatchID(patch, nextPatch); processor.processRoot(PatchingArtifacts.HISTORY_RECORD, patchID, context); return patch; } };
@Override public boolean isValid(PatchingArtifactValidationContext context) { try { // Check the target state we are rolling back to final PatchableTarget.TargetInfo target = rollbackIdentity.getIdentity().loadTargetInfo(); final List<String> patches = target.getPatchIDs(); final String rollbackTo; if (patches.isEmpty()) { rollbackTo = target.getCumulativePatchID(); } else { rollbackTo = patches.get(0); } final String ref = reference.getNextPatchID(); if (rollbackTo.equals(ref)) { return true; } else if (ref == null && Constants.BASE.equals(rollbackTo)) { return true; } else { context.getErrorHandler().addInconsistent(PatchingArtifacts.ROLLBACK_TARGET, this); } } catch (IOException e) { context.getErrorHandler().addError(PatchingArtifacts.ROLLBACK_TARGET, this); } return false; }
@Override public boolean isValid(PatchingArtifactValidationContext context) { try { // Check the target state we are rolling back to final PatchableTarget.TargetInfo target = rollbackIdentity.getIdentity().loadTargetInfo(); final List<String> patches = target.getPatchIDs(); final String rollbackTo; if (patches.isEmpty()) { rollbackTo = target.getCumulativePatchID(); } else { rollbackTo = patches.get(0); } final String ref = reference.getNextPatchID(); if (rollbackTo.equals(ref)) { return true; } else if (ref == null && Constants.BASE.equals(rollbackTo)) { return true; } else { context.getErrorHandler().addInconsistent(PatchingArtifacts.ROLLBACK_TARGET, this); } } catch (IOException e) { context.getErrorHandler().addError(PatchingArtifacts.ROLLBACK_TARGET, this); } return false; }
@Override public String next(PatchingValidationErrorHandler context) { int i = idx; if (i >= size) { throw new NoSuchElementException(); } idx = i + 1; final String patch = patches.get(i); final int nextIdx = i + 1; String nextPatch = null; if (nextIdx < size) { nextPatch = patches.get(nextIdx); } final PatchingArtifacts.PatchID patchID = new PatchingArtifacts.PatchID(patch, nextPatch); processor.processRoot(PatchingArtifacts.HISTORY_RECORD, patchID, context); return patch; } };
@Override public boolean process(PatchingArtifacts.PatchID parent, PatchingArtifactProcessor processor) { final InstalledIdentity identity = processor.getValidationContext().getInstalledIdentity(); final File history = identity.getInstalledImage().getPatchHistoryDir(parent.getPatchID()); final PatchingFileArtifact.DirectoryArtifactState state = new PatchingFileArtifact.DirectoryArtifactState(history, this); return processor.process(this, state); }
@Override public String toString() { return reference.getPatchID() != null ? reference.getPatchID() : Constants.BASE; } }
@Override public String toString() { return reference.getPatchID() != null ? reference.getPatchID() : Constants.BASE; } }
@Override public boolean process(PatchingArtifacts.PatchID parent, PatchingArtifactProcessor processor) { final InstalledIdentity identity = processor.getValidationContext().getInstalledIdentity(); final File history = identity.getInstalledImage().getPatchHistoryDir(parent.getPatchID()); final PatchingFileArtifact.DirectoryArtifactState state = new PatchingFileArtifact.DirectoryArtifactState(history, this); return processor.process(this, state); }