}
private void addDeployments(List<ModelNode> updates) {
if (serverGroup.hasDefined(DEPLOYMENT)) {
FileRepository remoteRepository = null;
if (! domainController.getLocalHostInfo().isMasterDomainController()) {
remoteRepository = domainController.getRemoteFileRepository();
}
for (Property deployment : serverGroup.get(DEPLOYMENT).asPropertyList()) {
String name = deployment.getName();
ModelNode details = deployment.getValue();
ModelNode domainDeployment = domainModel.require(DEPLOYMENT).require(name);
ModelNode deploymentContent = domainDeployment.require(CONTENT).clone();
if (remoteRepository != null) {
// Make sure we have a copy of the deployment in the local repo
for (ModelNode content : deploymentContent.asList()) {
if ((content.hasDefined(HASH))) {
byte[] hash = content.require(HASH).asBytes();
File[] files = domainController.getLocalFileRepository().getDeploymentFiles(hash);
if (files == null || files.length == 0) {
remoteRepository.getDeploymentFiles(hash);
}
}
}
}