package org.dasein.cloud.network;

/**
 * User: mgulimonov
 * Date: 20.06.2014
 */
public class LbAttributesOptions {

    boolean crossDataCenter;
    boolean connectionDraining;
    int connectionDrainingTimeout;
    int idleConnectionTimeout;

    public static LbAttributesOptions getInstance( boolean crossDataCenter, boolean connectionDraining, int connectionDrainingTimeout, int idleConnectionTimeout ) {
        LbAttributesOptions options = new LbAttributesOptions();
        options.crossDataCenter = crossDataCenter;
        options.connectionDraining = connectionDraining;
        options.connectionDrainingTimeout = connectionDrainingTimeout;
        options.idleConnectionTimeout = idleConnectionTimeout;
        return options;
    }

    public boolean isCrossDataCenter() {
        return crossDataCenter;
    }

    public boolean isConnectionDraining() {
        return connectionDraining;
    }

    public int getConnectionDrainingTimeout() {
        return connectionDrainingTimeout;
    }

    public int getIdleConnectionTimeout() {
        return idleConnectionTimeout;
    }
}

@@ -28,16 +28,50 @@
 twork;%0A%0A
+import javax.annotation.Nonnull;%0A%0A
 /**%0A * U
@@ -150,32 +150,175 @@
  %7B%0A%0A    boolean 
+modifyCrossDataCenter = false;%0A    boolean modifyConnectionDraining = false;%0A    boolean modifyConnectionTimeout = false;%0A%0A    private boolean 
 crossDataCenter;
@@ -318,24 +318,32 @@
 Center;%0A    
+private 
 boolean conn
@@ -358,24 +358,32 @@
 aining;%0A    
+private 
 int connecti
@@ -405,16 +405,24 @@
 ut;%0A    
+private 
 int idle
@@ -441,16 +441,59 @@
 meout;%0A%0A
+    private LbAttributesOptions() %7B%0A    %7D%0A%0A
     publ
@@ -657,16 +657,27 @@
         
+return new 
 LbAttrib
@@ -691,18 +691,341 @@
 ions
- options =
+()%0A                .withCrossDataCenter(crossDataCenter)%0A                .withConnectionDraining(connectionDraining)%0A                .withConnectionDrainingTimeout(connectionDrainingTimeout)%0A                .withIdleConnectionTimeout(idleConnectionTimeout);%0A    %7D%0A%0A    public static LbAttributesOptions getInstance() %7B%0A        return
  new
@@ -1056,39 +1056,80 @@
     
+%7D%0A%0A
     
-options.crossDataCenter = c
+public boolean isModifyCrossDataCenter() %7B%0A        return modifyC
 ross
@@ -1148,42 +1148,83 @@
     
+%7D%0A%0A
     
-options.connectionDraining = c
+public boolean isModifyConnectionDraining() %7B%0A        return modifyC
 onne
@@ -1246,116 +1246,389 @@
     
+%7D%0A%0A
     
-options.connectionDrainingTimeout = connectionDrainingTimeout
+public boolean isModifyConnectionTimeout() %7B%0A        return modifyConnectionTimeout;%0A    %7D%0A%0A    public boolean isCrossDataCenter() %7B%0A        return crossDataCenter;%0A    %7D%0A%0A    public boolean isConnectionDraining() %7B%0A        return connectionDraining
 ;%0A    
+%7D%0A%0A
     
-options.idleConnectionTimeout = i
+public int getConnectionDrainingTimeout() %7B%0A        return connectionDrainingTimeout;%0A    %7D%0A%0A    public int getI
 dleC
@@ -1639,25 +1639,28 @@
 ctionTimeout
-;
+() %7B
 %0A        ret
@@ -1667,350 +1667,1061 @@
 urn 
-options;%0A    %7D%0A%0A    public boolean isCrossDataCenter() %7B%0A        return crossDataCenter;%0A    %7D%0A%0A    public boolean isConnectionDraining() %7B%0A        return connectionDraining;%0A    %7D%0A%0A    public int getConnectionDrainingTimeout() %7B%0A        return connectionDrainingTimeout;%0A    %7D%0A%0A    public int getIdleConnectionTimeout() %7B%0A        return idle
+idleConnectionTimeout;%0A    %7D%0A%0A    public @Nonnull LbAttributesOptions withCrossDataCenter( boolean crossDataCenter ) %7B%0A        this.crossDataCenter = crossDataCenter;%0A        this.modifyCrossDataCenter = true;%0A        return this;%0A    %7D%0A%0A    public @Nonnull LbAttributesOptions withConnectionDraining( boolean connectionDraining ) %7B%0A        this.connectionDraining = connectionDraining;%0A        this.modifyConnectionDraining = true;%0A        return this;%0A    %7D%0A%0A    public @Nonnull LbAttributesOptions withConnectionDrainingTimeout( int connectionDrainingTimeout ) %7B%0A        this.connectionDrainingTimeout = connectionDrainingTimeout;%0A        this.modifyConnectionDraining = true;%0A        return this;%0A    %7D%0A%0A    public @Nonnull LbAttributesOptions withIdleConnectionTimeout( int idleConnectionTimeout ) %7B%0A        this.idleConnectionTimeout = idleConnectionTimeout;%0A        this.modifyConnectionTimeout = true;%0A        return this;%0A    %7D%0A%0A    public boolean isEmptyOptions() %7B%0A        return !modifyCrossDataCenter && !modifyConnectionDraining && !modify
 Conn

fix LbAttributesOptions (#1298)