diff options
Diffstat (limited to 'mso-api-handlers/mso-requests-db')
2 files changed, 23 insertions, 7 deletions
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogDistributionStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogDistributionStatus.java index 40c81b96e7..69d84b7679 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogDistributionStatus.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogDistributionStatus.java @@ -31,6 +31,8 @@ import javax.persistence.PreUpdate; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; +import javax.persistence.Version; + import java.util.Objects; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -54,6 +56,9 @@ public class WatchdogDistributionStatus implements Serializable { @Column(name = "MODIFY_TIME") @Temporal(TemporalType.TIMESTAMP) private Date modifyTime; + @Version + @Column(name = "LOCK_VERSION") + private int version; public WatchdogDistributionStatus() { @@ -78,7 +83,15 @@ public class WatchdogDistributionStatus implements Serializable { public void setDistributionIdStatus(String distributionIdStatus) { this.distributionIdStatus = distributionIdStatus; } - + + public int getVersion() { + return version; + } + + public void setVersion(int version) { + this.version = version; + } + public Date getCreateTime() { return createTime; } diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDBHelper.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDBHelper.java index ea3ef30827..da72ef985c 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDBHelper.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDBHelper.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -23,8 +25,9 @@ package org.onap.so.requestsdb; import java.sql.Timestamp; import org.onap.so.db.request.beans.InfraActiveRequests; -import org.onap.so.logger.MsoLogger; import org.onap.so.db.request.client.RequestsDbClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @@ -33,7 +36,7 @@ import org.springframework.stereotype.Component; public class RequestsDBHelper { private static final String UNKNOWN = "UNKNOWN"; - private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.APIH, RequestsDBHelper.class); + private static Logger logger = LoggerFactory.getLogger(RequestsDBHelper.class); private String className = this.getClass().getSimpleName() +" class\'s "; private String methodName = ""; private String classMethodMessage = ""; @@ -51,7 +54,7 @@ public class RequestsDBHelper { public void updateInfraSuccessCompletion(String msg, String requestId, String operationalEnvironmentId) { methodName = "updateInfraSuccessCompletion() method."; classMethodMessage = className + " " + methodName; - msoLogger.debug("Begin of " + classMethodMessage); + logger.debug("Begin of {}", classMethodMessage); InfraActiveRequests request = requestsDbClient.getInfraActiveRequestbyRequestId(requestId); @@ -70,7 +73,7 @@ public class RequestsDBHelper { request.setEndTime(endTimeStamp); requestsDbClient.save(request); - msoLogger.debug("End of " + classMethodMessage); + logger.debug("End of {}", classMethodMessage); } @@ -85,7 +88,7 @@ public class RequestsDBHelper { public void updateInfraFailureCompletion(String msg, String requestId, String operationalEnvironmentId) { methodName = "updateInfraFailureCompletion() method."; classMethodMessage = className + " " + methodName; - msoLogger.debug("Begin of " + classMethodMessage); + logger.debug("Begin of {}", classMethodMessage); InfraActiveRequests request = requestsDbClient.getInfraActiveRequestbyRequestId(requestId); request.setRequestStatus("FAILED"); @@ -103,7 +106,7 @@ public class RequestsDBHelper { request.setEndTime(endTimeStamp); requestsDbClient.save(request); - msoLogger.debug("End of " + classMethodMessage); + logger.debug("End of {}", classMethodMessage); } } |