formatBar, networkServiceRecord.getName(), networkServiceRecord.getStatus(), networkServiceRecord.getId(), networkServiceRecord.getProjectId()))
if (nsrFather.getStatus().ordinal() != Status.ERROR.ordinal()) { log.debug("Sending MODIFY to " + target.getName()); OrVnfmGenericMessage orVnfmGenericMessage =
private synchronized NetworkServiceRecord getNetworkServiceRecordInActiveState( String id, String projectId) throws NotFoundException, WrongStatusException { NetworkServiceRecord networkServiceRecord = nsrRepository.findFirstByIdAndProjectId(id, projectId); if (networkServiceRecord == null) { throw new NotFoundException("No NetworkServiceRecord found with ID " + id); } if (networkServiceRecord.getStatus().ordinal() != Status.ACTIVE.ordinal()) { throw new WrongStatusException("NetworkServiceDescriptor must be in ACTIVE state"); } return networkServiceRecord; }
@Override public List<VNFRecordDependency> getDependencyForAVNFRecordSource( VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) { List<VNFRecordDependency> res = new ArrayList<>(); NetworkServiceRecord nsr = nsrRepository.findFirstById(virtualNetworkFunctionRecord.getParent_ns_id()); if (nsr.getStatus().ordinal() != Status.ERROR.ordinal()) { Set<VNFRecordDependency> vnfRecordDependencies = nsr.getVnf_dependency(); for (VNFRecordDependency vnfRecordDependency : vnfRecordDependencies) { vnfRecordDependency = vnfrDependencyRepository.findOne(vnfRecordDependency.getId()); log.trace( "Checking if " + virtualNetworkFunctionRecord.getName() + " is source for " + vnfRecordDependency); if (vnfRecordDependency.getIdType().containsKey(virtualNetworkFunctionRecord.getName())) { res.add(vnfRecordDependency); } } } return res; } }
if (networkServiceRecord.getStatus().ordinal() == Status.NULL.ordinal()) { throw new WrongStatusException( "The NetworkService " + networkServiceRecord.getId() + " is in the wrong state. ( Status= " + networkServiceRecord.getStatus() + " )"); if (networkServiceRecord.getStatus().ordinal() != Status.ACTIVE.ordinal() && networkServiceRecord.getStatus().ordinal() != Status.ERROR.ordinal()) { throw new WrongStatusException( "The NetworkService " + networkServiceRecord.getId() + " is in the wrong state. ( Status= " + networkServiceRecord.getStatus() + " )");
@Override public VNFRecordDependency getDependencyForAVNFRecordTarget( VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) { NetworkServiceRecord nsr = nsrRepository.findFirstById(virtualNetworkFunctionRecord.getParent_ns_id()); if (nsr.getStatus().ordinal() != Status.ERROR.ordinal()) { Set<VNFRecordDependency> vnfRecordDependencies = nsr.getVnf_dependency(); for (VNFRecordDependency vnfRecordDependency : vnfRecordDependencies) { vnfRecordDependency = vnfrDependencyRepository.findOne(vnfRecordDependency.getId()); if (vnfRecordDependency.getTarget().equals(virtualNetworkFunctionRecord.getName())) { return vnfRecordDependency; } } } return null; }
+ vnfRecordDependency); if (nsr.getStatus().ordinal() != Status.ERROR.ordinal()) { OrVnfmGenericMessage orVnfmGenericMessage = new OrVnfmGenericMessage(virtualNetworkFunctionRecord, Action.MODIFY);
networkServiceRecordRepository.findFirstById( virtualNetworkFunctionRecord.getParent_ns_id()); log.debug("The current status of the NSR is " + nsr.getStatus()); for (VirtualNetworkFunctionRecord vnfr : nsr.getVnfr()) { log.trace("Current VNFRs in the database: " + vnfr.getName());
log.debug("Actual NSR stats is: " + networkServiceRecord.getStatus()); for (VirtualNetworkFunctionRecord vnfr : networkServiceRecord.getVnfr()) { boolean stopVNFR = true; && (networkServiceRecord.getStatus().ordinal() != Status.ERROR.ordinal())) { stopVNFR = false; break; publisher.dispatchEvent(eventNFVO); if (networkServiceRecord.getStatus().ordinal() == Status.SCALING.ordinal()) { networkServiceRecord.setStatus(Status.ACTIVE); networkServiceRecord.setTask("Scaled in");
public void deleteVNFRecord(String idNsr, String idVnf, String projectId) throws NotFoundException { // TODO the logic of this request for the moment deletes only the VNFR from the DB, need to be // removed from the // running NetworkServiceRecord VirtualNetworkFunctionRecord vnfr = vnfrRepository.findOne(idVnf); if (vnfr == null) { throw new NotFoundException("Not found VNFR with ID: " + idVnf); } if (!vnfr.getParent_ns_id().equals(idNsr)) { throw new NotFoundException("Not found VNFR " + idVnf + " in the given NSR " + idNsr); } if (!vnfr.getProjectId().equals(projectId)) { throw new UnauthorizedUserException("VNFR not contained in the chosen project."); } nsrRepository.deleteVNFRecord(idNsr, idVnf); NetworkServiceRecord nsr = query(idNsr, projectId); if (nsr != null) { for (VirtualNetworkFunctionRecord virtualNetworkFunctionRecord : nsr.getVnfr()) { if (nsr.getStatus().ordinal() > virtualNetworkFunctionRecord.getStatus().ordinal()) { nsr.setStatus(vnfr.getStatus()); } } nsrRepository.saveCascade(nsr); } else { log.warn("Parent NS does not exist anymore..."); } }
log.debug("Now the status is: " + networkServiceRecord.getStatus()); if (status.ordinal() == Status.ACTIVE.ordinal()) {
if (nsr.getStatus().ordinal() == Status.ACTIVE.ordinal()) {