Reintroduced ScopeProvider to avoid problem in the next release
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-analytics@124140 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ceebe58946
commit
d3dab39dfb
6
pom.xml
6
pom.xml
|
@ -47,6 +47,12 @@
|
||||||
<artifactId>accounting-lib</artifactId>
|
<artifactId>accounting-lib</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.core</groupId>
|
||||||
|
<artifactId>common-scope</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.json</groupId>
|
<groupId>org.json</groupId>
|
||||||
<artifactId>json</artifactId>
|
<artifactId>json</artifactId>
|
||||||
|
|
|
@ -9,7 +9,7 @@ import java.util.ServiceLoader;
|
||||||
|
|
||||||
import org.gcube.accounting.analytics.exception.NoAvailableScopeException;
|
import org.gcube.accounting.analytics.exception.NoAvailableScopeException;
|
||||||
import org.gcube.accounting.analytics.exception.NoUsableAccountingPersistenceQueryFound;
|
import org.gcube.accounting.analytics.exception.NoUsableAccountingPersistenceQueryFound;
|
||||||
import org.gcube.accounting.datamodel.BasicUsageRecord;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -34,7 +34,8 @@ public abstract class AccountingPersistenceBackendQueryFactory {
|
||||||
* the #AccountingPersistenceQuery
|
* the #AccountingPersistenceQuery
|
||||||
*/
|
*/
|
||||||
public synchronized static AccountingPersistenceBackendQuery getInstance() throws NoAvailableScopeException, NoUsableAccountingPersistenceQueryFound {
|
public synchronized static AccountingPersistenceBackendQuery getInstance() throws NoAvailableScopeException, NoUsableAccountingPersistenceQueryFound {
|
||||||
String scope = BasicUsageRecord.getScopeFromToken();
|
//String scope = BasicUsageRecord.getScopeFromToken();
|
||||||
|
String scope = ScopeProvider.instance.get();
|
||||||
if(scope==null){
|
if(scope==null){
|
||||||
throw new NoAvailableScopeException();
|
throw new NoAvailableScopeException();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue