public static final ContentReference fromDeploymentName(String name, byte[] hash) { return fromDeploymentName(name, HashUtil.bytesToHexString(hash)); }
public File readRootFile(byte rootId, String filePath) throws RequestProcessingException { byte[] hash = HashUtil.hexStringToByteArray(filePath); return deploymentFileRepository.getDeploymentRoot(hash); } };
public static final ContentReference fromDeploymentName(String name, byte[] hash) { return fromDeploymentName(name, HashUtil.bytesToHexString(hash)); }
public File readRootFile(byte rootId, String filePath) throws RequestProcessingException { byte[] hash = HashUtil.hexStringToByteArray(filePath); return deploymentFileRepository.getDeploymentRoot(new ContentReference(filePath, hash)); } };
@Override public File getDeploymentRoot(byte[] deploymentHash) { String hex = deploymentHash == null ? "" : HashUtil.bytesToHexString(deploymentHash); final File file = localRepository.getDeploymentRoot(deploymentHash); if(! file.exists()) { return getFile(hex, DomainServerProtocol.PARAM_ROOT_ID_DEPLOYMENT); } return file; }
public File readRootFile(byte rootId, String filePath) throws RequestProcessingException { byte[] hash = HashUtil.hexStringToByteArray(filePath); return deploymentFileRepository.getDeploymentRoot(new ContentReference(filePath, hash)); } };
@Override public File getDeploymentRoot(byte[] deploymentHash) { String hex = deploymentHash == null ? "" : HashUtil.bytesToHexString(deploymentHash); final File file = localFileRepository.getDeploymentRoot(deploymentHash); if(! file.exists()) { return getFile(hex, DomainControllerProtocol.PARAM_ROOT_ID_DEPLOYMENT); } return file; }
private void parseRolloutPlans(XMLExtendedStreamReader reader, ModelNode address, List<ModelNode> list) throws XMLStreamException { String hash = readStringAttributeElement(reader, Attribute.SHA1.getLocalName()); ModelNode addAddress = address.clone().add(MANAGEMENT_CLIENT_CONTENT, ROLLOUT_PLANS); ModelNode addOp = Util.getEmptyOperation(ADD, addAddress); try { addOp.get(HASH).set(HashUtil.hexStringToByteArray(hash)); } catch (final Exception e) { throw ControllerLogger.ROOT_LOGGER.invalidSha1Value(e, hash, Attribute.SHA1.getLocalName(), reader.getLocation()); } list.add(addOp); }
@Override public File getDeploymentRoot(byte[] deploymentHash) { String hex = deploymentHash == null ? "" : HashUtil.bytesToHexString(deploymentHash); final File file = localRepository.getDeploymentRoot(deploymentHash); if(! file.exists()) { return getFile(hex, DomainServerProtocol.PARAM_ROOT_ID_DEPLOYMENT); } return file; }
private void parseRolloutPlans(XMLExtendedStreamReader reader, ModelNode address, List<ModelNode> list) throws XMLStreamException { String hash = readStringAttributeElement(reader, Attribute.SHA1.getLocalName()); ModelNode addAddress = address.clone().add(MANAGEMENT_CLIENT_CONTENT, ROLLOUT_PLANS); ModelNode addOp = Util.getEmptyOperation(ADD, addAddress); try { addOp.get(HASH).set(HashUtil.hexStringToByteArray(hash)); } catch (final Exception e) { throw ControllerLogger.ROOT_LOGGER.invalidSha1Value(e, hash, Attribute.SHA1.getLocalName(), reader.getLocation()); } list.add(addOp); }
protected void addFromHash(byte[] hash) throws OperationFailedException { if (!contentRepository.syncContent(hash)) { throw ServerMessages.MESSAGES.noSuchDeploymentContent(HashUtil.bytesToHexString(hash)); } }
private void parseRolloutPlans(XMLExtendedStreamReader reader, ModelNode address, List<ModelNode> list) throws XMLStreamException { String hash = readStringAttributeElement(reader, Attribute.SHA1.getLocalName()); ModelNode addAddress = address.clone().add(MANAGEMENT_CLIENT_CONTENT, ROLLOUT_PLANS); ModelNode addOp = Util.getEmptyOperation(ADD, addAddress); try { addOp.get(HASH).set(HashUtil.hexStringToByteArray(hash)); } catch (final Exception e) { throw ControllerLogger.ROOT_LOGGER.invalidSha1Value(e, hash, Attribute.SHA1.getLocalName(), reader.getLocation()); } list.add(addOp); }
public static Set<String> getDeploymentHexHash(ModelNode deployment){ Set<String> hashes = new HashSet<String>(); if (deployment.hasDefined(CONTENT)) { for (ModelNode contentElement : deployment.get(CONTENT).asList()) { if (contentElement.hasDefined(HASH)) { hashes.add(HashUtil.bytesToHexString(contentElement.get(HASH).asBytes())); } } } return hashes; } /**
private void parseRolloutPlans(XMLExtendedStreamReader reader, ModelNode address, List<ModelNode> list) throws XMLStreamException { String hash = readStringAttributeElement(reader, Attribute.SHA1.getLocalName()); ModelNode addAddress = address.clone().add(MANAGEMENT_CLIENT_CONTENT, ROLLOUT_PLANS); ModelNode addOp = Util.getEmptyOperation(ADD, addAddress); try { addOp.get(HASH).set(HashUtil.hexStringToByteArray(hash)); } catch (final Exception e) { throw ControllerLogger.ROOT_LOGGER.invalidSha1Value(e, hash, Attribute.SHA1.getLocalName(), reader.getLocation()); } list.add(addOp); }
protected void addFromHash(byte[] hash) throws OperationFailedException { if (!contentRepository.syncContent(hash)) { throw ServerMessages.MESSAGES.noSuchDeploymentContent(HashUtil.bytesToHexString(hash)); } }
private void parseRolloutPlans(XMLExtendedStreamReader reader, ModelNode address, List<ModelNode> list) throws XMLStreamException { String hash = readStringAttributeElement(reader, Attribute.SHA1.getLocalName()); ModelNode addAddress = address.clone().add(MANAGEMENT_CLIENT_CONTENT, ROLLOUT_PLANS); ModelNode addOp = Util.getEmptyOperation(ADD, addAddress); try { addOp.get(HASH).set(HashUtil.hexStringToByteArray(hash)); } catch (final Exception e) { throw ControllerLogger.ROOT_LOGGER.invalidSha1Value(e, hash, Attribute.SHA1.getLocalName(), reader.getLocation()); } list.add(addOp); }
public static Set<String> getDeploymentHexHash(ModelNode deployment){ Set<String> hashes = new HashSet<String>(); if (deployment.hasDefined(CONTENT)) { for (ModelNode contentElement : deployment.get(CONTENT).asList()) { if (contentElement.hasDefined(HASH)) { hashes.add(HashUtil.bytesToHexString(contentElement.get(HASH).asBytes())); } } } return hashes; } /**
private void parseRolloutPlans(XMLExtendedStreamReader reader, ModelNode address, List<ModelNode> list) throws XMLStreamException { String hash = readStringAttributeElement(reader, Attribute.SHA1.getLocalName()); ModelNode addAddress = address.clone().add(MANAGEMENT_CLIENT_CONTENT, ROLLOUT_PLANS); ModelNode addOp = Util.getEmptyOperation(ADD, addAddress); try { addOp.get(HASH).set(HashUtil.hexStringToByteArray(hash)); } catch (final Exception e) { throw ControllerLogger.ROOT_LOGGER.invalidSha1Value(e, hash, Attribute.SHA1.getLocalName(), reader.getLocation()); } list.add(addOp); }
DeploymentHandlerUtil.ContentItem addFromHash(byte[] hash, String deploymentName, OperationContext context) throws OperationFailedException { if (!contentRepository.syncContent(hash)) { if (context.isBooting()) { if (context.getRunningMode() == RunningMode.ADMIN_ONLY) { // The deployment content is missing, which would be a fatal boot error if we were going to actually // install services. In ADMIN-ONLY mode we allow it to give the admin a chance to correct the problem ServerLogger.DEPLOYMENT_LOGGER.reportAdminOnlyMissingDeploymentContent(HashUtil.bytesToHexString(hash), deploymentName); } else { throw ServerMessages.MESSAGES.noSuchDeploymentContentAtBoot(HashUtil.bytesToHexString(hash), deploymentName); } } else { throw ServerMessages.MESSAGES.noSuchDeploymentContent(HashUtil.bytesToHexString(hash)); } } return new DeploymentHandlerUtil.ContentItem(hash); }
private void parseRolloutPlans(XMLExtendedStreamReader reader, ModelNode address, List<ModelNode> list) throws XMLStreamException { String hash = readStringAttributeElement(reader, Attribute.SHA1.getLocalName()); ModelNode addAddress = address.clone().add(MANAGEMENT_CLIENT_CONTENT, ROLLOUT_PLANS); ModelNode addOp = Util.getEmptyOperation(ADD, addAddress); try { addOp.get(HASH).set(HashUtil.hexStringToByteArray(hash)); } catch (final Exception e) { throw ControllerLogger.ROOT_LOGGER.invalidSha1Value(e, hash, Attribute.SHA1.getLocalName(), reader.getLocation()); } list.add(addOp); }