@Override public boolean hasContent(byte[] hash) { return contentRepository.hasContent(hash); }
@Override public boolean hasContent(byte[] hash) { return contentRepository.hasContent(hash); }
@Override public boolean hasContent(byte[] hash) { return contentRepository.hasContent(hash); }
@Override public boolean hasContent(byte[] hash) { return contentRepository.hasContent(hash); }
private static boolean needRemoteContent(HostFileRepository fileRepository, ContentRepository contentRepository, boolean backup, byte[] oldHash) { return fileRepository != null && (backup || (contentRepository != null && contentRepository.hasContent(oldHash))); }
private static boolean needRemoteContent(HostFileRepository fileRepository, ContentRepository contentRepository, boolean backup, byte[] oldHash) { return fileRepository != null && (backup || (contentRepository != null && contentRepository.hasContent(oldHash))); }
@Override public boolean syncContent(byte[] hash) { if(! contentRepository.hasContent(hash)) { getDeploymentFiles(hash); // Make sure it's in sync } return contentRepository.hasContent(hash); }
@Override public boolean syncContent(byte[] hash) { if(! contentRepository.hasContent(hash)) { getDeploymentFiles(hash); // Make sure it's in sync } return contentRepository.hasContent(hash); }
@Override public boolean syncContent(ContentReference reference) { if (!contentRepository.hasContent(reference.getHash())) { getDeploymentFiles(reference); // Make sure it's in sync } return contentRepository.hasContent(reference.getHash()); }
@Override public boolean syncContent(ContentReference reference) { if (!contentRepository.hasContent(reference.getHash())) { getDeploymentFiles(reference); // Make sure it's in sync } return contentRepository.hasContent(reference.getHash()); }
@Override public void handleResult(OperationContext.ResultAction resultAction, OperationContext context, ModelNode operation) { if (resultAction == OperationContext.ResultAction.KEEP) { if (oldHash != null && contentRepository.hasContent(oldHash)) { contentRepository.removeContent(ModelContentReference.fromModelAddress(address, oldHash)); } if (contentRepository.hasContent(newHash)) { contentRepository.addContentReference(ModelContentReference.fromModelAddress(context.getCurrentAddress(), newHash)); } } // else the model update will be reverted and no ref content repo references changes will be made so // the newly exploded content will be eligible for content repo gc } });
@Override public void handleResult(OperationContext.ResultAction resultAction, OperationContext context, ModelNode operation) { if (resultAction == OperationContext.ResultAction.KEEP) { if (oldHash != null && contentRepository.hasContent(oldHash)) { contentRepository.removeContent(ModelContentReference.fromModelAddress(address, oldHash)); } if (contentRepository.hasContent(newHash)) { contentRepository.addContentReference(ModelContentReference.fromModelAddress(context.getCurrentAddress(), newHash)); } } // else the model update will be reverted and no ref content repo references changes will be made so // the newly exploded content will be eligible for content repo gc } });
@Override void removeContent(PathAddress address, Set<String> newHashes, List<byte[]> hashes) { for (byte[] hash : hashes) { try { if (contentRepository.hasContent(hash)) { contentRepository.removeContent(ModelContentReference.fromModelAddress(address, hash)); } else if (newHashes.isEmpty() || !newHashes.contains(HashUtil.bytesToHexString(hash))) { fileRepository.deleteDeployment(ModelContentReference.fromModelAddress(address, hash)); } else { ROOT_LOGGER.undeployingDeploymentHasBeenRedeployed(address.getLastElement().getValue()); } } catch (Exception e) { ROOT_LOGGER.debugf(e, "Exception occurred removing %s", Arrays.asList(hash)); } } } }
@Override void removeContent(PathAddress address, Set<String> newHashes, List<byte[]> hashes) { for (byte[] hash : hashes) { try { if (contentRepository.hasContent(hash)) { contentRepository.removeContent(ModelContentReference.fromModelAddress(address, hash)); } else if (newHashes.isEmpty() || !newHashes.contains(HashUtil.bytesToHexString(hash))) { fileRepository.deleteDeployment(ModelContentReference.fromModelAddress(address, hash)); } else { ROOT_LOGGER.undeployingDeploymentHasBeenRedeployed(address.getLastElement().getValue()); } } catch (Exception e) { ROOT_LOGGER.debugf(e, "Exception occurred removing %s", Arrays.asList(hash)); } } } }
if (contentRepository != null) { if (!contentRepository.hasContent(hash)) { throw createFailureException(MESSAGES.noDeploymentContentWithHash(HashUtil.bytesToHexString(hash)));
if (fileRepository == null && contentRepository != null && !contentRepository.hasContent(hash)) { if (context.isBooting()) { if (context.getRunningMode() == RunningMode.ADMIN_ONLY) {
if (contentRepository != null) { if (!contentRepository.hasContent(newHash)) { throw createFailureException(DomainControllerLogger.ROOT_LOGGER.noDeploymentContentWithHash(HashUtil.bytesToHexString(newHash)));
if (fileRepository == null && contentRepository != null && !contentRepository.hasContent(hash)) { if (context.isBooting()) { if (context.getRunningMode() == RunningMode.ADMIN_ONLY) {
if (contentRepository != null) { if (!contentRepository.hasContent(newHash)) { throw createFailureException(DomainControllerLogger.ROOT_LOGGER.noDeploymentContentWithHash(HashUtil.bytesToHexString(newHash)));
if (contentRepository != null && !contentRepository.hasContent(hash)) { if (context.isBooting()) { if (context.getRunningMode() == RunningMode.ADMIN_ONLY) {