From b7902945352d14b8f263f51c8a7c17391d0c1100 Mon Sep 17 00:00:00 2001 From: Ashan Rathnaweera Date: Wed, 16 Oct 2024 09:36:31 +0530 Subject: [PATCH] Refactor the code related to the Transaction Counter --- .../wso2/carbon/apimgt/impl/dao/TransactionCountDAO.java | 6 +++++- .../service/impl/TransactionRecordsApiServiceImpl.java | 9 +-------- .../admin/v1/impl/TransactionCountApiServiceImpl.java | 9 +-------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/TransactionCountDAO.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/TransactionCountDAO.java index 2cef69a84cda..0ca731e03e49 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/TransactionCountDAO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/TransactionCountDAO.java @@ -24,7 +24,11 @@ import org.wso2.carbon.apimgt.impl.dto.TransactionCountDTO; import org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil; -import java.sql.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.sql.PreparedStatement; +import java.sql.Connection; +import java.sql.ResultSet; /** * This class represent the TransactionCountDAO. diff --git a/components/apimgt/org.wso2.carbon.apimgt.internal.service/src/main/java/org/wso2/carbon/apimgt/internal/service/impl/TransactionRecordsApiServiceImpl.java b/components/apimgt/org.wso2.carbon.apimgt.internal.service/src/main/java/org/wso2/carbon/apimgt/internal/service/impl/TransactionRecordsApiServiceImpl.java index 384fccb6a3d7..ddd5aa1821a7 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.internal.service/src/main/java/org/wso2/carbon/apimgt/internal/service/impl/TransactionRecordsApiServiceImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.internal.service/src/main/java/org/wso2/carbon/apimgt/internal/service/impl/TransactionRecordsApiServiceImpl.java @@ -23,23 +23,16 @@ import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.impl.dao.TransactionCountDAO; import org.wso2.carbon.apimgt.impl.dto.TransactionCountDTO; -import org.wso2.carbon.apimgt.internal.service.*; -import org.wso2.carbon.apimgt.internal.service.dto.*; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.MessageContext; import java.util.List; +import org.wso2.carbon.apimgt.internal.service.TransactionRecordsApiService; import org.wso2.carbon.apimgt.internal.service.dto.TransactionRecordDTO; import org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil; -import java.util.List; - -import java.io.InputStream; - import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; public class TransactionRecordsApiServiceImpl implements TransactionRecordsApiService { diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/TransactionCountApiServiceImpl.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/TransactionCountApiServiceImpl.java index bcb83c642db1..8a363bdeb0a3 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/TransactionCountApiServiceImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/TransactionCountApiServiceImpl.java @@ -23,25 +23,18 @@ import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.impl.dao.TransactionCountDAO; import org.wso2.carbon.apimgt.impl.dto.TransactionCountDTO; -import org.wso2.carbon.apimgt.rest.api.admin.v1.*; -import org.wso2.carbon.apimgt.rest.api.admin.v1.dto.*; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.MessageContext; -import org.wso2.carbon.apimgt.rest.api.admin.v1.dto.ErrorDTO; +import org.wso2.carbon.apimgt.rest.api.admin.v1.TransactionCountApiService; import org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil; import java.sql.Timestamp; import java.time.Instant; import java.time.LocalTime; import java.time.ZoneId; -import java.util.List; - -import java.io.InputStream; import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; public class TransactionCountApiServiceImpl implements TransactionCountApiService {