Skip to content

Commit

Permalink
fix: this close issue #91
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzotomasini committed Mar 6, 2017
1 parent 9ddf45f commit 203415c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.openbaton.exceptions.PluginException;
import org.openbaton.exceptions.VimDriverException;
import org.openbaton.exceptions.VimException;
import org.openbaton.nfvo.core.interfaces.VnfPlacementManagement;
import org.openbaton.nfvo.repositories.KeyRepository;
import org.openbaton.nfvo.repositories.NetworkServiceRecordRepository;
import org.openbaton.nfvo.repositories.VimRepository;
Expand All @@ -60,7 +59,6 @@ public class ResourceManagement implements org.openbaton.nfvo.core.interfaces.Re
@Autowired private VimBroker vimBroker;
@Autowired private VimRepository vimInstanceRepository;

@Autowired private VnfPlacementManagement vnfPlacementManagement;
@Autowired private NetworkServiceRecordRepository nsrRepository;
@Autowired private KeyRepository keyRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,8 @@

package org.openbaton.nfvo.vnfm_reg.tasks;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Future;
import org.openbaton.catalogue.mano.common.Event;
import org.openbaton.catalogue.mano.descriptor.VNFComponent;
import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit;
import org.openbaton.catalogue.mano.record.VNFCInstance;
import org.openbaton.catalogue.nfvo.Action;
import org.openbaton.catalogue.nfvo.NFVImage;
import org.openbaton.catalogue.nfvo.VimInstance;
Expand All @@ -40,6 +32,13 @@
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Future;

/** Created by lto on 06/08/15. */
@Service
@Scope("prototype")
Expand Down Expand Up @@ -71,13 +70,12 @@ protected NFVMessage doWork() throws Exception {
+ virtualNetworkFunctionRecord.getId()
+ ") received hibernate version is = "
+ virtualNetworkFunctionRecord.getHb_version());

List<Future<List<String>>> ids = new ArrayList<>();
for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu()) {
List<Future<VNFCInstance>> ids = new ArrayList<>();
VimInstance vimInstance = vims.get(vdu.getId());
if (vimInstance == null) {
throw new NullPointerException(
"Our algorithms are too complex, even for us, this is what abnormal IQ means :" + "(");
"Our algorithms are too complex, even for us, this is what abnormal IQ means :(");
}
vimInstance = vimRepository.findFirstById(vimInstance.getId());
log.debug(
Expand All @@ -90,11 +88,12 @@ protected NFVMessage doWork() throws Exception {
for (NFVImage image : vimInstance.getImages()) {
log.trace("Available image name: " + image.getName());
}
for (VNFComponent vnfc : vdu.getVnfc()) {
resourceManagement
.allocate(vdu, virtualNetworkFunctionRecord, vnfc, vimInstance, userData)
.get();
}
ids.add(
resourceManagement.allocate(
vdu, virtualNetworkFunctionRecord, vimInstance, userData, keys));
}
for (Future<List<String>> id : ids) {
id.get();
}
setHistoryLifecycleEvent(new Date());
saveVirtualNetworkFunctionRecord();
Expand Down

0 comments on commit 203415c

Please sign in to comment.