aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java9
-rw-r--r--src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java15
2 files changed, 15 insertions, 9 deletions
diff --git a/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java b/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java
index 133f28d..0cb108c 100644
--- a/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java
+++ b/src/main/java/io/swagger/api/impl/DcaeServiceTypesApiServiceImpl.java
@@ -47,7 +47,8 @@ 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 static final 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) {
@@ -139,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());
@@ -208,6 +211,8 @@ public class DcaeServiceTypesApiServiceImpl extends DcaeServiceTypesApiService {
response.setLinks(navigationLinks);
+ debugLogger.debug("Response: {}." + response.toString());
+
return Response.ok().entity(response).build();
}
@@ -278,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
diff --git a/src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java b/src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java
index 26949af..7f08501 100644
--- a/src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java
+++ b/src/main/java/io/swagger/api/impl/DcaeServicesApiServiceImpl.java
@@ -47,7 +47,8 @@ import java.util.*;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2016-04-18T20:16:22.119Z")
public class DcaeServicesApiServiceImpl extends DcaeServicesApiService {
- private static final Logger LOG = LoggerFactory.getLogger(DcaeServicesApiServiceImpl.class);
+ private static final Logger metricsLogger = LoggerFactory.getLogger("metricsLogger");
+ private static final Logger debugLogger = LoggerFactory.getLogger("debugLogger");
private static final int PAGINATION_PAGE_SIZE = 25;
private static final String COMPONENT_SOURCE_DATA_BUS_CONTROLLER = "DMAAPCONTROLLER";
@@ -93,14 +94,14 @@ public class DcaeServicesApiServiceImpl extends DcaeServicesApiService {
.rel("component").title(component.getComponentId()).build();
component.setComponentLink(componentLink);
} else {
- LOG.warn(String.format("Feed/topic does not exist: %s", sco.getComponentId()));
+ debugLogger.warn(String.format("Feed/topic does not exist: %s", sco.getComponentId()));
}
} catch (DatabusControllerClientException e) {
- LOG.warn(String.format("%s, %s", e.getMessage(), sco.toString()), e);
+ debugLogger.warn(String.format("%s, %s", e.getMessage(), sco.toString()), e);
}
}
} else {
- LOG.warn(String.format("Handling unknown component source: %s", sco.getComponentSource()));
+ debugLogger.warn(String.format("Handling unknown component source: %s", sco.getComponentSource()));
}
serviceComponents.add(component);
@@ -118,11 +119,11 @@ public class DcaeServicesApiServiceImpl extends DcaeServicesApiService {
List<DCAEServiceObject> serviceObjects = new ArrayList<>();
DateTime createdCutoff = created == null ? DateTime.now(DateTimeZone.UTC) : created;
- LOG.info(String.format("Create time upper bound cutoff: %s", createdCutoff.toString()));
+ metricsLogger.info(String.format("Create time upper bound cutoff: %s", createdCutoff.toString()));
// Offset is zero-based index
offset = (offset == null) ? 0 : offset;
- LOG.info(String.format("Query offset: %d", offset));
+ metricsLogger.info(String.format("Query offset: %d", offset));
try (Handle jdbiHandle = InventoryDAOManager.getInstance().getHandle()) {
// WATCH! There is the use of "distinct" here.
@@ -302,7 +303,7 @@ public class DcaeServicesApiServiceImpl extends DcaeServicesApiService {
serviceObjectToSendBack.setModified(modified);
transactionContext.setServiceObjectToInsert(serviceObjectToSendBack);
} else {
- LOG.info(String.format("DCAEServiceObject already exists - updating: %s, %s",
+ metricsLogger.info(String.format("DCAEServiceObject already exists - updating: %s, %s",
serviceObjectFromStore.getCreated().toString(),
serviceObjectFromStore.getModified().toString()));