StringUtils.concat
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.github.ltsopensource.core.commons.utils.StringUtils.concat(Showing top 6 results out of 315)

origin: ltsopensource/light-task-scheduler

public DataSource getDataSource(Config config) {
  String url = config.getParameter(ExtConfig.JDBC_URL);
  String username = config.getParameter(ExtConfig.JDBC_USERNAME);
  String password = config.getParameter(ExtConfig.JDBC_PASSWORD);
  String cachedKey = StringUtils.concat(url, username, password);
  DataSource dataSource = DATA_SOURCE_MAP.get(cachedKey);
  if (dataSource == null) {
    try {
      synchronized (lock) {
        dataSource = DATA_SOURCE_MAP.get(cachedKey);
        if (dataSource != null) {
          return dataSource;
        }
        dataSource = createDataSource(config);
        DATA_SOURCE_MAP.put(cachedKey, dataSource);
      }
    } catch (Exception e) {
      throw new IllegalStateException(
          StringUtils.format("connect datasource failed! url: {}", url), e);
    }
  }
  return dataSource;
}
origin: ltsopensource/light-task-scheduler

public DataSource getDataSource(Config config) {
  String url = config.getParameter(ExtConfig.JDBC_URL);
  String username = config.getParameter(ExtConfig.JDBC_USERNAME);
  String password = config.getParameter(ExtConfig.JDBC_PASSWORD);
  if (StringUtils.isEmpty(url)) {
    throw new IllegalArgumentException(ExtConfig.JDBC_URL + " should not be empty");
  }
  if (StringUtils.isEmpty(ExtConfig.JDBC_USERNAME)) {
    throw new IllegalArgumentException(ExtConfig.JDBC_USERNAME + " should not be empty");
  }
  String cachedKey = StringUtils.concat(url, username, password);
  DataSource dataSource = DATA_SOURCE_MAP.get(cachedKey);
  if (dataSource == null) {
    try {
      synchronized (lock) {
        dataSource = DATA_SOURCE_MAP.get(cachedKey);
        if (dataSource != null) {
          return dataSource;
        }
        dataSource = createDruidDataSource(config);
        DATA_SOURCE_MAP.put(cachedKey, dataSource);
      }
    } catch (Exception e) {
      throw new IllegalStateException(
          StringUtils.format("connect datasource failed! url: {}", url), e);
    }
  }
  return dataSource;
}
origin: ltsopensource/light-task-scheduler

public static Datastore getDataStore(Config config) {
  String[] addresses = config.getParameter(ExtConfig.MONGO_ADDRESSES, new String[]{"127.0.0.1:27017"});
  String database = config.getParameter(ExtConfig.MONGO_DATABASE, "lts");
  String username = config.getParameter(ExtConfig.MONGO_USERNAME);
  String pwd = config.getParameter(ExtConfig.MONGO_PASSWORD);
  String cachedKey = StringUtils.concat(StringUtils.concat(addresses), database, username, pwd);
  Datastore datastore = DATA_STORE_MAP.get(cachedKey);
  if (datastore == null) {
    try {
      synchronized (lock) {
        datastore = DATA_STORE_MAP.get(cachedKey);
        if (datastore != null) {
          return datastore;
        }
        Morphia morphia = new Morphia();
        MongoFactoryBean mongoFactoryBean = new MongoFactoryBean(addresses, username, database, pwd);
        MongoClient mongo = mongoFactoryBean.createInstance();
        datastore = morphia.createDatastore(mongo, database);
        DATA_STORE_MAP.put(cachedKey, datastore);
      }
    } catch (Exception e) {
      throw new IllegalStateException(
          StringUtils.format("connect mongo failed! addresses: {}, database: {}",
              addresses, database), e);
    }
  }
  return datastore;
}
origin: ltsopensource/light-task-scheduler

