2015-07-08 15:24:32 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2015-07-08 17:28:33 +02:00
|
|
|
package org.gcube.accounting.analytics.persistence;
|
2015-07-08 15:24:32 +02:00
|
|
|
|
|
|
|
/**
|
2016-10-12 14:09:44 +02:00
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
2015-10-14 15:10:06 +02:00
|
|
|
*
|
2015-07-08 15:24:32 +02:00
|
|
|
*/
|
2015-10-14 15:10:06 +02:00
|
|
|
public class AccountingPersistenceQueryFactory {
|
2015-07-08 15:24:32 +02:00
|
|
|
|
2018-01-02 17:26:12 +01:00
|
|
|
private static final InheritableThreadLocal<String> forcedQueryScope = new InheritableThreadLocal<String>() {
|
2018-01-02 17:22:13 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String initialValue() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used to force the query in a certain scope without changing the current effective scope.
|
|
|
|
* Please note that is responsibility of the AccountingPersistenceBackendQuery implementation
|
2018-01-02 17:26:12 +01:00
|
|
|
* use the scope to query.
|
|
|
|
* The facility method AccountingPersistenceBackendQuery.getScopeToQuery() has been also created
|
2018-01-02 17:22:13 +01:00
|
|
|
*/
|
2018-01-02 17:26:12 +01:00
|
|
|
public static InheritableThreadLocal<String> getForcedQueryScope() {
|
|
|
|
return forcedQueryScope;
|
2018-01-02 17:22:13 +01:00
|
|
|
}
|
|
|
|
|
2015-10-14 15:10:06 +02:00
|
|
|
public static AccountingPersistenceQuery getInstance() {
|
|
|
|
return AccountingPersistenceQuery.getInstance();
|
2015-07-08 15:24:32 +02:00
|
|
|
}
|
2018-01-02 17:22:13 +01:00
|
|
|
|
|
|
|
|
2015-07-08 15:24:32 +02:00
|
|
|
}
|