import org.onap.so.montoring.model.ProcessInstanceDetail;
import org.onap.so.montoring.model.ProcessInstanceIdDetail;
import org.onap.so.montoring.model.ProcessInstanceVariableDetail;
-import org.slf4j.ext.XLogger;
-import org.slf4j.ext.XLoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import com.google.common.base.Optional;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* @author waqas.ikram@ericsson.com
*/
@Service
public class CamundaProcessDataServiceProviderImpl implements CamundaProcessDataServiceProvider {
- private static final XLogger LOGGER = XLoggerFactory.getXLogger(CamundaProcessDataServiceProviderImpl.class);
-
+ private static final Logger LOGGER = LoggerFactory.getLogger(CamundaProcessDataServiceProviderImpl.class);
private final CamundaRestUrlProvider urlProvider;
private final HttpRestServiceProvider httpRestServiceProvider;
if (processInstances.isPresent()) {
final ProcessInstance[] instances = processInstances.get();
- LOGGER.debug("found process instance for request id: {}, result size: {}", requestId, instances.length);
+ final String message = "found process instance for request id: " + requestId +
+ ", result size: " + instances.length;
+ LOGGER.debug(message);
if (instances.length > 0) {
for (int index = 0; index < instances.length; index++) {
if (processInstance.getSuperProcessInstanceId() == null) {
return Optional.of(new ProcessInstanceIdDetail(processInstance.getId()));
}
- LOGGER.debug("found sub process instance id with super process instanceId: {}",
+ LOGGER.debug("found sub process instance id with super process instanceId: " +
processInstance.getSuperProcessInstanceId());
}
}
}
- LOGGER.error("Unable to find process intance for request id: {}", requestId);
+ LOGGER.error("Unable to find process intance for request id: " + requestId);
return Optional.absent();
}
return Optional.of(instanceDetail);
}
- LOGGER.error("Unable to find process intance for id: {}", processInstanceId);
+ LOGGER.error("Unable to find process intance for id: " + processInstanceId);
return Optional.absent();
}
return Optional.of(new ProcessDefinitionDetail(processDefinitionId, xmlDefinition));
}
}
- LOGGER.error("Unable to find process definition for processDefinitionId: {}", processDefinitionId);
+ LOGGER.error("Unable to find process definition for processDefinitionId: " +
+ processDefinitionId);
return Optional.absent();
}
}
return activityInstanceDetails;
}
- LOGGER.error("Unable to find activity intance detail for process instance id: {}", processInstanceId);
+ LOGGER.error("Unable to find activity intance detail for process instance id: " +
+ processInstanceId);
return Collections.emptyList();
}
}
return instanceVariableDetails;
}
- LOGGER.error("Unable to find process intance variable details for process instance id: {}", processInstanceId);
+ LOGGER.error("Unable to find process intance variable details for process instance id: "
+ + processInstanceId);
return Collections.emptyList();
}
import org.onap.so.montoring.exception.InvalidRestRequestException;
import org.onap.so.montoring.exception.RestProcessingException;
-import org.slf4j.ext.XLogger;
-import org.slf4j.ext.XLoggerFactory;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import com.google.common.base.Optional;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* @author waqas.ikram@ericsson.com
*/
public class HttpRestServiceProviderImpl implements HttpRestServiceProvider {
- private static final XLogger LOGGER = XLoggerFactory.getXLogger(HttpRestServiceProviderImpl.class);
-
+ private static final Logger LOGGER = LoggerFactory.getLogger(HttpRestServiceProviderImpl.class);
private final RestTemplate restTemplate;
public HttpRestServiceProviderImpl(final RestTemplate restTemplate) {
@Override
public <T> Optional<T> getHttpResponse(final String url, final Class<T> clazz) {
- LOGGER.trace("Will invoke HTTP GET using URL: {}", url);
+ LOGGER.trace("Will invoke HTTP GET using URL: " + url);
try {
final ResponseEntity<T> response = restTemplate.exchange(url, HttpMethod.GET, null, clazz);
if (!response.getStatusCode().equals(HttpStatus.OK)) {
- LOGGER.error("Unable to invoke HTTP GET using URL: {}, Response Code: {}", url,
- response.getStatusCode());
+ final String message = "Unable to invoke HTTP GET using URL: " + url +
+ ", Response Code: " + response.getStatusCode();
+ LOGGER.error(message);
return Optional.absent();
}
return Optional.of(response.getBody());
}
} catch (final HttpClientErrorException httpClientErrorException) {
- LOGGER.error("Unable to invoke HTTP GET using url: {}, Response: {}", url,
- httpClientErrorException.getRawStatusCode(), httpClientErrorException);
+ final String message = "Unable to invoke HTTP GET using url: " + url + ", Response: " +
+ httpClientErrorException.getRawStatusCode();
+ LOGGER.error(message, httpClientErrorException);
final int rawStatusCode = httpClientErrorException.getRawStatusCode();
if (rawStatusCode == HttpStatus.BAD_REQUEST.value() || rawStatusCode == HttpStatus.NOT_FOUND.value()) {
throw new InvalidRestRequestException("No result found for given url: " + url);
throw new RestProcessingException("Unable to invoke HTTP GET using URL: " + url);
} catch (final RestClientException restClientException) {
- LOGGER.error("Unable to invoke HTTP GET using url: {}", url, restClientException);
- throw new RestProcessingException("Unable to invoke HTTP GET using URL: " + url, restClientException);
+ LOGGER.error("Unable to invoke HTTP GET using url: " + url, restClientException);
+ throw new RestProcessingException("Unable to invoke HTTP GET using URL: " +
+ url, restClientException);
}
return Optional.absent();
final HttpEntity<?> request = new HttpEntity<>(object);
final ResponseEntity<T> response = restTemplate.exchange(url, HttpMethod.POST, request, clazz);
if (!response.getStatusCode().equals(HttpStatus.OK)) {
- LOGGER.error("Unable to invoke HTTP GET using URL: {}, Response Code: {}", url,
- response.getStatusCode());
+ final String message = "Unable to invoke HTTP GET using URL: " + url +
+ ", Response Code: " + response.getStatusCode();
+ LOGGER.error(message);
return Optional.absent();
}
}
} catch (final HttpClientErrorException httpClientErrorException) {
- LOGGER.error("Unable to invoke HTTP POST using url: {}, Response: {}", url,
- httpClientErrorException.getRawStatusCode(), httpClientErrorException);
+ final String message = "Unable to invoke HTTP POST using url: " + url +
+ ", Response: " + httpClientErrorException.getRawStatusCode();
+ LOGGER.error(message, httpClientErrorException);
final int rawStatusCode = httpClientErrorException.getRawStatusCode();
if (rawStatusCode == HttpStatus.BAD_REQUEST.value() || rawStatusCode == HttpStatus.NOT_FOUND.value()) {
throw new InvalidRestRequestException("No result found for given url: " + url);
throw new RestProcessingException("Unable to invoke HTTP POST using URL: " + url);
} catch (final RestClientException restClientException) {
- LOGGER.error("Unable to invoke HTTP POST using url: {}", url, restClientException);
- throw new RestProcessingException("Unable to invoke HTTP POST using URL: " + url, restClientException);
+ LOGGER.error("Unable to invoke HTTP POST using url: " + url, restClientException);
+ throw new RestProcessingException("Unable to invoke HTTP POST using URL: "
+ + url, restClientException);
}
return Optional.absent();
import org.onap.so.montoring.model.ProcessInstanceVariableDetail;
import org.onap.so.montoring.model.SoInfraRequest;
import org.onap.so.montoring.rest.service.CamundaProcessDataServiceProvider;
-import org.slf4j.ext.XLogger;
-import org.slf4j.ext.XLoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.google.common.base.Optional;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* @author waqas.ikram@ericsson.com
*/
private static final String INVALID_PROCESS_INSTANCE_ERROR_MESSAGE = "Invalid process instance id: ";
- private static final XLogger LOGGER = XLoggerFactory.getXLogger(SoMonitoringController.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(SoMonitoringController.class);
private final DatabaseServiceProvider databaseServiceProvider;
return Response.status(Status.OK).entity(processInstanceId.get()).build();
}
- LOGGER.error("Unable to find process instance id for : {}", requestId);
+ LOGGER.error("Unable to find process instance id for : " + requestId);
return Response.status(Status.NO_CONTENT).build();
} catch (final InvalidRestRequestException extensions) {
return Response.status(Status.OK).entity(processInstanceDetail.get()).build();
}
- LOGGER.error("Unable to find process instance id for : {}", processInstanceId);
+ LOGGER.error("Unable to find process instance id for : " + processInstanceId);
return Response.status(Status.NO_CONTENT).build();
} catch (final InvalidRestRequestException extensions) {
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response getProcessDefinitionXml(final @PathParam("processDefinitionId") String processDefinitionId) {
if (processDefinitionId == null || processDefinitionId.isEmpty()) {
- return Response.status(Status.BAD_REQUEST).entity("Invalid process definition id: " + processDefinitionId)
+ return Response.status(Status.BAD_REQUEST).entity("Invalid process definition id: " +
+ processDefinitionId)
.build();
}
try {
final ProcessDefinitionDetail definitionDetail = response.get();
return Response.status(Status.OK).entity(definitionDetail).build();
}
- LOGGER.error("Unable to find process definition xml for processDefinitionId: {}", processDefinitionId);
+ LOGGER.error("Unable to find process definition xml for processDefinitionId: " +
+ processDefinitionId);
return Response.status(Status.NO_CONTENT).build();
} catch (final InvalidRestRequestException extensions) {
final String message =
- "Unable to find process definition xml for processDefinitionId: {}" + processDefinitionId;
+ "Unable to find process definition xml for processDefinitionId: {}" +
+ processDefinitionId;
return Response.status(Status.BAD_REQUEST).entity(message).build();
} catch (final RestProcessingException restProcessingException) {
- final String message = "Unable to get process definition xml for id: " + processDefinitionId;
+ final String message = "Unable to get process definition xml for id: " +
+ processDefinitionId;
LOGGER.error(message);
return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
}
camundaProcessDataServiceProvider.getActivityInstance(processInstanceId);
return Response.status(Status.OK).entity(activityInstanceDetails).build();
} catch (final InvalidRestRequestException extensions) {
- final String message = "Unable to find activity instance for processInstanceId: " + processInstanceId;
+ final String message = "Unable to find activity instance for processInstanceId: " +
+ processInstanceId;
LOGGER.error(message);
return Response.status(Status.BAD_REQUEST).entity(message).build();
} catch (final RestProcessingException restProcessingException) {
- final String message = "Unable to get activity instance detail for id: " + processInstanceId;
+ final String message = "Unable to get activity instance detail for id: " +
+ processInstanceId;
LOGGER.error(message);
return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
}
return Response.status(Status.OK).entity(processInstanceVariable).build();
} catch (final InvalidRestRequestException extensions) {
final String message =
- "Unable to find process instance variables for processInstanceId: " + processInstanceId;
+ "Unable to find process instance variables for processInstanceId: " +
+ processInstanceId;
LOGGER.error(message);
return Response.status(Status.BAD_REQUEST).entity(message).build();
} catch (final RestProcessingException restProcessingException) {
- final String message = "Unable to get process instance variables for id: " + processInstanceId;
+ final String message = "Unable to get process instance variables for id: " +
+ processInstanceId;
LOGGER.error(message);
return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
}
try {
final List<SoInfraRequest> requests =
databaseServiceProvider.getSoInfraRequest(filters, startTime, endTime, maxResult);
- LOGGER.info("result size: {}", requests.size());
+ LOGGER.info("result size: " + requests.size());
return Response.status(Status.OK).entity(requests).build();
} catch (final InvalidRestRequestException extensions) {
- final String message = "Unable to search request for filters: " + filters + ", from: " + startTime
- + ", to: " + endTime + ", maxResult: " + maxResult;
+ final String message = "Unable to search request for filters: " + filters + ", from: " +
+ startTime + ", to: " + endTime + ", maxResult: " + maxResult;
LOGGER.error(message);
return Response.status(Status.BAD_REQUEST).entity(message).build();
} catch (final RestProcessingException restProcessingException) {
- final String message = "Unable to search request for filters: " + filters + ", from: " + startTime
- + ", to: " + endTime + ", maxResult: " + maxResult;
+ final String message = "Unable to search request for filters: " + filters + ", from: " +
+ startTime + ", to: " + endTime + ", maxResult: " + maxResult;
LOGGER.error(message);
return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
}