static File[] getBundlePath(final DirectoryStructure structure, final PatchableTarget.TargetInfo info) { final List<String> patches = info.getPatchIDs(); final List<File> path = new ArrayList<File>(); for (final String patch : patches) { path.add(structure.getBundlesPatchDirectory(patch)); } final String ref = info.getCumulativePatchID(); if (!BASE.equals(ref)) { path.add(structure.getBundlesPatchDirectory(ref)); } path.add(structure.getBundleRepositoryRoot()); return path.toArray(new File[path.size()]); }
static File[] getBundlePath(final DirectoryStructure structure, final PatchableTarget.TargetInfo info) { final List<String> patches = info.getPatchIDs(); final List<File> path = new ArrayList<File>(); for (final String patch : patches) { path.add(structure.getBundlesPatchDirectory(patch)); } final String ref = info.getCumulativePatchID(); if (!BASE.equals(ref)) { path.add(structure.getBundlesPatchDirectory(ref)); } path.add(structure.getBundleRepositoryRoot()); return path.toArray(new File[path.size()]); }
static File[] getModulePath(final DirectoryStructure structure, final PatchableTarget.TargetInfo info) { final List<File> path = new ArrayList<File>(); final List<String> patches = info.getPatchIDs(); for (final String patch : patches) { path.add(structure.getModulePatchDirectory(patch)); } final String ref = info.getCumulativePatchID(); if (!BASE.equals(ref)) { path.add(structure.getModulePatchDirectory(ref)); } path.add(structure.getModuleRoot()); return path.toArray(new File[path.size()]); }
static File[] getModulePath(final DirectoryStructure structure, final PatchableTarget.TargetInfo info) { final List<File> path = new ArrayList<File>(); final List<String> patches = info.getPatchIDs(); for (final String patch : patches) { path.add(structure.getModulePatchDirectory(patch)); } final String ref = info.getCumulativePatchID(); if (!BASE.equals(ref)) { path.add(structure.getModulePatchDirectory(ref)); } path.add(structure.getModuleRoot()); return path.toArray(new File[path.size()]); }
@Override public String getCumulativePatchID() { return current.getCumulativePatchID(); }
static void checkState(final PatchableTarget.TargetInfo o, final PatchableTarget.TargetInfo n) { assert n.getPatchIDs().equals(o.getPatchIDs()); assert n.getCumulativePatchID().equals(o.getCumulativePatchID()); }
@Override public String getCumulativePatchID() { return current.getCumulativePatchID(); }
static void writeTargetInfo(final XMLExtendedStreamWriter writer, final Element element, final PatchableTarget target) throws XMLStreamException { try { final PatchableTarget.TargetInfo info = target.loadTargetInfo(); // writer.writeEmptyElement(element.name); writer.writeAttribute(Attribute.NAME.name, target.getName()); writer.writeAttribute(Attribute.RELEASE_ID.name, info.getCumulativePatchID()); if (! info.getPatchIDs().isEmpty()) { writer.writeAttribute(Attribute.PATCHES.name, PatchUtils.asString(info.getPatchIDs())); } } catch (IOException e) { throw new XMLStreamException(e); } }
static void checkState(final PatchableTarget.TargetInfo o, final PatchableTarget.TargetInfo n) { assert n.getPatchIDs().equals(o.getPatchIDs()); assert n.getCumulativePatchID().equals(o.getCumulativePatchID()); }
public static void assertInstallationIsPatched(Patch patch, PatchableTarget.TargetInfo targetInfo) { if (CUMULATIVE == patch.getIdentity().getPatchType()) { assertEquals(patch.getPatchId(), targetInfo.getCumulativePatchID()); } else { Assert.assertTrue(targetInfo.getPatchIDs().contains(patch.getPatchId())); // applied one-off patch is at the top of the patchIDs assertEquals(patch.getPatchId(), targetInfo.getPatchIDs().get(0)); } } }
protected void restore() throws IOException { if (modified) { // persist the state for bundles and modules directory persist(current.getCumulativePatchID(), current.getPatchIDs(), current.getProperties()); } }
protected void restore() throws IOException { if (modified) { // persist the state for bundles and modules directory persist(current.getCumulativePatchID(), current.getPatchIDs(), current.getProperties()); } }
MutableTargetImpl(PatchableTarget.TargetInfo current, String currentVersion) { this.current = current; this.structure = current.getDirectoryStructure(); this.cumulativeID = current.getCumulativePatchID(); this.patchIds = new ArrayList<String>(current.getPatchIDs()); this.properties = new Properties(current.getProperties()); this.version = currentVersion; }
static void assertNotApplied(final Patch.PatchType patchType, final String patchId, final PatchableTarget.TargetInfo targetInfo) { if (patchType == Patch.PatchType.CUMULATIVE) { Assert.assertNotEquals(patchId, targetInfo.getCumulativePatchID()); } else { Assert.assertFalse(targetInfo.getPatchIDs().contains(patchId)); } final DirectoryStructure structure = targetInfo.getDirectoryStructure(); assertDoesNotExists(structure.getBundlesPatchDirectory(patchId)); assertDoesNotExists(structure.getModulePatchDirectory(patchId)); }
MutableTargetImpl(PatchableTarget.TargetInfo current, String currentVersion) { this.current = current; this.structure = current.getDirectoryStructure(); this.cumulativeID = current.getCumulativePatchID(); this.patchIds = new ArrayList<String>(current.getPatchIDs()); this.properties = new Properties(current.getProperties()); this.version = currentVersion; }
public static void assertPatchHasBeenRolledBack(PatchingResult result, Identity expectedIdentity) throws IOException { assertEquals(expectedIdentity.getVersion(), result.getPatchInfo().getVersion()); assertEquals(expectedIdentity.loadTargetInfo().getCumulativePatchID(), result.getPatchInfo().getCumulativePatchID()); assertEquals(expectedIdentity.loadTargetInfo().getPatchIDs(), result.getPatchInfo().getPatchIDs()); }
@Override void handle(ModelNode result, Identity info) throws IOException { result.set(info.loadTargetInfo().getCumulativePatchID()); } });
public static void assertPatchHasBeenRolledBack(PatchingResult result, Patch patch, PatchableTarget.TargetInfo expectedPatchInfo) { assertEquals(expectedPatchInfo.getCumulativePatchID(), result.getPatchInfo().getCumulativePatchID()); assertEquals(expectedPatchInfo.getPatchIDs(), result.getPatchInfo().getPatchIDs()); // assertNoResourcesForPatch(result.getPatchInfo(), patch); }
@Override void handle(ModelNode result, Identity info) throws IOException { result.set(info.loadTargetInfo().getCumulativePatchID()); } });
static void assertIsApplied(final Patch.PatchType patchType, final String patchId, final PatchableTarget.TargetInfo targetInfo) { if (patchType == Patch.PatchType.CUMULATIVE) { Assert.assertEquals(patchId, targetInfo.getCumulativePatchID()); Assert.assertTrue(targetInfo.getPatchIDs().isEmpty()); } else { Assert.assertTrue(targetInfo.getPatchIDs().contains(patchId)); } final DirectoryStructure structure = targetInfo.getDirectoryStructure(); assertExists(structure.getBundlesPatchDirectory(patchId)); assertExists(structure.getModulePatchDirectory(patchId)); }