summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java4
-rw-r--r--src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java8
-rw-r--r--src/main/java/org/onap/dcae/inventory/daos/DCAEServiceTypesDAO.java1
3 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java b/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java
index 312eaf1..fc6509a 100644
--- a/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java
+++ b/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java
@@ -112,7 +112,7 @@ public class DcaeServiceTypesApiServiceImpl extends DcaeServiceTypesApiService {
}
if (asdcServiceId != null) {
- if ("NONE".equals(asdcServiceId.toUpperCase(Locale.ENGLISH))) {
+ if (asdcServiceId.equalsIgnoreCase("NONE")) {
whereClauses.add("asdc_service_id is null");
} else {
whereClauses.add(":asdcServiceId = asdc_service_id");
@@ -163,7 +163,7 @@ public class DcaeServiceTypesApiServiceImpl extends DcaeServiceTypesApiService {
query.bind("asdcServiceId", asdcServiceId);
}
- if (asdcResourceId != null && !"NONE".equals(asdcResourceId.toUpperCase(Locale.ENGLISH))) {
+ if (asdcResourceId != null && !"NONE".equalsIgnoreCase(asdcResourceId)) {
query.bind("asdcResourceId", asdcResourceId);
}
diff --git a/src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java b/src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java
index fe938f1..65c9d4f 100644
--- a/src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java
+++ b/src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java
@@ -90,7 +90,7 @@ public class DcaeServicesApiServiceImpl extends DcaeServicesApiService {
// TODO: When putting together the components fail. Should this be a 500 case?
// For now, this is just logged as a warning.
- if (COMPONENT_SOURCE_DCAE_CONTROLLER.equals(sco.getComponentSource().toUpperCase(Locale.ENGLISH))) {
+ if (COMPONENT_SOURCE_DCAE_CONTROLLER.equalsIgnoreCase(sco.getComponentSource())) {
if (this.dcaeControllerClient != null) {
try {
DCAEControllerClient.ServiceInstance serviceInstance
@@ -105,7 +105,7 @@ public class DcaeServicesApiServiceImpl extends DcaeServicesApiService {
LOG.warn(String.format("%s, %s", e.getMessage(), sco.toString()), e);
}
}
- } else if (COMPONENT_SOURCE_DATA_BUS_CONTROLLER.equals(sco.getComponentSource().toUpperCase(Locale.ENGLISH))) {
+ } else if (COMPONENT_SOURCE_DATA_BUS_CONTROLLER.equalsIgnoreCase(sco.getComponentSource())) {
if (this.databusControllerClient != null) {
try {
if (this.databusControllerClient.isExists(sco.getComponentId())) {
@@ -150,7 +150,7 @@ public class DcaeServicesApiServiceImpl extends DcaeServicesApiService {
sb.append(" join dcae_services_components_maps m on ds.service_id = m.service_id ");
sb.append(" join dcae_service_components dsc on m.component_id = dsc.component_id");
- List<String> whereClauses = new ArrayList<String>();
+ List<String> whereClauses = new ArrayList<>();
if (typeId != null) {
whereClauses.add("ds.type_id = :typeId");
@@ -229,7 +229,7 @@ public class DcaeServicesApiServiceImpl extends DcaeServicesApiService {
List<DCAEServiceObject> serviceObjectsSliced = serviceObjects.subList(offset, endpoint);
DCAEServiceComponentsDAO componentsDAO = InventoryDAOManager.getInstance().getDCAEServiceComponentsDAO();
- List<DCAEService> services = new ArrayList<DCAEService>();
+ List<DCAEService> services = new ArrayList<>();
for (DCAEServiceObject so : serviceObjectsSliced) {
List<DCAEServiceComponentObject> components = componentsDAO.getByServiceId(so.getServiceId());
diff --git a/src/main/java/org/onap/dcae/inventory/daos/DCAEServiceTypesDAO.java b/src/main/java/org/onap/dcae/inventory/daos/DCAEServiceTypesDAO.java
index cc53276..aa242a4 100644
--- a/src/main/java/org/onap/dcae/inventory/daos/DCAEServiceTypesDAO.java
+++ b/src/main/java/org/onap/dcae/inventory/daos/DCAEServiceTypesDAO.java
@@ -52,6 +52,7 @@ public interface DCAEServiceTypesDAO extends InventoryDAO {
"vnf_types varchar[] not null, service_ids varchar[], service_locations varchar[], " +
"asdc_service_id varchar, asdc_resource_id varchar, " +
"created timestamp not null, deactivated timestamp, constraint pk_type_created primary key (type_id))")
+ @Override
void createTable();
// REVIEW: asdcServiceId and asdcResourceId is implicitly part of the unique key and thus shouldn't be updated.