diff options
author | 2017-04-11 13:30:42 +0200 | |
---|---|---|
committer | 2017-04-11 15:34:19 +0200 | |
commit | b6b7bef8bdcad15af01ac88a038dd763ce59f68f (patch) | |
tree | 399d39da23aaa37701e487df064e3e0c27709ef3 /mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java | |
parent | 19340cad94eeaa1b580f7c0c99531de499e8ca14 (diff) |
[MSO-8] Update the maven dependency
Update the maven depenency for sdc-distribution-client to cooperate with the sdc changes.
Change-Id: I2da936e5c40cb68c7181bb78307192dd5655b5dc
Signed-off-by: xg353y <xg353y@intl.att.com>
Diffstat (limited to 'mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java')
-rw-r--r-- | mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java index fda4461840..e32c456295 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java @@ -35,13 +35,17 @@ import org.hibernate.criterion.Criterion; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.hibernate.persister.entity.AbstractEntityPersister; - +import org.openecomp.mso.db.HibernateUtils; +import org.openecomp.mso.requestsdb.HibernateUtilsRequestsDb; import org.openecomp.mso.logger.MsoLogger; +import org.openecomp.mso.logger.MessageEnum; public class RequestsDatabase { + protected static HibernateUtils hibernateUtils = new HibernateUtilsRequestsDb (); + protected static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL); - + protected static final String SOURCE = "source"; protected static final String START_TIME = "startTime"; protected static final String REQUEST_TYPE = "requestType"; @@ -70,7 +74,7 @@ public class RequestsDatabase { } public static boolean healthCheck () { - Session session = HibernateUtil.getSessionFactory ().openSession (); + Session session = hibernateUtils.getSessionFactory ().openSession (); try { Query query = session.createSQLQuery (" show tables "); @@ -88,7 +92,7 @@ public class RequestsDatabase { public static int updateInfraStatus (String requestId, String requestStatus, String lastModifiedBy) { long startTime = System.currentTimeMillis (); msoLogger.debug ("Update infra request record " + requestId + " with status " + requestStatus); - Session session = HibernateUtil.getSessionFactory ().openSession (); + Session session = hibernateUtils.getSessionFactory ().openSession (); int result = 0; try { @@ -113,7 +117,7 @@ public class RequestsDatabase { public static int updateInfraStatus (String requestId, String requestStatus, long progress, String lastModifiedBy) { long startTime = System.currentTimeMillis (); msoLogger.debug ("Update infra request record " + requestId + " with status " + requestStatus); - Session session = HibernateUtil.getSessionFactory ().openSession (); + Session session = hibernateUtils.getSessionFactory ().openSession (); int result = 0; try { @@ -139,7 +143,7 @@ public class RequestsDatabase { public static int updateInfraFinalStatus (String requestId, String requestStatus, String statusMessage, long progress, String responseBody, String lastModifiedBy) { long startTime = System.currentTimeMillis (); msoLogger.debug ("Update infra request record " + requestId + " with status " + requestStatus); - Session session = HibernateUtil.getSessionFactory ().openSession (); + Session session = hibernateUtils.getSessionFactory ().openSession (); int result = 0; try { @@ -172,7 +176,7 @@ public class RequestsDatabase { List <InfraActiveRequests> results = new ArrayList<InfraActiveRequests>(); - Session session = HibernateUtil.getSessionFactory ().openSession (); + Session session = hibernateUtils.getSessionFactory ().openSession (); try { session.beginTransaction (); Criteria crit = session.createCriteria (InfraActiveRequests.class); @@ -197,7 +201,7 @@ public class RequestsDatabase { long startTime = System.currentTimeMillis (); msoLogger.debug ("Get request " + requestId + " from InfraActiveRequests DB"); - Session session = HibernateUtil.getSessionFactory ().openSession (); + Session session = hibernateUtils.getSessionFactory ().openSession (); InfraActiveRequests ar = null; try { session.beginTransaction (); @@ -314,7 +318,7 @@ public class RequestsDatabase { long startTime = System.currentTimeMillis (); msoLogger.debug ("Get list of infra requests from DB with " + queryAttributeName + " = " + queryValue); - Session session = HibernateUtil.getSessionFactory ().openSession (); + Session session = hibernateUtils.getSessionFactory ().openSession (); try { session.beginTransaction (); Criteria crit = session.createCriteria (InfraActiveRequests.class) @@ -342,7 +346,7 @@ public class RequestsDatabase { long startTime = System.currentTimeMillis (); msoLogger.debug ("Get infra request from DB with id " + requestId); - Session session = HibernateUtil.getSessionFactory ().openSession (); + Session session = hibernateUtils.getSessionFactory ().openSession (); InfraActiveRequests ar = null; try { session.beginTransaction (); @@ -366,7 +370,7 @@ public class RequestsDatabase { msoLogger.debug ("Get infra request from DB for VNF " + vnfName + " and action " + action + " and requestType " + requestType); InfraActiveRequests ar = null; - Session session = HibernateUtil.getSessionFactory ().openSession (); + Session session = hibernateUtils.getSessionFactory ().openSession (); try { session.beginTransaction (); @@ -395,7 +399,7 @@ public class RequestsDatabase { msoLogger.debug ("Get list of infra requests from DB for VNF " + vnfId + " and action " + action); InfraActiveRequests ar = null; - Session session = HibernateUtil.getSessionFactory ().openSession (); + Session session = hibernateUtils.getSessionFactory ().openSession (); try { session.beginTransaction (); @@ -429,7 +433,7 @@ public class RequestsDatabase { * @return SiteStatus object or null if none found */ public static SiteStatus getSiteStatus (String siteName) { - Session session = HibernateUtil.getSessionFactory ().openSession (); + Session session = hibernateUtils.getSessionFactory ().openSession (); long startTime = System.currentTimeMillis (); SiteStatus siteStatus = null; @@ -456,7 +460,7 @@ public class RequestsDatabase { * @param status The updated status of the Site */ public static void updateSiteStatus (String siteName, boolean status) { - Session session = HibernateUtil.getSessionFactory ().openSession (); + Session session = hibernateUtils.getSessionFactory ().openSession (); session.beginTransaction (); long startTime = System.currentTimeMillis (); |