- apps/lotteryServer, lotteryCapture, lotteryOpen 三个业务工程 - 忽略 archive/, tools/, infra/data/ 大目录与敏感配置文件 - 移除 lotteryServer 原嵌套 git,并入顶层统一管理
69 lines
1.5 KiB
Java
69 lines
1.5 KiB
Java
/*******************************************************************************
|
|
* Copyright (c) 2005, 2014 springside.github.io
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
*******************************************************************************/
|
|
package javautils.redis.pool;
|
|
|
|
import redis.clients.jedis.Protocol;
|
|
|
|
/**
|
|
* All information for redis connection.
|
|
*/
|
|
public class ConnectionInfo {
|
|
|
|
public static final String DEFAULT_PASSWORD = null;
|
|
|
|
private int database = Protocol.DEFAULT_DATABASE;
|
|
private String password = DEFAULT_PASSWORD;
|
|
private int timeout = Protocol.DEFAULT_TIMEOUT;
|
|
|
|
public ConnectionInfo() {
|
|
}
|
|
|
|
public ConnectionInfo(int database, String password, int timeout) {
|
|
this.timeout = timeout;
|
|
if (password != null && password.length() > 0) {
|
|
this.password = password;
|
|
}
|
|
else {
|
|
this.password = DEFAULT_PASSWORD;
|
|
}
|
|
this.database = database;
|
|
}
|
|
|
|
public int getDatabase() {
|
|
return database;
|
|
}
|
|
|
|
public void setDatabase(int database) {
|
|
this.database = database;
|
|
}
|
|
|
|
public String getPassword() {
|
|
return password;
|
|
}
|
|
|
|
public void setPassword(String password) {
|
|
if (password != null && password.length() > 0) {
|
|
this.password = password;
|
|
}
|
|
else {
|
|
this.password = DEFAULT_PASSWORD;
|
|
}
|
|
}
|
|
|
|
public int getTimeout() {
|
|
return timeout;
|
|
}
|
|
|
|
public void setTimeout(int timeout) {
|
|
this.timeout = timeout;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "ConnectionInfo [database=" + database + ", password=" + password + ", timeout=" + timeout + "]";
|
|
}
|
|
}
|