Package org.gcube.accounting.persistence
Class AccountingPersistenceConfiguration
java.lang.Object
org.gcube.documentstore.persistence.PersistenceBackendConfiguration
org.gcube.accounting.persistence.AccountingPersistenceConfiguration
public class AccountingPersistenceConfiguration
extends org.gcube.documentstore.persistence.PersistenceBackendConfiguration
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Class<?>The class identifying the consumer requesting the configuration.protected static final StringThe only persistence backend configured by the databaseEServiceof the Graph IS.static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final StringFields inherited from class org.gcube.documentstore.persistence.PersistenceBackendConfiguration
properties -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns the name of the query template used to retrieve the database configuration from the Graph IS.protected org.gcube.common.resources.gcore.ServiceEndpointgetServiceEndpoint(String serviceEndpointCategory, String serviceEndpointName, Class<?> clz) booleanloadFromGraphIS(Class<?> clz) Loads the configuration requested by the given class from the Graph IS: the harmonization rules forRegexRulesAggregator; the database configuration for the database persistence backend ("PersistencePostgreSQL") and for consumers which are not persistence backends.protected voidMethods inherited from class org.gcube.documentstore.persistence.PersistenceBackendConfiguration
addProperty, getInstance, getProperty, toString
-
Field Details
-
TARGET_SCOPE
- See Also:
-
SERVICE_ENDPOINT_CATEGORY
- See Also:
-
SERVICE_ENDPOINT_NAME
- See Also:
-
TIMESCALEDB_QUERY_TEMPLATE_NAME
- See Also:
-
DATABASE_PERSISTENCE_BACKEND
The only persistence backend configured by the databaseEServiceof the Graph IS. Every other persistence backend (e.g.PersistenceAccountingService) is configured by the legacy IS, by the access point named after it, and never receives the database endpoint or credentials.- See Also:
-
URL_PROPERTY_KEY
- See Also:
-
USERNAME_PROPERTY_KEY
- See Also:
-
PASSWORD_PROPERTY_KEY
- See Also:
-
clz
The class identifying the consumer requesting the configuration. It is retained so that subclasses can select the proper query template viagetDatabaseQueryTemplateName().
-
-
Constructor Details
-
AccountingPersistenceConfiguration
public AccountingPersistenceConfiguration() -
AccountingPersistenceConfiguration
- Throws:
Exception
-
-
Method Details
-
loadFromGraphIS
Loads the configuration requested by the given class from the Graph IS: the harmonization rules forRegexRulesAggregator; the database configuration for the database persistence backend ("PersistencePostgreSQL") and for consumers which are not persistence backends. Any other persistence backend has no configuration on the Graph IS.- Parameters:
clz- the class requesting the configuration- Returns:
trueif the configuration was loaded,falseif the legacy IS must be used- Throws:
Exception- if the Graph IS cannot be queried
-
getDatabaseQueryTemplateName
Returns the name of the query template used to retrieve the database configuration from the Graph IS. The base implementation returns the template owned by the accounting-lib module. Consumers that read/write a different database (e.g. the analytics or the aggregator components) are expected to override this method to return their own template, whose definition is shipped and registered by the owning component.- Returns:
- the query template name to execute for the database configuration
-
getServiceEndpoint
-
setValues
protected void setValues(org.gcube.common.resources.gcore.ServiceEndpoint serviceEndpoint, Class<?> clz) throws Exception - Throws:
Exception
-