diff options
Diffstat (limited to 'cmso-service/src/main')
9 files changed, 18 insertions, 34 deletions
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafPerm.java b/cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafPerm.java index d324f18..b8e7f5b 100755 --- a/cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafPerm.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafPerm.java @@ -90,9 +90,9 @@ public class AafPerm { */
public boolean ok(AafPerm userPerm) {
if (type.equals(userPerm.getType())) {
- if (userPerm.getInstance().equals("*") || instance.equals("*") || userPerm.getInstance().equals(instance)) {
+ if ("*".equals(userPerm.getInstance()) || "*".equals(instance) || userPerm.getInstance().equals(instance)) {
for (String userAction : userPerm.getActions()) {
- if (userAction.equals("*") || actions.contains("*") || actions.contains(userAction)) {
+ if ("*".equals(userAction) || actions.contains("*") || actions.contains(userAction)) {
return true;
}
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/CmsoClient.java b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/CmsoClient.java index c31c275..f6197a3 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/CmsoClient.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/CmsoClient.java @@ -163,8 +163,7 @@ public class CmsoClient { }
}
- private void processScheduleResponse(ChangeManagementSchedule cmSchedule, Schedule schedule, Response response)
- throws SchedulerException {
+ private void processScheduleResponse(ChangeManagementSchedule cmSchedule, Schedule schedule, Response response) {
WfChangeManagementResponse resp = response.readEntity(WfChangeManagementResponse.class);
for (WfVidCmResponse cmResponse : resp.getCmResponses()) {
if (cmResponse.getVnfName().equals(cmSchedule.getVnfName())) {
@@ -182,8 +181,7 @@ public class CmsoClient { updateScheduleStatus(cmSchedule, schedule);
}
- private void processScheduleResponse200(ChangeManagementSchedule cmSchedule, Schedule schedule, Response response)
- throws SchedulerException {
+ private void processScheduleResponse200(ChangeManagementSchedule cmSchedule, Schedule schedule, Response response){
JsonNode node = response.readEntity(JsonNode.class);
log.info("Message returned from VID callback: " + node.toString());
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/DispatchJob.java b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/DispatchJob.java index ccbc430..f663240 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/DispatchJob.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/DispatchJob.java @@ -140,10 +140,8 @@ public class DispatchJob { // Validate ticket is still active with tm
//
// TODO
- if (cmSchedule.getTmChangeId() != null && !cmSchedule.getTmChangeId().equals("")) {
- if (!isChangeApproved(schedule, cmSchedule, scheduleImmediateEnabled)) {
+ if (cmSchedule.getTmChangeId() != null && !cmSchedule.getTmChangeId().equals("") && !isChangeApproved(schedule, cmSchedule, scheduleImmediateEnabled)) {
return false;
- }
}
// *******************************************************************
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispatcherServiceImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispatcherServiceImpl.java index 84ff91e..d8fd7c3 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispatcherServiceImpl.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispatcherServiceImpl.java @@ -75,8 +75,7 @@ public class DispatcherServiceImpl implements DispacherService { errors.error(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());
debug.error(e.getMessage(), e);
}
- Response response = Response.ok().build();
- return response;
+ return Response.ok().build();
}
@Override
@@ -105,8 +104,7 @@ public class DispatcherServiceImpl implements DispacherService { errors.error(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());
debug.error(e.getMessage(), e);
}
- Response response = Response.ok().build();
- return response;
+ return Response.ok().build();
}
@Override
@@ -119,8 +117,7 @@ public class DispatcherServiceImpl implements DispacherService { errors.error(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());
debug.error(e.getMessage(), e);
}
- Response response = Response.ok().build();
- return response;
+ return Response.ok().build();
}
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java b/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java index d43c60b..804fe68 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java @@ -72,10 +72,8 @@ public class CmsoClientFilters implements ClientRequestFilter, ClientResponseFil String transactionId = (String) headers.getFirst(MessageHeaders.HeadersEnum.TransactionID.toString()); String mdcId = MDC.get(MDC_KEY_REQUEST_ID); - if (transactionId == null || transactionId.equals("")) { - if (mdcId != null) { + if ((transactionId == null || "".equals(transactionId)) && (mdcId != null)) { headers.add(HeadersEnum.TransactionID.toString(), mdcId); - } } headers.add(HeadersEnum.FromAppID.toString(), appId); } diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/filters/MessageHeaders.java b/cmso-service/src/main/java/org/onap/optf/cmso/filters/MessageHeaders.java index d671768..7aba1a2 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/filters/MessageHeaders.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/filters/MessageHeaders.java @@ -69,7 +69,7 @@ public class MessageHeaders { }
/** The Constant supportedMajorVersions. */
- private static final Map<String, String> supportedMajorVersions = new HashMap<String, String>();
+ private static final Map<String, String> supportedMajorVersions = new HashMap<>();
static {
supportedMajorVersions.put("v1", "0");
@@ -77,7 +77,7 @@ public class MessageHeaders { }
/** The Constant supportedMajorMinorVersions. */
- private static final Set<String> supportedMajorMinorVersions = new HashSet<String>();
+ private static final Set<String> supportedMajorMinorVersions = new HashSet<>();
static {
supportedMajorMinorVersions.add("v1.0");
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/AdminToolImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/AdminToolImpl.java index fa182b4..79ceb44 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/AdminToolImpl.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/AdminToolImpl.java @@ -62,8 +62,7 @@ public class AdminToolImpl implements AdminTool { return Response.ok("").build();
}
String encrypted = PropertiesManagement.getEncryptedValue(id);
- Response response = Response.ok(encrypted).build();
- return response;
+ return Response.ok(encrypted).build();
}
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java index 1e4a46a..9ddb893 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java @@ -224,8 +224,7 @@ public class CmQueryParameters { private static DateTime convertDate(String utcDate, String urlName) throws CmsoException {
try {
- DateTime dateTime = ISODateTimeFormat.dateTimeParser().parseDateTime(utcDate);
- return dateTime;
+ return ISODateTimeFormat.dateTimeParser().parseDateTime(utcDate);
}
catch (Exception e) {
throw new CmsoException(Status.BAD_REQUEST, LogMessages.INVALID_DATE_FILTER, urlName, utcDate);
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/bean/BuildCreateRequest.java b/cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/bean/BuildCreateRequest.java index 8c8cd6f..8ab915c 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/bean/BuildCreateRequest.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/bean/BuildCreateRequest.java @@ -104,8 +104,7 @@ public class BuildCreateRequest { public JsonNode createChangeRecordRequest(Map<String, Object> variables, List<TmAsset> assetList,
String workflowName) {
JsonNode rawjson = getYaml("CreateChangeTicket");
- JsonNode json = substituteJson(rawjson, variables);
- return json;
+ return substituteJson(rawjson, variables);
}
/**
@@ -116,8 +115,7 @@ public class BuildCreateRequest { */
public JsonNode createCloseCancelChangeRecord(Map<String, Object> variables) {
JsonNode rawjson = getYaml("CloseCancelChangeRecord");
- JsonNode json = substituteJson(rawjson, variables);
- return json;
+ return substituteJson(rawjson, variables);
}
/**
@@ -128,8 +126,7 @@ public class BuildCreateRequest { */
public JsonNode createCancelChangeRecord(Map<String, Object> variables) {
JsonNode rawjson = getYaml("CancelChangeRecord");
- JsonNode json = substituteJson(rawjson, variables);
- return json;
+ return substituteJson(rawjson, variables);
}
/**
@@ -140,8 +137,7 @@ public class BuildCreateRequest { */
public JsonNode createUpdateChangeRecord(Map<String, Object> variables) {
JsonNode rawjson = getYaml("UpdateChangeRecord");
- JsonNode json = substituteJson(rawjson, variables);
- return json;
+ return substituteJson(rawjson, variables);
}
/**
@@ -152,8 +148,7 @@ public class BuildCreateRequest { */
public JsonNode createGetChangeRecord(Map<String, Object> variables) {
JsonNode rawjson = getYaml("GetChangeRecord");
- JsonNode json = substituteJson(rawjson, variables);
- return json;
+ return substituteJson(rawjson, variables);
}
private JsonNode substituteJson(JsonNode json, Map<String, Object> variables) {
|