ApplicationResources.java [src/java/m/rv] Revision: default  Date:
/*
 * $Id$
 *
 * This file is part of the Cloud Services Integration Platform (CSIP),
 * a Model-as-a-Service framework, API, and application suite.
 *
 * 2012-2022, OMSLab, Colorado State University.
 *
 * OMSLab licenses this file to you under the MIT license.
 * See the LICENSE file in the project root for more information.
 */
package m.rv;

import csip.Config;
import csip.annotations.Resource;
import static csip.annotations.ResourceType.JDBC;
import static m.rv.ApplicationResources.CRDB;
import static m.rv.ApplicationResources.GIS_DB;

/**
 *
 * @author odavid
 */
@Resource(type = JDBC, file = "${crdb.db}", id = CRDB, env = {
  "removeAbandoned=true", "defaultReadOnly=true", "defaultAutoCommit=false", "maxWait=300000", "jmxEnabled=false",
  "jdbcInterceptors=org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;"
  + "org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer;"
  + "org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer"
})

@Resource(type = JDBC, file = "${gis.database.db}", id = GIS_DB, env
    = {
      "removeAbandoned=true", "defaultReadOnly=true", "defaultAutoCommit=false", "maxWait=300000", "jmxEnabled=false",
      "jdbcInterceptors=org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer;org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer"
    }
)

@Resource(from = soils.db.DBResources.class)
public interface ApplicationResources {

  String CRDB = "mssql-gras";
  String GIS_DB = "csip.gis.db";

  String SOILS_SOURCE
      = Config.getString("soils.gis.database.source");

  // Queries cache
  int CRM_CACHE_SIZE
      = Config.getInt("crm.cache.size", 64);

  String CRM_CACHE_TTL
      = Config.getString("crm.cache.ttl", "PT30M");

  // Queries cache
  int CRM_CON_RETRY
      = Config.getInt("crm.con.retry", 5);

  // Queries service timeout in sec.
  int CRM_TIMEOUT
      = Config.getInt("crm.con.timeout", 5);

  // parallel queries.
  int CRM_PARALLEL_CALLS
      = Config.getInt("crm.parallel.calls", 4);

  String CRM_URL
      = Config.getString("crm.url", "https://prod-39.westus.logic.azure.com");

  String CRM_PRODUCTS
      = Config.getString("crm.products", "/workflows/14af84c03e644ab699ea364fc8e21b61/triggers/manual/paths/invoke/product/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJPbmxpbmUgSldUIEJ1aWxkZXIiLCJpYXQiOjE2MzE3NDUwNDAsImV4cCI6MTY2MzI4MTA0MCwiYXVkIjoid3d3LmV4YW1wbGUuY29tIiwic3ViIjoianJvY2tldEBleGFtcGxlLmNvbSIsIlByb3ZpZGVyIjoiQmFtZXJ0U2VlZCIsIkJ1aWxkZXIiOiJEZWZpbml0eSBGaXJzdCIsIkRldiI6Ik1pZ3VlbEFydml6dSJ9.XPwOz5OVU7WiqFOdDY4ped43OMHOQO-CYO3LEn4a2YQ?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=vWlCi-6QVye41ZW58UWdozs96Qs1n0cujDIKqBgAGvk");
}