public DataSource getDataSource(Config config) {
  String url = config.getParameter(ExtConfig.JDBC_URL);
  String username = config.getParameter(ExtConfig.JDBC_USERNAME);
  String password = config.getParameter(ExtConfig.JDBC_PASSWORD);
  String cachedKey = StringUtils.concat(url, username, password);
  DataSource dataSource = DATA_SOURCE_MAP.get(cachedKey);
  if (dataSource == null) {
    try {
      synchronized (lock) {
        dataSource = DATA_SOURCE_MAP.get(cachedKey);
        if (dataSource != null) {
          return dataSource;
        }
        dataSource = createDataSource(config);
        DATA_SOURCE_MAP.put(cachedKey, dataSource);
      }
    } catch (Exception e) {
      throw new IllegalStateException(
          StringUtils.format("connect datasource failed! url: {}", url), e);
    }
  }
  return dataSource;
}
origin: ltsopensource/light-task-scheduler

public static Datastore getDataStore(Config config) {
  String[] addresses = config.getParameter(ExtConfig.MONGO_ADDRESSES, new String[]{"127.0.0.1:27017"});
  String database = config.getParameter(ExtConfig.MONGO_DATABASE, "lts");
  String username = config.getParameter(ExtConfig.MONGO_USERNAME);
  String pwd = config.getParameter(ExtConfig.MONGO_PASSWORD);
  String cachedKey = StringUtils.concat(StringUtils.concat(addresses), database, username, pwd);
  Datastore datastore = DATA_STORE_MAP.get(cachedKey);
  if (datastore == null) {
    try {
      synchronized (lock) {
        datastore = DATA_STORE_MAP.get(cachedKey);
        if (datastore != null) {
          return datastore;
        }
        Morphia morphia = new Morphia();
        MongoFactoryBean mongoFactoryBean = new MongoFactoryBean(addresses, username, database, pwd);
        MongoClient mongo = mongoFactoryBean.createInstance();
        datastore = morphia.createDatastore(mongo, database);
        DATA_STORE_MAP.put(cachedKey, datastore);
      }
    } catch (Exception e) {
      throw new IllegalStateException(
          StringUtils.format("connect mongo failed! addresses: {}, database: {}",
              addresses, database), e);
    }
  }
  return datastore;
}
origin: ltsopensource/light-task-scheduler

public DataSource getDataSource(Config config) {
  String url = config.getParameter(ExtConfig.JDBC_URL);
  String username = config.getParameter(ExtConfig.JDBC_USERNAME);
  String password = config.getParameter(ExtConfig.JDBC_PASSWORD);
  if (StringUtils.isEmpty(url)) {
    throw new IllegalArgumentException(ExtConfig.JDBC_URL + " should not be empty");
  }
  if (StringUtils.isEmpty(ExtConfig.JDBC_USERNAME)) {
    throw new IllegalArgumentException(ExtConfig.JDBC_USERNAME + " should not be empty");
  }
  String cachedKey = StringUtils.concat(url, username, password);
  DataSource dataSource = DATA_SOURCE_MAP.get(cachedKey);
  if (dataSource == null) {
    try {
      synchronized (lock) {
        dataSource = DATA_SOURCE_MAP.get(cachedKey);
        if (dataSource != null) {
          return dataSource;
        }
        dataSource = createDruidDataSource(config);
        DATA_SOURCE_MAP.put(cachedKey, dataSource);
      }
    } catch (Exception e) {
      throw new IllegalStateException(
          StringUtils.format("connect datasource failed! url: {}", url), e);
    }
  }
  return dataSource;
}
com.github.ltsopensource.core.commons.utilsStringUtilsconcat

Popular methods of StringUtils

  • isNotEmpty
  • isEmpty
  • format
  • generateUUID
  • toString
  • capitalize
    Capitalize a String, changing the first letter to upper case as per Character#toUpperCase(char). No
  • changeFirstCharacterCase
  • hasLength
  • hasText
  • replace
  • trim
  • uncapitalize
    Uncapitalize a String, changing the first letter to lower case as per Character#toLowerCase(char). N
  • trim,
  • uncapitalize,
  • isInteger

Popular classes and methods

  • runOnUiThread (Activity)
  • putExtra (Intent)
  • getSharedPreferences (Context)
  • Window (java.awt)
  • ArrayList (java.util)
    Resizable-array implementation of the List interface.
  • BitSet (java.util)
    This implementation uses bit groups of size 32 to keep track of when bits are set to true or false.
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JButton (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)