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 Details

    • TARGET_SCOPE

      protected static final String TARGET_SCOPE
      See Also:
    • SERVICE_ENDPOINT_CATEGORY

      protected static final String SERVICE_ENDPOINT_CATEGORY
      See Also:
    • SERVICE_ENDPOINT_NAME

      protected static final String SERVICE_ENDPOINT_NAME
      See Also:
    • TIMESCALEDB_QUERY_TEMPLATE_NAME

      protected static final String TIMESCALEDB_QUERY_TEMPLATE_NAME
      See Also:
    • DATABASE_PERSISTENCE_BACKEND

      protected static final String DATABASE_PERSISTENCE_BACKEND
      The only persistence backend configured by the database EService of 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

      public static final String URL_PROPERTY_KEY
      See Also:
    • USERNAME_PROPERTY_KEY

      public static final String USERNAME_PROPERTY_KEY
      See Also:
    • PASSWORD_PROPERTY_KEY

      public static final String PASSWORD_PROPERTY_KEY
      See Also:
    • clz

      protected Class<?> clz
      The class identifying the consumer requesting the configuration. It is retained so that subclasses can select the proper query template via getDatabaseQueryTemplateName().
  • Constructor Details

    • AccountingPersistenceConfiguration

      public AccountingPersistenceConfiguration()
    • AccountingPersistenceConfiguration

      public AccountingPersistenceConfiguration(Class<?> clz) throws Exception
      Throws:
      Exception
  • Method Details

    • loadFromGraphIS

      public boolean loadFromGraphIS(Class<?> clz) throws Exception
      Loads the configuration requested by the given class from the Graph IS: the harmonization rules for RegexRulesAggregator; 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:
      true if the configuration was loaded, false if the legacy IS must be used
      Throws:
      Exception - if the Graph IS cannot be queried
    • getDatabaseQueryTemplateName

      protected String 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

      protected org.gcube.common.resources.gcore.ServiceEndpoint getServiceEndpoint(String serviceEndpointCategory, String serviceEndpointName, Class<?> clz)
    • setValues

      protected void setValues(org.gcube.common.resources.gcore.ServiceEndpoint serviceEndpoint, Class<?> clz) throws Exception
      Throws:
      Exception