/*
 * Copyright 2016 leon chen
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.moilioncircle.redis.replicator;

/**
 * @author leon.chen
 * @since 2016/8/15
 */
public class Configuration {

    /**
     * factory
     * @return Configuration
     */
    public static Configuration defaultSetting() {
        return new Configuration();
    }

    /**
     * socket connection timeout
     */
    private int connectionTimeout = 30000;

    /**
     * socket input stream read timeout
     */
    private int readTimeout = 30000;

    /**
     * socket receive buffer size
     */
    private int receiveBufferSize = 0;

    /**
     * socket send buffer size
     */
    private int sendBufferSize = 0;

    /**
     * if readTimeout <=0 this property inefficiency.
     * socket input stream read retries
     */
    private int retries = 5;

    /**
     * auth password
     */
    private String authPassword = null;

    public int getConnectionTimeout() {
        return connectionTimeout;
    }

    public void setConnectionTimeout(int connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

    public int getReadTimeout() {
        return readTimeout;
    }

    public void setReadTimeout(int readTimeout) {
        this.readTimeout = readTimeout;
    }

    public int getRetries() {
        return retries;
    }

    public void setRetries(int retries) {
        this.retries = retries;
    }

    public String getAuthPassword() {
        return authPassword;
    }

    public void setAuthPassword(String authPassword) {
        this.authPassword = authPassword;
    }

    public int getReceiveBufferSize() {
        return receiveBufferSize;
    }

    public void setReceiveBufferSize(int receiveBufferSize) {
        this.receiveBufferSize = receiveBufferSize;
    }

    public int getSendBufferSize() {
        return sendBufferSize;
    }

    public void setSendBufferSize(int sendBufferSize) {
        this.sendBufferSize = sendBufferSize;
    }
}

@@ -1532,28 +1532,37 @@
 %0A    public 
-void
+Configuration
  setConnecti
@@ -1640,32 +1640,53 @@
 nectionTimeout;%0A
+        return this;%0A
     %7D%0A%0A    publi
@@ -1752,28 +1752,37 @@
 %0A    public 
-void
+Configuration
  setReadTime
@@ -1836,32 +1836,53 @@
  = readTimeout;%0A
+        return this;%0A
     %7D%0A%0A    publi
@@ -1940,28 +1940,37 @@
 %0A    public 
-void
+Configuration
  setRetries(
@@ -2008,32 +2008,53 @@
 ries = retries;%0A
+        return this;%0A
     %7D%0A%0A    publi
@@ -2125,28 +2125,37 @@
 %0A    public 
-void
+Configuration
  setAuthPass
@@ -2216,32 +2216,53 @@
 = authPassword;%0A
+        return this;%0A
     %7D%0A%0A    publi
@@ -2340,28 +2340,37 @@
 %0A    public 
-void
+Configuration
  setReceiveB
@@ -2448,32 +2448,53 @@
 eiveBufferSize;%0A
+        return this;%0A
     %7D%0A%0A    publi
@@ -2574,12 +2574,21 @@
 lic 
-void
+Configuration
  set
@@ -2666,20 +2666,41 @@
 BufferSize;%0A
+        return this;%0A
     %7D%0A%7D%0A

Update Configuration.java