Package org.jredis.connector

Examples of org.jredis.connector.ConnectionSpec


   * @return
   */
  public static ClusterSpec newSpecForRange (ConnectionSpec templateConnSpec, int firstPort, int lastPort) {
    ClusterSpec spec = new DefaultClusterSpec();
    for(int i=firstPort; i<=lastPort; i++){
      ConnectionSpec connSpec = DefaultConnectionSpec.newSpec()
        .setAddress(templateConnSpec.getAddress())
        .setPort(i)
        .setDatabase(templateConnSpec.getDatabase())
        .setCredentials(templateConnSpec.getCredentials());
      ClusterNodeSpec nodeSpec = new DefaultClusterNodeSpec(connSpec);
View Full Code Here


  // Interface
  // ------------------------------------------------------------------------
 
  public static ClusterNodeSpec getSpecFor(Socket conn){
    if(null == conn) throw new IllegalArgumentException("null arg [conn]");
    ConnectionSpec connSpec = DefaultConnectionSpec.newSpec(conn.getInetAddress(), conn.getPort(), 0, null);
    return new DefaultClusterNodeSpec(connSpec);
  }
View Full Code Here

   */
  @Override
  protected JRedisFuture newProviderInstance () {
    JRedisFuture provider = null;
    try {
      ConnectionSpec connectionSpec = DefaultConnectionSpec.newSpec(this.host, this.port, this.db2, this.password.getBytes());
      provider = new JRedisAsyncClient(connectionSpec);
        }
        catch (ClientRuntimeException e) {
          Log.error(e.getLocalizedMessage());
        }
View Full Code Here

   */
  @Override
  protected JRedisFuture newProviderInstance () {
    JRedisFuture provider = null;
    try {
      ConnectionSpec connectionSpec = DefaultConnectionSpec.newSpec(this.host, this.port, this.db2, this.password.getBytes());
      provider = new JRedisPipeline(connectionSpec);
        }
        catch (ClientRuntimeException e) {
          Log.error(e.getLocalizedMessage());
        }
View Full Code Here

   * @param timeout The socket timeout or 0 to use the default socket timeout
   * @param poolConfig The pool {@link Config}
   */
  public JredisPool(String hostName, int port, int dbIndex, String password, int timeout,
      GenericObjectPoolConfig poolConfig) {
    ConnectionSpec connectionSpec = DefaultConnectionSpec.newSpec(hostName, port, dbIndex, null);
    connectionSpec.setConnectionFlag(Connection.Flag.RELIABLE, false);
    if (StringUtils.hasLength(password)) {
      connectionSpec.setCredentials(password);
    }
    if (timeout > 0) {
      connectionSpec.setSocketProperty(Property.SO_TIMEOUT, timeout);
    }
    this.internalPool = new GenericObjectPool<JRedis>(new JredisFactory(connectionSpec), poolConfig);
  }
View Full Code Here

TOP

Related Classes of org.jredis.connector.ConnectionSpec

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.