|
|
|
@ -1,13 +1,12 @@
|
|
|
|
|
package org.gcube.smartgears.handlers.application.request;
|
|
|
|
|
|
|
|
|
|
import static org.gcube.smartgears.Constants.called_method_header;
|
|
|
|
|
|
|
|
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
|
|
|
|
|
|
|
|
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.provider.AuthorizationProvider;
|
|
|
|
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
|
|
|
|
import org.gcube.common.authorization.utils.manager.SecretManagerProvider;
|
|
|
|
|
import org.gcube.common.scope.api.ScopeProvider;
|
|
|
|
@ -38,7 +37,7 @@ public class RequestAccounting extends RequestHandler {
|
|
|
|
|
public void handleRequest(RequestEvent e) {
|
|
|
|
|
ApplicationContext context = e.context();
|
|
|
|
|
|
|
|
|
|
String calledMethod = e.request().getHeader(called_method_header);
|
|
|
|
|
String calledMethod = e.request().getHeader(Constants.called_method_header);
|
|
|
|
|
if (calledMethod==null){
|
|
|
|
|
calledMethod = e.request().getRequestURI().substring(e.request().getContextPath().length());
|
|
|
|
|
if (calledMethod.isEmpty())
|
|
|
|
@ -84,6 +83,7 @@ public class RequestAccounting extends RequestHandler {
|
|
|
|
|
InnerMethodName.instance.reset();
|
|
|
|
|
if (resetScope)
|
|
|
|
|
ScopeProvider.instance.reset();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void generateAccounting(String caller, String callerQualifier, String remoteHost, boolean success, ApplicationContext context){
|
|
|
|
|