ServiceResources.java [src/java/crlmod] Revision:   Date:
/*
 * $Id$
 *
 * This file is part of the Cloud Services Integration Platform (CSIP),
 * a Model-as-a-Service framework, API, and application suite.
 *
 * 2012-2024, 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 crlmod;

import static crlmod.ServiceResources.*;
import csip.annotations.*;
import static csip.annotations.ResourceType.*;

/**
 * Shared CRLMOD Service resources.
 *
 * @author lucasy
 */
// LMOD SQL DB
@Resource(type = JDBC, file = "${lmod.db}", id = LMOD_ID,
        env = {
          "maxWait=6000000",
          "jmxEnabled=false",
          "logAbandoned=true",
          "removeAbandonedTimeout=3000",
          "testOnBorrow=true",
          "validationQuery=SELECT 1",
          "testOnReturn=false",
          "validationInterval=30000",
          "timeBetweenEvictionRunsMillis=30000",
          "removeAbandoned=true",
          "defaultAutoCommit=false"
        }
)
// CR_LMOD SQL DB
@Resource(type = JDBC, file = "${crlmod.db}", id = CR_LMOD_ID,
        env = {
          "maxWait=6000000",
          "jmxEnabled=false",
          "logAbandoned=true",
          "removeAbandonedTimeout=3000",
          "testOnBorrow=true",
          "validationQuery=SELECT 1",
          "testOnReturn=false",
          "validationInterval=30000",
          "timeBetweenEvictionRunsMillis=30000",
          "removeAbandoned=true",
          "defaultAutoCommit=false"
        }
)
// CR_LMOD_2018 SQL DB
@Resource(type = JDBC, file = "${crlmod.2018.db}", id = CR_LMOD_2018_ID,
        env = {
          "maxWait=6000000",
          "jmxEnabled=false",
          "logAbandoned=true",
          "removeAbandonedTimeout=3000",
          "testOnBorrow=true",
          "validationQuery=SELECT 1",
          "testOnReturn=false",
          "validationInterval=30000",
          "timeBetweenEvictionRunsMillis=30000",
          "removeAbandoned=true",
          "defaultAutoCommit=false"
        }
)
//CR_LMOD_2018_June SQL DB
@Resource(type = JDBC, file = "${crlmod.2018.june.db}", id = CR_LMOD_2018_JUNE_ID,
        env = {
          "maxWait=6000000",
          "jmxEnabled=false",
          "logAbandoned=true",
          "removeAbandonedTimeout=3000",
          "testOnBorrow=true",
          "validationQuery=SELECT 1",
          "testOnReturn=false",
          "validationInterval=30000",
          "timeBetweenEvictionRunsMillis=30000",
          "removeAbandoned=true",
          "defaultAutoCommit=false"
        }
)
// CR_LMOD_2019 SQL DB
@Resource(type = JDBC, file = "${crlmod.2019.db}", id = CR_LMOD_2019_ID,
        env = {
          "maxWait=6000000",
          "jmxEnabled=false",
          "logAbandoned=true",
          "removeAbandonedTimeout=3000",
          "testOnBorrow=true",
          "validationQuery=SELECT 1",
          "testOnReturn=false",
          "validationInterval=30000",
          "timeBetweenEvictionRunsMillis=30000",
          "removeAbandoned=true",
          "defaultAutoCommit=false"
        }
)
// CR_LMOD_2019_step SQL DB
@Resource(type = JDBC, file = "${crlmod.2019.step.db}", id = CR_LMOD_2019_STEP_ID,
        env = {
          "maxWait=6000000",
          "jmxEnabled=false",
          "logAbandoned=true",
          "removeAbandonedTimeout=3000",
          "testOnBorrow=true",
          "validationQuery=SELECT 1",
          "testOnReturn=false",
          "validationInterval=30000",
          "timeBetweenEvictionRunsMillis=30000",
          "removeAbandoned=true",
          "defaultAutoCommit=false"
        }
)

