aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java')
-rw-r--r--src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java b/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java
index 34d8a4b..0cb108c 100644
--- a/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java
+++ b/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java
@@ -20,12 +20,12 @@
package io.swagger.api.impl;
-import org.openecomp.dcae.inventory.daos.DCAEServiceTypesDAO;
-import org.openecomp.dcae.inventory.daos.DCAEServicesDAO;
-import org.openecomp.dcae.inventory.daos.InventoryDAOManager;
-import org.openecomp.dcae.inventory.dbthings.mappers.DCAEServiceTypeObjectMapper;
-import org.openecomp.dcae.inventory.dbthings.models.DCAEServiceObject;
-import org.openecomp.dcae.inventory.dbthings.models.DCAEServiceTypeObject;
+import org.onap.dcae.inventory.daos.DCAEServiceTypesDAO;
+import org.onap.dcae.inventory.daos.DCAEServicesDAO;
+import org.onap.dcae.inventory.daos.InventoryDAOManager;
+import org.onap.dcae.inventory.dbthings.mappers.DCAEServiceTypeObjectMapper;
+import org.onap.dcae.inventory.dbthings.models.DCAEServiceObject;
+import org.onap.dcae.inventory.dbthings.models.DCAEServiceTypeObject;
import io.swagger.api.*;
import io.swagger.model.*;
@@ -42,13 +42,13 @@ import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.core.UriInfo;
import java.util.ArrayList;
import java.util.List;
-import java.util.Locale;
import java.util.UUID;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2016-04-18T20:16:22.119Z")
public class DcaeServiceTypesApiServiceImpl extends DcaeServiceTypesApiService {
- private final static Logger LOG = LoggerFactory.getLogger(DcaeServiceTypesApiServiceImpl.class);
+ private static final Logger metricsLogger = LoggerFactory.getLogger("metricsLogger");
+ private static final Logger debugLogger = LoggerFactory.getLogger("debugLogger");
private static int PAGINATION_PAGE_SIZE = 25;
private DCAEServiceType createDCAEServiceType(DCAEServiceTypeObject serviceTypeObject, UriInfo uriInfo) {
@@ -93,7 +93,7 @@ public class DcaeServiceTypesApiServiceImpl extends DcaeServiceTypesApiService {
sb.append("dcae_service_types");
}
- List<String> whereClauses = new ArrayList<String>();
+ List<String> whereClauses = new ArrayList<>();
if (typeName != null) {
whereClauses.add(":typeName = type_name");
@@ -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");
@@ -120,7 +120,7 @@ public class DcaeServiceTypesApiServiceImpl extends DcaeServiceTypesApiService {
}
if (asdcResourceId != null) {
- if ("NONE".equals(asdcResourceId.toUpperCase(Locale.ENGLISH))) {
+ if (asdcResourceId.equalsIgnoreCase("NONE")) {
whereClauses.add("asdc_resource_id is null");
} else {
whereClauses.add(":asdcResourceId = asdc_resource_id");
@@ -140,6 +140,8 @@ public class DcaeServiceTypesApiServiceImpl extends DcaeServiceTypesApiService {
// Sort by created timestamp - always descending.
sb.append(" order by created desc");
+
+ metricsLogger.info("Query created as: {}." + sb.toString());
Query<DCAEServiceTypeObject> query = jdbiHandle.createQuery(sb.toString()).map(new DCAEServiceTypeObjectMapper());
@@ -159,11 +161,11 @@ public class DcaeServiceTypesApiServiceImpl extends DcaeServiceTypesApiService {
query.bind("serviceLocation", serviceLocation);
}
- if (asdcServiceId != null && !"NONE".equals(asdcServiceId.toUpperCase(Locale.ENGLISH))) {
+ if (asdcServiceId != null && !"NONE".equalsIgnoreCase(asdcServiceId)) {
query.bind("asdcServiceId", asdcServiceId);
}
- if (asdcResourceId != null && !"NONE".equals(asdcResourceId.toUpperCase(Locale.ENGLISH))) {
+ if (asdcResourceId != null && !"NONE".equalsIgnoreCase(asdcResourceId)) {
query.bind("asdcResourceId", asdcResourceId);
}
@@ -209,6 +211,8 @@ public class DcaeServiceTypesApiServiceImpl extends DcaeServiceTypesApiService {
response.setLinks(navigationLinks);
+ debugLogger.debug("Response: {}." + response.toString());
+
return Response.ok().entity(response).build();
}
@@ -279,7 +283,7 @@ public class DcaeServiceTypesApiServiceImpl extends DcaeServiceTypesApiService {
DCAEServicesDAO servicesDAO = InventoryDAOManager.getInstance().getDCAEServicesDAO();
Integer count = servicesDAO.countByType(DCAEServiceObject.DCAEServiceStatus.RUNNING, typeId);
- LOG.info(String.format("Checked num DCAE services running: %s, %d", typeId, count));
+ metricsLogger.info(String.format("Checked num DCAE services running: %s, %d", typeId, count));
// Allow the updating of an existing DCAE service type IFF there are no running DCAE services for this type