Skip to content

Commit

Permalink
clean unthrown exceptions and unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellom committed Apr 3, 2019
1 parent eb4e196 commit c051097
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ public NetworkServiceRecord create(
@RequestHeader(value = "project-id") String projectId,
@RequestBody(required = false) String bodyJson)
throws InterruptedException, ExecutionException, VimException, NotFoundException,
BadFormatException, PluginException, MissingParameterException, BadRequestException,
IOException, AlreadyExistingException {
BadFormatException, PluginException, BadRequestException, IOException,
AlreadyExistingException {

JsonObject jsonObject;
try {
Expand Down Expand Up @@ -132,8 +132,6 @@ public NetworkServiceRecord create(
* @throws VimException
* @throws NotFoundException
* @throws BadFormatException
* @throws VimDriverException
* @throws QuotaExceededException
* @throws PluginException
*/
@ApiOperation(
Expand All @@ -151,8 +149,8 @@ public NetworkServiceRecord create(
@RequestHeader(value = "project-id") String projectId,
@RequestBody(required = false) JsonObject body)
throws InterruptedException, ExecutionException, VimException, NotFoundException,
BadFormatException, PluginException, MissingParameterException, BadRequestException,
IOException, AlreadyExistingException {
BadFormatException, PluginException, BadRequestException, IOException,
AlreadyExistingException {

String monitoringIp = null;
List keys = null;
Expand Down Expand Up @@ -444,10 +442,6 @@ public void deleteVNFRecord(
*
* @param ids: the id list of Virtual Network Function Records
* @throws NotFoundException
* @throws InterruptedException
* @throws ExecutionException
* @throws WrongStatusException
* @throws VimException
*/
@ApiOperation(
value = "Removing multiple Virtual Network Function Records",
Expand Down Expand Up @@ -616,8 +610,6 @@ public void stopVNFCInstance(
* @throws NotFoundException
* @throws BadFormatException
* @throws WrongStatusException
* @throws ExecutionException
* @throws InterruptedException
*/
@ApiOperation(
value = "Add a VNFC in standby",
Expand Down Expand Up @@ -845,8 +837,8 @@ public void restartVNFR(
@PathVariable("idNsr") String nsrId,
@PathVariable("idVnfr") String vnfrId,
@RequestHeader(value = "project-id") String projectId)
throws NotFoundException, InterruptedException, BadRequestException, AlreadyExistingException,
VimException, ExecutionException, PluginException, IOException, BadFormatException {
throws NotFoundException, InterruptedException, BadRequestException, VimException,
ExecutionException, PluginException, IOException, BadFormatException {
log.debug("Received request for restarting a VNFR");
if (!body.has("imageName") || !body.getAsJsonPrimitive("imageName").isString())
throw new BadRequestException(
Expand Down Expand Up @@ -1121,8 +1113,6 @@ public LinkedHashSet<HistoryLifecycleEvent> getHistory(
.getLifecycle_event_history();
}

// TODO The Rest of the classes

private PhysicalNetworkFunctionRecord findPNFD(
Collection<PhysicalNetworkFunctionRecord> listPNFR, String id_pnf) throws NotFoundException {
for (PhysicalNetworkFunctionRecord pRecord : listPNFR) {
Expand All @@ -1142,14 +1132,4 @@ private VNFRecordDependency findVNFD(
}
throw new NotFoundException("VNFD with id " + id_vnfd + " was not found");
}

private VirtualNetworkFunctionRecord findVNF(
Collection<VirtualNetworkFunctionRecord> listVNF, String id_vnf) throws NotFoundException {
for (VirtualNetworkFunctionRecord vnfRecord : listVNF) {
if (vnfRecord.getId().equals(id_vnf)) {
return vnfRecord;
}
}
throw new NotFoundException("VNFR with id " + id_vnf + " was not found");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private void performChecks(
networkServiceRecord
.getVlr()
.stream()
// find all vlr which the networks hasn't been created yet
// find all vlr which the networks hasn't been created yet
.filter(
virtualLinkRecord -> {
log.debug(
Expand All @@ -239,7 +239,7 @@ private void performChecks(
}
return true;
})
// Then add such vlr to the list networkToAdd
// Then add such vlr to the list networkToAdd
.forEach(
virtualLinkRecord -> {
try {
Expand Down Expand Up @@ -291,7 +291,6 @@ private void performChecks(
.getVlr()
.forEach(
vlr -> {

if (vlr.getName().equals(vnfdConnectionPoint.getVirtual_link_reference())) {
vnfdConnectionPoint.setVirtual_link_reference(vlr.getName());
vnfdConnectionPoint.setVirtual_link_reference_id(vlr.getExtId());
Expand Down

0 comments on commit c051097

Please sign in to comment.