// CR_LMOD_2021 SQL DB
@Resource(type = JDBC, file = "${crlmod.2021.db}", id = CR_LMOD_2021_ID,
        env = {
          "maxWait=6000000",
          "jmxEnabled=false",
          "logAbandoned=true",
          "removeAbandonedTimeout=3000",
          "testOnBorrow=true",
          "validationQuery=SELECT 1",
          "testOnReturn=false",
          "validationInterval=30000",
          "timeBetweenEvictionRunsMillis=30000",
          "removeAbandoned=true",
          "defaultAutoCommit=false"
        }
)

// CR_LMOD_2022 SQL DB
@Resource(type = JDBC, file = "${crlmod.2022.db}", id = CR_LMOD_2022_ID,
        env = {
          "maxWait=6000000",
          "jmxEnabled=false",
          "logAbandoned=true",
          "removeAbandonedTimeout=3000",
          "testOnBorrow=true",
          "validationQuery=SELECT 1",
          "testOnReturn=false",
          "validationInterval=30000",
          "timeBetweenEvictionRunsMillis=30000",
          "removeAbandoned=true",
          "defaultAutoCommit=false"
        }
)

// CR_LMOD_2022 SQL DB
@Resource(type = JDBC, file = "${crlmod.latest.db}", id = CR_LMOD_R2,
        env = {
          "maxWait=6000000",
          "jmxEnabled=false",
          "logAbandoned=true",
          "removeAbandonedTimeout=3000",
          "testOnBorrow=true",
          "validationQuery=SELECT 1",
          "testOnReturn=false",
          "validationInterval=30000",
          "timeBetweenEvictionRunsMillis=30000",
          "removeAbandoned=true",
          "defaultAutoCommit=false"
        }
)

// SQL Lite
//@Resource(type = FILE, file = "/bin/win-x86/sqlite.exe", id = SQLITE_ID)
//@Resource(type = FILE, file = "/bin/win-x86/sqlite3.exe", id = SQLITE3_ID)
// CMD line
//@Resource(type = REFERENCE, file = "cmd", id = CMD_ID)
public interface ServiceResources {

  // resource ids
  String LMOD_ID = "lmod";
  String CR_LMOD_ID = "cr_lmod";
  String CR_LMOD_2018_ID = "cr_lmod_2018";
  String CR_LMOD_2018_JUNE_ID = "cr_lmod_2018_june";
  String CR_LMOD_2019_ID = "cr_lmod_2019";
  String CR_LMOD_2019_STEP_ID = "cr_lmod_2019_step";
  String CR_LMOD_2021_ID = "cr_lmod_2021";
  String CR_LMOD_2022_ID = "cr_lmod_2022";  
  String CR_LMOD_R2 = "cr_lmod_current_year_plus_r2_step";
//  String SQLITE_ID = "sqllite";
//  String SQLITE3_ID = "sqllite3";
//  String CMD_ID = "cmd";

  // keys
  String KEY_NAME = "name";
  String KEY_PATH = "path";
  String KEY_PARTIAL_PATH = "partial_path";
  String KEY_KEYWORDS = "keywords";
  String KEY_CMZ = "cmz";
  String KEY_STIR_MIN = "stir_min";
  String KEY_STIR_MAX = "stir_max";
  String KEY_LIMIT = "limit";
  String KEY_OFFSET = "offset";
  String KEY_ID = "id";
  String KEY_FULLDATA = "full_data";
  String KEY_FORMAT = "format";
  String KEY_STATUS = "status";
  String KEY_USER_ID = "user_id";
  String KEY_R2DATA = "r2data";
  String KEY_R2FILENAME = "r2_file_name";
  String KEY_WEPSDATA = "wepsdata";
  String KEY_WEPSFILENAME = "weps_file_name";
  String KEY_TRANSFILE = "transfile";
  String KEY_NAMESONLY = "names_only";
  String KEY_NATIVEFORMATS = "native_formats";
}