@Override ContentModification createRollbackEntry(ContentModification original, MiscContentItem item, byte[] targetHash) { final ModificationType type; if (Arrays.equals(NO_CONTENT, item.getContentHash()) && !backup.exists()) { type = ModificationType.REMOVE; } else { type = ModificationType.MODIFY; } return new ContentModification(item, targetHash, type, original.getCondition()); }
@Override ContentModification createRollbackEntry(ContentModification original, MiscContentItem item, byte[] targetHash) { final ModificationType type; if (Arrays.equals(NO_CONTENT, item.getContentHash()) && !backup.exists()) { type = ModificationType.REMOVE; } else { type = ModificationType.MODIFY; } return new ContentModification(item, targetHash, type, original.getCondition()); }
@Override ContentModification createRollbackEntry(ContentModification original, byte[] targetHash, byte[] itemHash) { final ModuleItem item = createContentItem(contentItem, itemHash); return new ContentModification(item, targetHash, ModificationType.MODIFY, original.getCondition()); } }
@Override public boolean isRelevant(PatchingTaskContext context) throws PatchingException { final ModificationCondition condition = description.getModification().getCondition(); if(condition == null) { return true; } return condition.isSatisfied(context); }
@Override public boolean isRelevant(PatchingTaskContext context) throws PatchingException { final ModificationCondition condition = description.getModification().getCondition(); if(condition == null) { return true; } return condition.isSatisfied(context); }
@Override public boolean isRelevant(PatchingTaskContext context) throws PatchingException { final ModificationCondition condition = description.getModification().getCondition(); if(condition == null) { return true; } return condition.isSatisfied(context); }
@Override ContentModification createRollbackEntry(ContentModification original, byte[] targetHash, byte[] itemHash) { final ModuleItem item = createContentItem(contentItem, itemHash); return new ContentModification(item, targetHash, ModificationType.MODIFY, original.getCondition()); } }
@Override public boolean isRelevant(PatchingTaskContext context) throws PatchingException { final ModificationCondition condition = description.getModification().getCondition(); if(condition == null) { return true; } return condition.isSatisfied(context); }
@Override ContentModification createRollbackEntry(ContentModification original, byte[] targetHash, byte[] itemHash) { final BundleItem item = new BundleItem(contentItem.getName(), contentItem.getSlot(), itemHash); switch (original.getType()) { case ADD: return new ContentModification(item, targetHash, ModificationType.REMOVE, original.getCondition()); case REMOVE: return new ContentModification(item, targetHash, ModificationType.ADD, original.getCondition()); default: return new ContentModification(item, targetHash, ModificationType.MODIFY, original.getCondition()); } }
@Override ContentModification createRollbackEntry(ContentModification original, byte[] targetHash, byte[] itemHash) { final BundleItem item = new BundleItem(contentItem.getName(), contentItem.getSlot(), itemHash); switch (original.getType()) { case ADD: return new ContentModification(item, targetHash, ModificationType.REMOVE, original.getCondition()); case REMOVE: return new ContentModification(item, targetHash, ModificationType.ADD, original.getCondition()); default: return new ContentModification(item, targetHash, ModificationType.MODIFY, original.getCondition()); } }
protected ContentModification getOriginalModification(byte[] targetHash, byte[] itemHash) { final ContentModification original = super.getOriginalModification(targetHash, itemHash); final ModificationType type; if (Arrays.equals(NO_CONTENT, itemHash) && !backup.exists()) { type = ModificationType.ADD; } else { type = ModificationType.MODIFY; } return new ContentModification(original.getItem(), original.getTargetHash(), type, original.getCondition()); } }
protected ContentModification getOriginalModification(byte[] targetHash, byte[] itemHash) { final ContentModification original = super.getOriginalModification(targetHash, itemHash); final ModificationType type; if (Arrays.equals(NO_CONTENT, itemHash) && !backup.exists()) { type = ModificationType.ADD; } else { type = ModificationType.MODIFY; } return new ContentModification(original.getItem(), original.getTargetHash(), type, original.getCondition()); } }
@Override ContentModification createRollbackEntry(ContentModification original, byte[] targetHash, byte[] itemHash) { // Although modules are ignored for rollback, we still keep track of our changes final ModuleItem item = createContentItem(contentItem, itemHash); final ModificationType type; // Check if the module did not exist before. Invalidated patches might include the module already // and we need to track that they can be rolled back to the last state if (original.getType() != ModificationType.MODIFY && itemHash.length == 0) { type = ModificationType.REMOVE; } else { type = ModificationType.MODIFY; } return new ContentModification(item, targetHash, type, original.getCondition()); }
@Override ContentModification createRollbackEntry(ContentModification original, byte[] targetHash, byte[] itemHash) { // Although modules are ignored for rollback, we still keep track of our changes final ModuleItem item = createContentItem(contentItem, itemHash); final ModificationType type; // Check if the module did not exist before. Invalidated patches might include the module already // and we need to track that they can be rolled back to the last state if (original.getType() != ModificationType.MODIFY && itemHash.length == 0) { type = ModificationType.REMOVE; } else { type = ModificationType.MODIFY; } return new ContentModification(item, targetHash, type, original.getCondition()); }
@Override protected ContentModification getOriginalModification(byte[] targetHash, byte[] itemHash) { final ModuleItem original = getContentItem(); final ModuleItem item = new ModuleItem(original.getName(), original.getSlot(), targetHash); return new ContentModification(item, description.getModification().getTargetHash(), ModificationType.MODIFY, description.getModification().getCondition()); }
@Override protected ContentModification getOriginalModification(byte[] targetHash, byte[] itemHash) { final ModuleItem original = getContentItem(); final ModuleItem item = new ModuleItem(original.getName(), original.getSlot(), targetHash); return new ContentModification(item, description.getModification().getTargetHash(), ModificationType.MODIFY, description.getModification().getCondition()); }
final ModificationCondition condition = modification.getCondition(); if(condition != null) { writer.writeAttribute(Attribute.CONDITION.name, condition.toString());
static ContentModification resolveDefinition(final PatchingTasks.ContentTaskDefinition definition) { // Only available in a single patch, yay! if(definition.getLatest() == definition.getTarget()) { return definition.getTarget().getModification(); } // Create a new modification replacing the latest final ContentItem backupItem = definition.getTarget().getItem(); final ContentModification modification = definition.getTarget().getModification(); final byte[] target = definition.getLatest().getTargetHash(); return new ContentModification(backupItem, target, modification.getType(), modification.getCondition()); }
static ContentModification resolveDefinition(final PatchingTasks.ContentTaskDefinition definition) { // Only available in a single patch, yay! if(definition.getLatest() == definition.getTarget()) { return definition.getTarget().getModification(); } // Create a new modification replacing the latest final ContentItem backupItem = definition.getTarget().getItem(); final ContentModification modification = definition.getTarget().getModification(); final byte[] target = definition.getLatest().getTargetHash(); return new ContentModification(backupItem, target, modification.getType(), modification.getCondition()); }
case MISC: final File home = target.getDirectoryStructure().getInstalledImage().getJbossHome(); final ModificationCondition condition = modification.getCondition(); if(condition != null) { if(condition instanceof ModificationCondition.ExistsCondition) {