}
public void addDeploymentOverlays(final List<ModelNode> updates) {
if (domainModel.hasDefined(DEPLOYMENT_OVERLAY)) {
HostFileRepository remoteRepository = null;
if (!domainController.getLocalHostInfo().isMasterDomainController()) {
remoteRepository = domainController.getRemoteFileRepository();
}
for (Property deploymentOverlay : domainModel.get(DEPLOYMENT_OVERLAY).asPropertyList()) {
String name = deploymentOverlay.getName();
ModelNode details = deploymentOverlay.getValue();
PathAddress addr = PathAddress.pathAddress(PathElement.pathElement(DEPLOYMENT_OVERLAY, name));
ModelNode addOp = Util.getEmptyOperation(ADD, addr.toModelNode());
updates.add(addOp);
if (details.hasDefined(CONTENT)) {
for (Property content : details.get(CONTENT).asPropertyList()) {
final String contentName = content.getName();
final ModelNode contentDetails = content.getValue();
byte[] hash = contentDetails.require(CONTENT).asBytes();
File[] files = domainController.getLocalFileRepository().getDeploymentFiles(hash);
if (files == null || files.length == 0) {
if (remoteRepository != null) {
remoteRepository.getDeploymentFiles(hash);
}
}
addr = PathAddress.pathAddress(PathElement.pathElement(DEPLOYMENT_OVERLAY, name), PathElement.pathElement(CONTENT, contentName));
addOp = Util.getEmptyOperation(ADD, addr.toModelNode());
addOp.get(CONTENT).get(HASH).set(contentDetails.get(CONTENT));