package org.onap.clamp.clds.service;
+import com.att.ajsc.common.AjscService;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
import java.io.IOException;
import java.io.InputStream;
import java.sql.SQLException;
import org.apache.commons.lang3.StringUtils;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.jboss.resteasy.spi.BadRequestException;
import org.onap.clamp.clds.client.DcaeDispatcherServices;
import org.onap.clamp.clds.client.DcaeInventoryServices;
import org.onap.clamp.clds.client.SdcCatalogServices;
import org.springframework.http.HttpStatus;
import org.springframework.web.client.HttpClientErrorException;
-import com.att.ajsc.common.AjscService;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
*
* @param test
* @param dcaeEvent
- * @throws BadRequestException
*/
@ApiOperation(value = "Accepts events for a model", notes = "", response = String.class)
@POST
@Path("/dcae/event")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- public String postDcaeEvent(@QueryParam("test") String test, DcaeEvent dcaeEvent) throws BadRequestException {
+ public String postDcaeEvent(@QueryParam("test") String test, DcaeEvent dcaeEvent) {
Date startTime = new Date();
LoggingUtils.setRequestContext("CldsService: Post dcae event", getPrincipalName());
String userid = null;
}
operationStatus = dcaeDispatcherServices.getOperationStatus(createNewDeploymentStatusUrl);
}
- if (operationStatus != null && operationStatus.equalsIgnoreCase("succeeded")) {
+ if (operationStatus.equalsIgnoreCase("succeeded")) {
String artifactName = model.getControlName();
if (artifactName != null) {
artifactName = artifactName + ".yml";
}
operationStatus = dcaeDispatcherServices.getOperationStatus(operationStatusUndeployUrl);
}
- if (operationStatus != null && operationStatus.equalsIgnoreCase("succeeded")) {
+ if (operationStatus.equalsIgnoreCase("succeeded")) {
String artifactName = model.getControlName();
if (artifactName != null) {
artifactName = artifactName + ".yml";
package org.onap.clamp.clds.service;
+import com.att.ajsc.camunda.core.AttCamundaHistoryEvent;
+import com.att.ajsc.camunda.core.AttCamundaService;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.google.gson.Gson;
+
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.stereotype.Service;
-import com.att.ajsc.camunda.core.AttCamundaHistoryEvent;
-import com.att.ajsc.camunda.core.AttCamundaService;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import com.google.gson.Gson;
-
@Service
public class LogServiceImpl implements LogService {
- protected static final EELFLogger logger = EELFManager.getInstance().getLogger(LogServiceImpl.class);
+ protected static final EELFLogger logger = EELFManager.getInstance().getLogger(LogServiceImpl.class);
protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
@Autowired
- private RuntimeService runtimeService;
+ private RuntimeService runtimeService;
@Autowired
- private HistoryService historyService;
+ private HistoryService historyService;
@Context
- private MessageContext context;
+ private MessageContext context;
public void setRuntimeService(RuntimeService runtimeService) {
this.runtimeService = runtimeService;
if (classUrl != null) {
logger.info(LogMessages.LOGSERVICE_EMAIL_CLASS, classUrl.getFile());
} else {
- logger.info(LogMessages.LOGSERVICE_EMAIL_CLASS, classUrl.getFile());
logger.info(LogMessages.LOGSERVICE_EMAIL_CLASS_NULL);
}
email.send();