/** * Provides a list of all connection wrappers corresponding to a current environment. * * @return a list of all connection wrappers corresponding to a current environment. */ public static List<ConnectionSpecWrapper> getConnectionSpecWrappers() { return getConnectionSpecWrappers(Configuration.getEnv()); }
private void createJndiWrapper(String env, String jndiName) { ConnectionSpecWrapper wrapper = new ConnectionSpecWrapper(); wrapper.setEnvironment(env); ConnectionJndiSpec connectionSpec = new ConnectionJndiSpec(jndiName); wrapper.setConnectionSpec(connectionSpec); addConnectionWrapper(wrapper, false); }
public static void clearConnectionWrappers() { clearConnectionWrappers(Configuration.getEnv()); }
String jndiName = env + "." + "jndi"; if (props.containsKey(jndiName)) { createJndiWrapper(env, props.getProperty(jndiName)); } else { String driver = props.getProperty(env + ".driver"); String password = props.getProperty(env + ".password"); String url = props.getProperty(env + ".url"); checkProps(driver, userName, password, url, env); createJdbcWrapper(env, driver, url, userName, password);
String jndiName = env + "." + "jndi"; if (props.containsKey(jndiName)) { createJndiWrapper(env, props.getProperty(jndiName)); } else { String driver = props.getProperty(env + ".driver"); String password = props.getProperty(env + ".password"); String url = props.getProperty(env + ".url"); checkProps(driver, userName, password, url, env); createJdbcWrapper(env, driver, url, userName, password);
public List<ConnectionSpecWrapper> getTestConnectionWrappers() { List<ConnectionSpecWrapper> allConnections = getConnectionSpecWrappers(); List<ConnectionSpecWrapper> result = new LinkedList<>(); for (ConnectionSpecWrapper connectionWrapper : allConnections) { if (connectionWrapper.isTesting()) result.add(connectionWrapper); } return result; } }
private void createJdbcWrapper(String env, String driver, String url, String userName, String password) { ConnectionSpecWrapper wrapper = new ConnectionSpecWrapper(); if(env.equals("test")){ wrapper.setEnvironment("development"); wrapper.setTesting(true); } else if(env.endsWith(".test")) { wrapper.setEnvironment(env.split("\\.")[0]); wrapper.setTesting(true); }else{ wrapper.setEnvironment(env); } ConnectionJdbcSpec connectionSpec = new ConnectionJdbcSpec(driver, url, userName, password); wrapper.setConnectionSpec(connectionSpec); addConnectionWrapper(wrapper, false); }
public static void clearConnectionWrappers() { DbConfiguration.clearConnectionWrappers(); }
private static List<ConnectionSpecWrapper> getTestConnectionWrappers() { List<ConnectionSpecWrapper> allConnections = DbConfiguration.getConnectionSpecWrappers(); List<ConnectionSpecWrapper> result = new LinkedList<>(); for (ConnectionSpecWrapper connectionWrapper : allConnections) { if (connectionWrapper.isTesting()) result.add(connectionWrapper); } return result; } }
ConnectionBuilder(String environment) { connectionWrapper = new ConnectionSpecWrapper(); connectionWrapper.setEnvironment(environment); DbConfiguration.addConnectionWrapper(connectionWrapper, false); }
public static void clearConnectionWrappers() { clearConnectionWrappers(Configuration.getEnv()); }
public List<ConnectionSpecWrapper> getTestConnectionWrappers() { List<ConnectionSpecWrapper> allConnections = getConnectionSpecWrappers(); List<ConnectionSpecWrapper> result = new LinkedList<>(); for (ConnectionSpecWrapper connectionWrapper : allConnections) { if (connectionWrapper.isTesting()) result.add(connectionWrapper); } return result; } }
ConnectionBuilder(String environment, boolean override) { connectionWrapper = new ConnectionSpecWrapper(); connectionWrapper.setEnvironment(environment); DbConfiguration.addConnectionWrapper(connectionWrapper, override); }
/** * Provides a list of all connection wrappers corresponding to a current environment. * * @return a list of all connection wrappers corresponding to a current environment. */ public static List<ConnectionSpecWrapper> getConnectionSpecWrappers() { return getConnectionSpecWrappers(Configuration.getEnv()); }
private void createJndiWrapper(String env, String jndiName) { ConnectionSpecWrapper wrapper = new ConnectionSpecWrapper(); wrapper.setEnvironment(env); ConnectionJndiSpec connectionSpec = new ConnectionJndiSpec(jndiName); wrapper.setConnectionSpec(connectionSpec); addConnectionWrapper(wrapper, false); }
/** * Returns all connections which correspond dbName of this filter and not for testing * * @return all connections which correspond dbName of this filter and not for testing. */ private List<ConnectionSpecWrapper> getConnectionWrappers() { List<ConnectionSpecWrapper> allConnections = DbConfiguration.getConnectionSpecWrappers(); List<ConnectionSpecWrapper> result = new LinkedList<>(); for (ConnectionSpecWrapper connectionWrapper : allConnections) { if (!connectionWrapper.isTesting() && (dbName == null || dbName.equals(connectionWrapper.getDbName()))) result.add(connectionWrapper); } return result; } }
private void createJdbcWrapper(String env, String driver, String url, String userName, String password) { ConnectionSpecWrapper wrapper = new ConnectionSpecWrapper(); if(env.equals("test")){ wrapper.setEnvironment("development"); wrapper.setTesting(true); } else if(env.endsWith(".test")) { wrapper.setEnvironment(env.split("\\.")[0]); wrapper.setTesting(true); }else{ wrapper.setEnvironment(env); } ConnectionJdbcSpec connectionSpec = new ConnectionJdbcSpec(driver, url, userName, password); wrapper.setConnectionSpec(connectionSpec); addConnectionWrapper(wrapper, false); }