From 55eac59040ed4747d730aebc12a3b673c1faf4e2 Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Fri, 21 Oct 2016 20:57:32 +0000 Subject: [PATCH] minor fix git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@133397 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 10 +++---- .../filters/RequestsAuthAccountingFilter.java | 30 ------------------- 2 files changed, 5 insertions(+), 35 deletions(-) diff --git a/pom.xml b/pom.xml index ade93d7..8dc65e4 100644 --- a/pom.xml +++ b/pom.xml @@ -78,11 +78,11 @@ portal-manager [2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT) - - org.gcube.accounting - accounting-lib - provided - + + + + + org.gcube.common common-authorization diff --git a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/filters/RequestsAuthAccountingFilter.java b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/filters/RequestsAuthAccountingFilter.java index d2ee09e..9254941 100644 --- a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/filters/RequestsAuthAccountingFilter.java +++ b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/filters/RequestsAuthAccountingFilter.java @@ -11,10 +11,6 @@ import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import javax.ws.rs.ext.Provider; -import org.gcube.accounting.datamodel.UsageRecord.OperationResult; -import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord; -import org.gcube.accounting.persistence.AccountingPersistence; -import org.gcube.accounting.persistence.AccountingPersistenceFactory; import org.gcube.common.authorization.library.AuthorizationEntry; import org.gcube.common.authorization.library.provider.AuthorizationProvider; import org.gcube.common.authorization.library.utils.Caller; @@ -33,7 +29,6 @@ public class RequestsAuthAccountingFilter implements ContainerRequestFilter{ private static final org.slf4j.Logger logger = LoggerFactory.getLogger(RequestsAuthAccountingFilter.class); private static final String AUTH_TOKEN = "gcube-token"; - private final static AccountingPersistence accountingPersistence = AccountingPersistenceFactory.getPersistence(); @Override public void filter(ContainerRequestContext requestContext) @@ -106,29 +101,4 @@ public class RequestsAuthAccountingFilter implements ContainerRequestFilter{ return res; } - /** - * Accounts service requests - */ - private static void accountRequest(String username){ - - // Create a new Service Usage Record - ServiceUsageRecord usageRecord = new ServiceUsageRecord(); - - try{ - // TODO - usageRecord.setResourceProperty(ServiceUsageRecord.CONSUMER_ID, username); - usageRecord.setOperationResult(OperationResult.SUCCESS); - usageRecord.setCallerHost("node13.d4science.org"); - usageRecord.setHost("node22.d4science.org"); - usageRecord.setServiceClass("VREManagement"); - usageRecord.setServiceName("SmartExecutor"); - usageRecord.setCalledMethod("launch"); - usageRecord.setResourceProperty(ServiceUsageRecord.DURATION, "300"); - accountingPersistence.account(usageRecord); - }catch(Exception e){ - logger.error("Unable to account this service usage record", e); - } - - } - }