import java.io.IOException;
import java.util.UUID;
import javax.xml.bind.DatatypeConverter;
-import org.onap.so.logger.LoggingAnchor;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.onap.so.apihandler.camundabeans.CamundaIntegerInput;
import org.onap.so.apihandler.camundabeans.CamundaRequest;
import org.onap.so.apihandler.camundabeans.CamundaVIDRequest;
-import org.onap.so.logger.ErrorCode;
-import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
jsonReq = mapper.writeValueAsString(camundaRequest);
logger.trace("request body is {}", jsonReq);
} catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.APIH_WARP_REQUEST.toString(), "Camunda", "wrapRequest",
- ErrorCode.BusinessProcesssError.getValue(), "Error in APIH Warp request", e);
+ logger.error("Error in APIH Warp request", e);
}
return jsonReq;
}
jsonReq = mapper.writeValueAsString(camundaRequest);
logger.trace("request body is {}", jsonReq);
} catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.APIH_WARP_REQUEST.toString(), "Camunda", "wrapVIDRequest",
- ErrorCode.BusinessProcesssError.getValue(), "Error in APIH Warp request", e);
+ logger.error("Error in APIH Warp request", e);
}
return jsonReq;
}
try {
stream = new FileInputStream(path + systemId);
} catch (FileNotFoundException e) {
- logger.debug("Could not resolve resource based on file: {}", path + systemId, e);
+ logger.debug("Could not resolve resource based on file: ", e);
}
input.setPublicId(publicId);
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
-import org.onap.so.logger.LoggingAnchor;
import org.apache.commons.io.IOUtils;
-import org.onap.so.logger.ErrorCode;
-import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.SAXException;
return "ErrorDetails: " + e.getMessage();
} catch (Exception e) {
- logger.error(LoggingAnchor.THREE, MessageEnum.APIH_CANNOT_READ_SCHEMA.toString(),
- ErrorCode.SchemaError.getValue(), "APIH cannot read schema file", e);
+ logger.error("APIH cannot read schema file", e);
return "ErrorDetails: " + "Unable to read the schema file";
}
if (infraActiveRequests != null) {
MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, String.valueOf(HttpStatus.SC_BAD_REQUEST));
- logger.error("RequestID exists in RequestDB.InfraActiveRequests : " + requestId);
+ logger.error("RequestID exists in RequestDB.InfraActiveRequests : {}", requestId);
}
}
}
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
-import org.onap.so.logger.LoggingAnchor;
import org.onap.so.apihandlerinfra.logging.ErrorLoggerInfo;
-import org.onap.so.logger.ErrorCode;
-import org.onap.so.logger.MessageEnum;
import org.onap.so.serviceinstancebeans.RequestError;
import org.onap.so.serviceinstancebeans.ServiceException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
@Provider
public class ApiExceptionMapper implements ExceptionMapper<ApiException> {
} catch (JsonProcessingException | JAXBException e) {
String errorMsg =
"Exception in buildServiceErrorResponse writing exceptionType to string " + e.getMessage();
- logger.error(LoggingAnchor.FOUR, MessageEnum.GENERAL_EXCEPTION.toString(), "BuildServiceErrorResponse",
- ErrorCode.DataError.getValue(), errorMsg, e);
+ logger.error("BuildServiceErrorResponse", e);
return errorMsg;
}
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-import org.onap.so.logger.LoggingAnchor;
import org.onap.so.apihandler.common.ResponseBuilder;
import org.onap.so.apihandlerinfra.tasksbeans.TasksRequest;
-import org.onap.so.apihandlerinfra.validation.MembersValidation;
import org.onap.so.apihandlerinfra.validation.ApplyUpdatedConfigValidation;
import org.onap.so.apihandlerinfra.validation.CloudConfigurationValidation;
import org.onap.so.apihandlerinfra.validation.ConfigurationParametersValidation;
import org.onap.so.apihandlerinfra.validation.CustomWorkflowValidation;
import org.onap.so.apihandlerinfra.validation.InPlaceSoftwareUpdateValidation;
import org.onap.so.apihandlerinfra.validation.InstanceIdMapValidation;
+import org.onap.so.apihandlerinfra.validation.MembersValidation;
import org.onap.so.apihandlerinfra.validation.ModelInfoValidation;
import org.onap.so.apihandlerinfra.validation.PlatformLOBValidation;
import org.onap.so.apihandlerinfra.validation.ProjectOwningEntityValidation;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
import org.onap.so.exceptions.ValidationException;
-import org.onap.so.logger.ErrorCode;
import org.onap.so.logger.LogConstants;
-import org.onap.so.logger.MessageEnum;
import org.onap.so.serviceinstancebeans.CloudConfiguration;
import org.onap.so.serviceinstancebeans.InstanceDirection;
import org.onap.so.serviceinstancebeans.ModelInfo;
mapper.setSerializationInclusion(Include.NON_DEFAULT);
requestErrorStr = mapper.writeValueAsString(re);
} catch (Exception e) {
- logger.error(LoggingAnchor.THREE, MessageEnum.APIH_VALIDATION_ERROR.toString(),
- ErrorCode.DataError.getValue(),
- "Exception in buildServiceErrorResponse writing exceptionType to string ", e);
+ logger.error("Exception in buildServiceErrorResponse writing exceptionType to string ", e);
}
return builder.buildResponse(httpResponseCode, null, requestErrorStr, version);
aq.setRequestStatus(status.toString());
aq.setLastModifiedBy(Constants.MODIFIED_BY_APIHANDLER);
} catch (Exception e) {
- logger.error(LoggingAnchor.THREE, MessageEnum.APIH_DB_INSERT_EXC.toString(), ErrorCode.DataError.getValue(),
- "Exception when creation record request", e);
+ logger.error("Exception when creation record request", e);
if (!status.equals(Status.FAILED)) {
throw e;
aq.setLastModifiedBy(Constants.MODIFIED_BY_APIHANDLER);
} catch (Exception e) {
- logger.error(LoggingAnchor.THREE, MessageEnum.APIH_DB_INSERT_EXC.toString(), ErrorCode.DataError.getValue(),
- "Exception when creation record request", e);
+ logger.error("Exception when creation record request", e);
if (!status.equals(Status.FAILED)) {
throw e;
request.setRequestUrl(MDC.get(LogConstants.HTTP_URL));
requestsDbClient.save(request);
} catch (Exception e) {
- logger.error(LoggingAnchor.FOUR, MessageEnum.APIH_DB_UPDATE_EXC.toString(), e.getMessage(),
- ErrorCode.DataError.getValue(), "Exception when updating record in DB");
+ logger.error("Exception when updating record in DB", e);
logger.debug("Exception: ", e);
}
}
return null;
} catch (Exception e) {
- logger.error(LoggingAnchor.THREE, MessageEnum.APIH_DOM2STR_ERROR.toString(), ErrorCode.DataError.getValue(),
- "Exception in domToStr", e);
+ logger.error("Exception in domToStr", e);
}
return null;
}
CloudOrchestrationRequest cor = null;
- logger.debug("requestId is: " + requestId);
+ logger.debug("requestId is: {}", requestId);
try {
ObjectMapper mapper = new ObjectMapper();
import java.util.Map;
import java.util.Map.Entry;
import javax.ws.rs.core.MultivaluedMap;
-import org.onap.so.logger.LoggingAnchor;
import org.apache.commons.lang3.StringUtils;
import org.onap.so.apihandlerinfra.Constants;
import org.onap.so.apihandlerinfra.Status;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
import org.onap.so.exceptions.ValidationException;
-import org.onap.so.logger.ErrorCode;
-import org.onap.so.logger.MessageEnum;
import org.onap.so.utils.UUIDChecker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
request.setLastModifiedBy(Constants.MODIFIED_BY_APIHANDLER);
requestsDbClient.save(request);
} catch (Exception e) {
- logger.error(LoggingAnchor.FOUR, MessageEnum.APIH_DB_UPDATE_EXC.toString(), e.getMessage(),
- ErrorCode.DataError.getValue(), "Exception when updating record in DB");
+ logger.error("Exception when updating record in DB", e);
logger.debug("Exception: ", e);
}
}