state.patchIndex = 0; } else { final String releaseID = state.currentInfo.getCumulativePatchID(); if(BASE.equals(releaseID)) { throw new NoSuchElementException(PatchLogger.ROOT_LOGGER.noMorePatches());
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; }
state.patchIndex = 0; } else { final String releaseID = state.currentInfo.getCumulativePatchID(); if(BASE.equals(releaseID)) { throw new NoSuchElementException(PatchLogger.ROOT_LOGGER.noMorePatches());
File modulePatchDirectory = updatedInstalledIdentity.getLayers().get(0).loadTargetInfo().getDirectoryStructure().getModulePatchDirectory(layerPatchID); assertDirExists(modulePatchDirectory); assertDefinedModule(modulePatchDirectory, moduleName, moduleAdded.getItem().getContentHash());
File modulePatchDirectory = updatedInstalledIdentity.getLayers().get(0).loadTargetInfo().getDirectoryStructure().getModulePatchDirectory(releaseLayerPatchID); assertDirExists(modulePatchDirectory); assertDefinedModule(modulePatchDirectory, moduleName, moduleAdded.getItem().getContentHash()); modulePatchDirectory = installedIdentityAfterOneOffPatch.getLayers().get(0).loadTargetInfo().getDirectoryStructure().getModulePatchDirectory(oneOffLayerPatchID); assertDirExists(modulePatchDirectory); assertDefinedModule(modulePatchDirectory, moduleName, moduleModified.getItem().getContentHash()); File layerModuleRoot = updatedInstalledIdentity.getLayers().get(0).loadTargetInfo().getDirectoryStructure().getModuleRoot(); assertDirDoesNotExist(newFile(layerModuleRoot, moduleName));
File modulePatchDirectory = installedIdentityAfterOneOffPatch.getLayers().get(0).loadTargetInfo().getDirectoryStructure().getModulePatchDirectory(oneOffLayerPatchID); assertDirExists(modulePatchDirectory); assertDefinedModule(modulePatchDirectory, moduleName, moduleAdded.getItem().getContentHash()); modulePatchDirectory = installedIdentityAfterOneOffPatch.getLayers().get(0).loadTargetInfo().getDirectoryStructure().getModulePatchDirectory(releaseLayerPatchID); assertDirExists(modulePatchDirectory); assertDefinedModule(modulePatchDirectory, moduleName, moduleAddedInReleasePatch.getItem().getContentHash());
try { final PatchableTarget.TargetInfo info = installedIdentity.getIdentity().loadTargetInfo(); activeHistory.addAll(info.getPatchIDs()); activeHistory.add(info.getCumulativePatchID()); } catch(IOException e) { throw new RuntimeException(e);
try { final PatchableTarget.TargetInfo info = installedIdentity.getIdentity().loadTargetInfo(); activeHistory.addAll(info.getPatchIDs()); activeHistory.add(info.getCumulativePatchID()); } catch(IOException e) { throw new RuntimeException(e);
File modulePatchDirectory = updatedInstalledIdentity.getLayers().get(0).loadTargetInfo().getDirectoryStructure().getModulePatchDirectory(releaseLayerPatchID); assertDirExists(modulePatchDirectory); assertDefinedModule(modulePatchDirectory, moduleName, moduleAdded.getItem().getContentHash()); modulePatchDirectory = installedIdentityAfterOneOffPatch.getLayers().get(0).loadTargetInfo().getDirectoryStructure().getModulePatchDirectory(oneOffLayerPatchID); assertDirExists(modulePatchDirectory); assertDefinedModule(modulePatchDirectory, moduleName, moduleModified.getItem().getContentHash());
final TargetInfo layerInfo = vInfo.getLayerInfo(name); final ModelNode layerNode = layersNode.get(name); layerNode.get(Constants.CUMULATIVE).set(layerInfo.getCumulativePatchID()); final ModelNode patchesNode = layerNode.get(Constants.PATCHES).setEmptyList(); if(!layerInfo.getPatchIDs().isEmpty()) { for(String patchId : layerInfo.getPatchIDs()) { patchesNode.add(patchId); for(String name : vInfo.getAddOnNames()) { final TargetInfo layerInfo = vInfo.getAddOnInfo(name); layerNode.get(name, Constants.CUMULATIVE).set(layerInfo.getCumulativePatchID()); final ModelNode patchesNode = layerNode.get(Constants.PATCHES).setEmptyList(); if(!layerInfo.getPatchIDs().isEmpty()) { for(String patchId : layerInfo.getPatchIDs()) { patchesNode.add(patchId);
final TargetInfo layerInfo = vInfo.getLayerInfo(name); final ModelNode layerNode = layersNode.get(name); layerNode.get(Constants.CUMULATIVE).set(layerInfo.getCumulativePatchID()); final ModelNode patchesNode = layerNode.get(Constants.PATCHES).setEmptyList(); if(!layerInfo.getPatchIDs().isEmpty()) { for(String patchId : layerInfo.getPatchIDs()) { patchesNode.add(patchId); for(String name : vInfo.getAddOnNames()) { final TargetInfo layerInfo = vInfo.getAddOnInfo(name); layerNode.get(name, Constants.CUMULATIVE).set(layerInfo.getCumulativePatchID()); final ModelNode patchesNode = layerNode.get(Constants.PATCHES).setEmptyList(); if(!layerInfo.getPatchIDs().isEmpty()) { for(String patchId : layerInfo.getPatchIDs()) { patchesNode.add(patchId);
private static boolean hasNext(IteratorImpl i, IteratorState state) { if(BASE.equals(state.currentInfo.getCumulativePatchID())) { if(state.currentInfo.getPatchIDs().isEmpty()) { return false; // unpatched final int size = state.currentInfo.getPatchIDs().size(); if(state.patchIndex < size) { return existsOnDisk(i, state.currentInfo.getPatchIDs().get(state.patchIndex)); final String releaseID = state.currentInfo.getCumulativePatchID(); if(BASE.equals(releaseID)) { return false; return existsOnDisk(i, state.currentInfo.getCumulativePatchID()); final RollbackPatch patch = (RollbackPatch) patchBuilder.build(); PatchableTarget.TargetInfo nextInfo = patch.getIdentityState().getIdentity().loadTargetInfo(); if(BASE.equals(nextInfo.getCumulativePatchID())) { if(nextInfo.getPatchIDs().isEmpty()) { return false; } else if(!existsOnDisk(i, nextInfo.getCumulativePatchID())) { return false;
File modulePatchDirectory = updatedInstalledIdentity.getLayers().get(0).loadTargetInfo().getDirectoryStructure().getModulePatchDirectory(layerPatchID); assertDirExists(modulePatchDirectory); assertDefinedModule(modulePatchDirectory, moduleName, moduleAdded.getItem().getContentHash());
private static boolean hasNext(IteratorImpl i, IteratorState state) { if(BASE.equals(state.currentInfo.getCumulativePatchID())) { if(state.currentInfo.getPatchIDs().isEmpty()) { return false; // unpatched final int size = state.currentInfo.getPatchIDs().size(); if(state.patchIndex < size) { return existsOnDisk(i, state.currentInfo.getPatchIDs().get(state.patchIndex)); final String releaseID = state.currentInfo.getCumulativePatchID(); if(BASE.equals(releaseID)) { return false; return existsOnDisk(i, state.currentInfo.getCumulativePatchID()); final RollbackPatch patch = (RollbackPatch) patchBuilder.build(); PatchableTarget.TargetInfo nextInfo = patch.getIdentityState().getIdentity().loadTargetInfo(); if(BASE.equals(nextInfo.getCumulativePatchID())) { if(nextInfo.getPatchIDs().isEmpty()) { return false; } else if(!existsOnDisk(i, nextInfo.getCumulativePatchID())) { return false;
File modulePatchDirectory = updatedInstalledIdentity.getLayers().get(0).loadTargetInfo().getDirectoryStructure().getModulePatchDirectory(layerPatchID); assertDirExists(modulePatchDirectory); assertDefinedModule(modulePatchDirectory, moduleName, moduleAdded.getItem().getContentHash());
assertEquals(BASE, identityInfo.getCumulativePatchID()); assertTrue(identityInfo.getPatchIDs().isEmpty()); assertFileExists(env.getInstalledImage().getJbossHome(), "bin", fileAdded.getItem().getName()); DirectoryStructure layerDirStructure = patchedInstalledIdentity.getLayers().get(0).loadTargetInfo().getDirectoryStructure(); File modulesPatchDir = layerDirStructure.getModulePatchDirectory(layerPatchId); assertDirExists(modulesPatchDir); PatchingAssert.assertFileDoesNotExist(env.getInstalledImage().getJbossHome(), "bin", fileAdded.getItem().getName()); if (File.separatorChar != '\\') { assertDirDoesNotExist(rolledBackInstalledIdentity.getLayers().get(0).loadTargetInfo().getDirectoryStructure().getModulePatchDirectory(layerPatchId));
final TargetInfo patchingInfo = identity.loadTargetInfo(); final StringBuilder buf = new StringBuilder(); for(String id : patchingInfo.getPatchIDs()) { if(buf.length() > 0) { buf.append(", "); buf.append("none"); PatchLogger.ROOT_LOGGER.logPatchingInfo(identity.getName(), patchingInfo.getCumulativePatchID(), buf.toString()); if(cleanup) { try {
assertFileExists(env.getInstalledImage().getJbossHome(), "bin", fileAdded.getItem().getName()); DirectoryStructure addOnStructure = installedIdentity.getAddOns().iterator().next().loadTargetInfo().getDirectoryStructure(); File modulesPatchDir = addOnStructure.getModulePatchDirectory(addOnPatchID); assertDirExists(modulesPatchDir);
final TargetInfo patchingInfo = identity.loadTargetInfo(); final StringBuilder buf = new StringBuilder(); for(String id : patchingInfo.getPatchIDs()) { if(buf.length() > 0) { buf.append(", "); buf.append("none"); PatchLogger.ROOT_LOGGER.logPatchingInfo(identity.getName(), patchingInfo.getCumulativePatchID(), buf.toString()); if(cleanup) { try {
assertEquals(BASE, identityInfo.getCumulativePatchID()); assertTrue(identityInfo.getPatchIDs().isEmpty()); assertFileExists(env.getInstalledImage().getJbossHome(), "bin", fileAdded.getItem().getName()); DirectoryStructure layerDirStructure = patchedInstalledIdentity.getAddOns().iterator().next().loadTargetInfo().getDirectoryStructure(); File modulesPatchDir = layerDirStructure.getModulePatchDirectory(addOnPatchID); assertDirExists(modulesPatchDir);