You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2014/05/08 00:45:32 UTC

git commit: updated refs/heads/4.4-forward to 515fa26

Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward 5949e3357 -> 515fa261b


CLOUDSTACK-6596: UUID and display flag update support for LBStickinessPolicy and LBHealthCheckPolicy


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/515fa261
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/515fa261
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/515fa261

Branch: refs/heads/4.4-forward
Commit: 515fa261ba13d825864eb2d93ed33bb0d8c88328
Parents: 5949e33
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Wed May 7 15:16:47 2014 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed May 7 15:38:17 2014 -0700

----------------------------------------------------------------------
 api/src/com/cloud/event/EventTypes.java         |   2 +
 .../network/lb/LoadBalancingRulesService.java   |   4 +
 .../cloud/network/rules/HealthCheckPolicy.java  |   5 +
 .../cloud/network/rules/StickinessPolicy.java   |   5 +
 .../CreateLBHealthCheckPolicyCmd.java           |  12 ++-
 .../CreateLBStickinessPolicyCmd.java            |  12 ++-
 .../ListLBHealthCheckPoliciesCmd.java           |  14 ++-
 .../ListLBStickinessPoliciesCmd.java            |  14 ++-
 .../UpdateLBHealthCheckPolicyCmd.java           | 100 +++++++++++++++++++
 .../UpdateLBStickinessPolicyCmd.java            |  99 ++++++++++++++++++
 .../response/LBHealthCheckPolicyResponse.java   |  14 ++-
 .../response/LBStickinessPolicyResponse.java    |  11 ++
 client/tomcatconf/commands.properties.in        |   2 +
 .../cloud/network/LBHealthCheckPolicyVO.java    |  12 +++
 .../network/dao/LBHealthCheckPolicyDao.java     |   2 +-
 .../network/dao/LBHealthCheckPolicyDaoImpl.java |   5 +-
 .../network/dao/LBStickinessPolicyDao.java      |   2 +-
 .../network/dao/LBStickinessPolicyDaoImpl.java  |   3 +-
 .../cloud/network/dao/LBStickinessPolicyVO.java |  12 +++
 .../lb/LoadBalancingRulesManagerImpl.java       |  83 +++++++++++++--
 .../com/cloud/server/ManagementServerImpl.java  |  10 +-
 setup/db/db/schema-430to440.sql                 |  17 ++--
 22 files changed, 408 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/api/src/com/cloud/event/EventTypes.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/event/EventTypes.java b/api/src/com/cloud/event/EventTypes.java
index 075b1c8..d9aa3f4 100755
--- a/api/src/com/cloud/event/EventTypes.java
+++ b/api/src/com/cloud/event/EventTypes.java
@@ -134,9 +134,11 @@ public class EventTypes {
     public static final String EVENT_LOAD_BALANCER_CREATE = "LB.CREATE";
     public static final String EVENT_LOAD_BALANCER_DELETE = "LB.DELETE";
     public static final String EVENT_LB_STICKINESSPOLICY_CREATE = "LB.STICKINESSPOLICY.CREATE";
+    public static final String EVENT_LB_STICKINESSPOLICY_UPDATE = "LB.STICKINESSPOLICY.UPDATE";
     public static final String EVENT_LB_STICKINESSPOLICY_DELETE = "LB.STICKINESSPOLICY.DELETE";
     public static final String EVENT_LB_HEALTHCHECKPOLICY_CREATE = "LB.HEALTHCHECKPOLICY.CREATE";
     public static final String EVENT_LB_HEALTHCHECKPOLICY_DELETE = "LB.HEALTHCHECKPOLICY.DELETE";
+    public static final String EVENT_LB_HEALTHCHECKPOLICY_UPDATE = "LB.HEALTHCHECKPOLICY.UPDATE";
     public static final String EVENT_LOAD_BALANCER_UPDATE = "LB.UPDATE";
     public static final String EVENT_LB_CERT_UPLOAD = "LB.CERT.UPLOAD";
     public static final String EVENT_LB_CERT_DELETE = "LB.CERT.DELETE";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/api/src/com/cloud/network/lb/LoadBalancingRulesService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java
index 98d29c5..c497633 100644
--- a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java
+++ b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java
@@ -155,4 +155,8 @@ public interface LoadBalancingRulesService {
     boolean isLbRuleMappedToVmGuestIp(String vmSecondaryIp);
 
     List<String> listLbVmIpAddress(long id, long vmId);
+
+    StickinessPolicy updateLBStickinessPolicy(long id, String customId, Boolean forDisplay);
+
+    HealthCheckPolicy updateLBHealthCheckPolicy(long id, String customId, Boolean forDisplay);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/api/src/com/cloud/network/rules/HealthCheckPolicy.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/rules/HealthCheckPolicy.java b/api/src/com/cloud/network/rules/HealthCheckPolicy.java
index 6157bd4..2b1b68b 100644
--- a/api/src/com/cloud/network/rules/HealthCheckPolicy.java
+++ b/api/src/com/cloud/network/rules/HealthCheckPolicy.java
@@ -39,4 +39,9 @@ public interface HealthCheckPolicy extends InternalIdentity, Identity {
 
     public boolean isRevoke();
 
+    /**
+     * @return
+     */
+    boolean isDisplay();
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/api/src/com/cloud/network/rules/StickinessPolicy.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/rules/StickinessPolicy.java b/api/src/com/cloud/network/rules/StickinessPolicy.java
index da48754..c770071 100644
--- a/api/src/com/cloud/network/rules/StickinessPolicy.java
+++ b/api/src/com/cloud/network/rules/StickinessPolicy.java
@@ -39,4 +39,9 @@ public interface StickinessPolicy extends InternalIdentity, Identity {
 
     public List<Pair<String, String>> getParams(); /* get params in Map <string,String> format */
 
+    /**
+     * @return
+     */
+    boolean isDisplay();
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java
index 547274d..b487226 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java
@@ -16,8 +16,7 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.loadbalancer;
 
-import org.apache.log4j.Logger;
-
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,6 +26,7 @@ import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.api.response.LBHealthCheckResponse;
 import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -89,10 +89,18 @@ public class CreateLBHealthCheckPolicyCmd extends BaseAsyncCreateCmd {
                description = "Number of consecutive health check failures before declaring an instance unhealthy")
     private int unhealthyThreshold;
 
+    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the rule to the end user or not", since = "4.4", authorized = {RoleType.Admin})
+    private Boolean display;
+
+
     // ///////////////////////////////////////////////////
     // ///////////////// Accessors ///////////////////////
     // ///////////////////////////////////////////////////
 
+    public Boolean getDisplay() {
+        return display;
+    }
+
     public Long getLbRuleId() {
         return lbRuleId;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
index 738f837..5ea5717 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
@@ -18,8 +18,7 @@ package org.apache.cloudstack.api.command.user.loadbalancer;
 
 import java.util.Map;
 
-import org.apache.log4j.Logger;
-
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -30,6 +29,7 @@ import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.api.response.LBStickinessResponse;
 import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -74,10 +74,18 @@ public class CreateLBStickinessPolicyCmd extends BaseAsyncCreateCmd {
     @Parameter(name = ApiConstants.PARAM_LIST, type = CommandType.MAP, description = "param list. Example: param[0].name=cookiename&param[0].value=LBCookie ")
     private Map paramList;
 
+    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the rule to the end user or not", since = "4.4", authorized = {RoleType.Admin})
+    private Boolean display;
+
+
     // ///////////////////////////////////////////////////
     // ///////////////// Accessors ///////////////////////
     // ///////////////////////////////////////////////////
 
+    public Boolean getDisplay() {
+        return display;
+    }
+
     public Long getLbRuleId() {
         return lbRuleId;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java
index 5f4ca09..7f78da64 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java
@@ -19,8 +19,7 @@ package org.apache.cloudstack.api.command.user.loadbalancer;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
-
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseListCmd;
@@ -28,6 +27,7 @@ import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.api.response.LBHealthCheckResponse;
 import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.log4j.Logger;
 
 import com.cloud.network.rules.HealthCheckPolicy;
 import com.cloud.network.rules.LoadBalancer;
@@ -49,6 +49,9 @@ public class ListLBHealthCheckPoliciesCmd extends BaseListCmd {
                description = "the ID of the load balancer rule")
     private Long lbRuleId;
 
+    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "list resources by display flag; only ROOT admin is eligible to pass this parameter", since = "4.4", authorized = {RoleType.Admin})
+    private Boolean display;
+
     // ///////////////////////////////////////////////////
     // ///////////////// Accessors ///////////////////////
     // ///////////////////////////////////////////////////
@@ -56,6 +59,13 @@ public class ListLBHealthCheckPoliciesCmd extends BaseListCmd {
         return lbRuleId;
     }
 
+    public boolean getDisplay() {
+        if (display != null) {
+            return display;
+        }
+        return true;
+    }
+
     // ///////////////////////////////////////////////////
     // ///////////// API Implementation///////////////////
     // ///////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java
index 1ceb214..dd03191 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java
@@ -19,8 +19,7 @@ package org.apache.cloudstack.api.command.user.loadbalancer;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
-
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseListCmd;
@@ -29,6 +28,7 @@ import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.api.response.LBStickinessResponse;
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
 
 import com.cloud.network.rules.LoadBalancer;
 import com.cloud.network.rules.StickinessPolicy;
@@ -51,6 +51,9 @@ public class ListLBStickinessPoliciesCmd extends BaseListCmd {
                description = "the ID of the load balancer rule")
     private Long lbRuleId;
 
+    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "list resources by display flag; only ROOT admin is eligible to pass this parameter", since = "4.4", authorized = {RoleType.Admin})
+    private Boolean display;
+
     // ///////////////////////////////////////////////////
     // ///////////////// Accessors ///////////////////////
     // ///////////////////////////////////////////////////
@@ -58,6 +61,13 @@ public class ListLBStickinessPoliciesCmd extends BaseListCmd {
         return lbRuleId;
     }
 
+    public boolean getDisplay() {
+        if (display != null) {
+            return display;
+        }
+        return true;
+    }
+
     // ///////////////////////////////////////////////////
     // ///////////// API Implementation///////////////////
     // ///////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBHealthCheckPolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBHealthCheckPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBHealthCheckPolicyCmd.java
new file mode 100644
index 0000000..0b0c34f
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBHealthCheckPolicyCmd.java
@@ -0,0 +1,100 @@
+// Copyright 2012 Citrix Systems, Inc. Licensed under the
+// Apache License, Version 2.0 (the "License"); you may not use this
+// file except in compliance with the License.  Citrix Systems, Inc.
+// reserves all rights not expressly granted by 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.
+//
+// Automatically generated by addcopyright.py at 04/03/2012
+package org.apache.cloudstack.api.command.user.loadbalancer;
+
+import org.apache.cloudstack.acl.RoleType;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseAsyncCustomIdCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.LBHealthCheckResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+import com.cloud.event.EventTypes;
+import com.cloud.network.rules.HealthCheckPolicy;
+import com.cloud.network.rules.LoadBalancer;
+import com.cloud.network.rules.StickinessPolicy;
+import com.cloud.user.Account;
+
+@APICommand(name = "updateLBHealthCheckPolicy", description = "Updates LB HealthCheck policy", responseObject = LBHealthCheckResponse.class, since = "4.4",
+requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
+public class UpdateLBHealthCheckPolicyCmd extends BaseAsyncCustomIdCmd{
+    public static final Logger s_logger = Logger.getLogger(UpdateLBHealthCheckPolicyCmd.class.getName());
+
+    private static final String s_name = "updatelbhealthcheckpolicyresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+    @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = LBHealthCheckResponse.class, required = true, description = "id of lb healthcheck policy")
+    private Long id;
+
+    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the policy to the end user or not", since = "4.4", authorized = {RoleType.Admin})
+    private Boolean display;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+    public Long getId() {
+        return id;
+    }
+
+    public Boolean getDisplay() {
+        return display;
+    }
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        Account account = CallContext.current().getCallingAccount();
+        if (account != null) {
+            return account.getId();
+        }
+
+        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
+    }
+
+    @Override
+    public String getEventDescription() {
+        return "Update LB healthcheck policy id= " + id;
+    }
+
+    @Override
+    public String getEventType() {
+        return EventTypes.EVENT_LB_HEALTHCHECKPOLICY_UPDATE;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+    @Override
+    public void execute() {
+        HealthCheckPolicy policy = _lbService.updateLBHealthCheckPolicy(this.getId(), this.getCustomId(), this.getDisplay());
+        LoadBalancer lb = _lbService.findById(policy.getLoadBalancerId());
+        LBHealthCheckResponse hcResponse = _responseGenerator.createLBHealthCheckPolicyResponse(policy, lb);
+        setResponseObject(hcResponse);
+        hcResponse.setResponseName(getCommandName());
+    }
+
+    @Override
+    public void checkUuid() {
+        if (this.getCustomId() != null) {
+            _uuidMgr.checkUuid(this.getCustomId(), StickinessPolicy.class);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBStickinessPolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBStickinessPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBStickinessPolicyCmd.java
new file mode 100644
index 0000000..c652945
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBStickinessPolicyCmd.java
@@ -0,0 +1,99 @@
+// Copyright 2012 Citrix Systems, Inc. Licensed under the
+// Apache License, Version 2.0 (the "License"); you may not use this
+// file except in compliance with the License.  Citrix Systems, Inc.
+// reserves all rights not expressly granted by 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.
+//
+// Automatically generated by addcopyright.py at 04/03/2012
+package org.apache.cloudstack.api.command.user.loadbalancer;
+
+import org.apache.cloudstack.acl.RoleType;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseAsyncCustomIdCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.LBStickinessResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+import com.cloud.event.EventTypes;
+import com.cloud.network.rules.LoadBalancer;
+import com.cloud.network.rules.StickinessPolicy;
+import com.cloud.user.Account;
+
+@APICommand(name = "updateLBStickinessPolicy", description = "Updates LB Stickiness policy", responseObject = LBStickinessResponse.class, since = "4.4",
+requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
+public class UpdateLBStickinessPolicyCmd extends BaseAsyncCustomIdCmd{
+    public static final Logger s_logger = Logger.getLogger(UpdateLBStickinessPolicyCmd.class.getName());
+
+    private static final String s_name = "updatelbstickinesspolicyresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+    @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = LBStickinessResponse.class, required = true, description = "id of lb stickiness policy")
+    private Long id;
+
+    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the policy to the end user or not", since = "4.4", authorized = {RoleType.Admin})
+    private Boolean display;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+    public Long getId() {
+        return id;
+    }
+
+    public Boolean getDisplay() {
+        return display;
+    }
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        Account account = CallContext.current().getCallingAccount();
+        if (account != null) {
+            return account.getId();
+        }
+
+        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
+    }
+
+    @Override
+    public String getEventDescription() {
+        return "Update LB stickiness policy id= " + id;
+    }
+
+    @Override
+    public String getEventType() {
+        return EventTypes.EVENT_LB_STICKINESSPOLICY_UPDATE;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+    @Override
+    public void execute() {
+        StickinessPolicy policy = _lbService.updateLBStickinessPolicy(this.getId(), this.getCustomId(), this.getDisplay());
+        LoadBalancer lb = _lbService.findById(policy.getLoadBalancerId());
+        LBStickinessResponse spResponse = _responseGenerator.createLBStickinessPolicyResponse(policy, lb);
+        setResponseObject(spResponse);
+        spResponse.setResponseName(getCommandName());
+    }
+
+    @Override
+    public void checkUuid() {
+        if (this.getCustomId() != null) {
+            _uuidMgr.checkUuid(this.getCustomId(), StickinessPolicy.class);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/api/src/org/apache/cloudstack/api/response/LBHealthCheckPolicyResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/LBHealthCheckPolicyResponse.java b/api/src/org/apache/cloudstack/api/response/LBHealthCheckPolicyResponse.java
index 406a8da..8ce7b3d 100644
--- a/api/src/org/apache/cloudstack/api/response/LBHealthCheckPolicyResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/LBHealthCheckPolicyResponse.java
@@ -16,12 +16,13 @@
 // under the License.
 package org.apache.cloudstack.api.response;
 
-import com.google.gson.annotations.SerializedName;
-
+import org.apache.cloudstack.acl.RoleType;
+import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 
 import com.cloud.network.rules.HealthCheckPolicy;
 import com.cloud.serializer.Param;
+import com.google.gson.annotations.SerializedName;
 
 public class LBHealthCheckPolicyResponse extends BaseResponse {
     @SerializedName("id")
@@ -56,6 +57,10 @@ public class LBHealthCheckPolicyResponse extends BaseResponse {
     @Param(description = "Number of consecutive health check failures before declaring an instance unhealthy.")
     private int unhealthcheckthresshold;
 
+    @SerializedName(ApiConstants.FOR_DISPLAY)
+    @Param(description = "is policy for display to the regular user", since = "4.4", authorized = {RoleType.Admin})
+    private Boolean forDisplay;
+
     public void setId(String id) {
         this.id = id;
     }
@@ -95,6 +100,11 @@ public class LBHealthCheckPolicyResponse extends BaseResponse {
         this.responseTime = healthcheckpolicy.getResponseTime();
         this.healthcheckthresshold = healthcheckpolicy.getHealthcheckThresshold();
         this.unhealthcheckthresshold = healthcheckpolicy.getUnhealthThresshold();
+        this.forDisplay = healthcheckpolicy.isDisplay();
         setObjectName("healthcheckpolicy");
     }
+
+    public void setForDisplay(Boolean forDisplay) {
+        this.forDisplay = forDisplay;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/api/src/org/apache/cloudstack/api/response/LBStickinessPolicyResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/LBStickinessPolicyResponse.java b/api/src/org/apache/cloudstack/api/response/LBStickinessPolicyResponse.java
index 76c54cd..8fa8849 100644
--- a/api/src/org/apache/cloudstack/api/response/LBStickinessPolicyResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/LBStickinessPolicyResponse.java
@@ -22,6 +22,8 @@ import java.util.Map;
 
 import com.google.gson.annotations.SerializedName;
 
+import org.apache.cloudstack.acl.RoleType;
+import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 
 import com.cloud.network.rules.StickinessPolicy;
@@ -49,6 +51,10 @@ public class LBStickinessPolicyResponse extends BaseResponse {
     @Param(description = "the state of the policy")
     private String state;
 
+    @SerializedName(ApiConstants.FOR_DISPLAY)
+    @Param(description = "is policy for display to the regular user", since = "4.4", authorized = {RoleType.Admin})
+    private Boolean forDisplay;
+
     // FIXME : if prams with the same name exists more then once then value are concatinated with ":" as delimitor .
     // Reason: Map does not support duplicate keys, need to look for the alernate data structure
     // Example: <params>{indirect=null, name=testcookie, nocache=null, domain=www.yahoo.com:www.google.com, postonly=null}</params>
@@ -98,6 +104,7 @@ public class LBStickinessPolicyResponse extends BaseResponse {
         List<Pair<String, String>> paramsList = stickinesspolicy.getParams();
         this.methodName = stickinesspolicy.getMethodName();
         this.description = stickinesspolicy.getDescription();
+        this.forDisplay = stickinesspolicy.isDisplay();
         if (stickinesspolicy.isRevoke()) {
             this.setState("Revoked");
         }
@@ -126,4 +133,8 @@ public class LBStickinessPolicyResponse extends BaseResponse {
         this.params = tempParamList;
         setObjectName("stickinesspolicy");
     }
+
+    public void setForDisplay(Boolean forDisplay) {
+        this.forDisplay = forDisplay;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index d3a24f6..d151724 100644
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -167,11 +167,13 @@ deleteLoadBalancerRule=15
 removeFromLoadBalancerRule=15
 assignToLoadBalancerRule=15
 createLBStickinessPolicy=15
+updateLBStickinessPolicy=15
 deleteLBStickinessPolicy=15
 listLoadBalancerRules=15
 listLBStickinessPolicies=15
 listLBHealthCheckPolicies=15
 createLBHealthCheckPolicy=15
+updateLBHealthCheckPolicy=15
 deleteLBHealthCheckPolicy=15
 listLoadBalancerRuleInstances=15
 updateLoadBalancerRule=15

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/engine/schema/src/com/cloud/network/LBHealthCheckPolicyVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/LBHealthCheckPolicyVO.java b/engine/schema/src/com/cloud/network/LBHealthCheckPolicyVO.java
index f1e8fe8..72dbf5c 100644
--- a/engine/schema/src/com/cloud/network/LBHealthCheckPolicyVO.java
+++ b/engine/schema/src/com/cloud/network/LBHealthCheckPolicyVO.java
@@ -64,6 +64,9 @@ public class LBHealthCheckPolicyVO implements HealthCheckPolicy {
     @Column(name = "revoke")
     private boolean revoke = false;
 
+    @Column(name = "display", updatable = true, nullable = false)
+    protected boolean display = true;
+
     protected LBHealthCheckPolicyVO() {
         this.uuid = UUID.randomUUID().toString();
     }
@@ -157,4 +160,13 @@ public class LBHealthCheckPolicyVO implements HealthCheckPolicy {
     public void setUuid(String uuid) {
         this.uuid = uuid;
     }
+
+    public void setDisplay(boolean display) {
+        this.display = display;
+    }
+
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/engine/schema/src/com/cloud/network/dao/LBHealthCheckPolicyDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/LBHealthCheckPolicyDao.java b/engine/schema/src/com/cloud/network/dao/LBHealthCheckPolicyDao.java
index 67a347d..eed97d6 100644
--- a/engine/schema/src/com/cloud/network/dao/LBHealthCheckPolicyDao.java
+++ b/engine/schema/src/com/cloud/network/dao/LBHealthCheckPolicyDao.java
@@ -26,7 +26,7 @@ public interface LBHealthCheckPolicyDao extends GenericDao<LBHealthCheckPolicyVO
 
     void remove(long loadBalancerId, Boolean pending);
 
-    List<LBHealthCheckPolicyVO> listByLoadBalancerId(long loadBalancerId);
+    List<LBHealthCheckPolicyVO> listByLoadBalancerIdAndDisplayFlag(long loadBalancerId, Boolean forDisplay);
 
     List<LBHealthCheckPolicyVO> listByLoadBalancerId(long loadBalancerId, boolean revoke);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/engine/schema/src/com/cloud/network/dao/LBHealthCheckPolicyDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/LBHealthCheckPolicyDaoImpl.java b/engine/schema/src/com/cloud/network/dao/LBHealthCheckPolicyDaoImpl.java
index ddebd36..52c1d0e 100644
--- a/engine/schema/src/com/cloud/network/dao/LBHealthCheckPolicyDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/LBHealthCheckPolicyDaoImpl.java
@@ -48,9 +48,12 @@ public class LBHealthCheckPolicyDaoImpl extends GenericDaoBase<LBHealthCheckPoli
     }
 
     @Override
-    public List<LBHealthCheckPolicyVO> listByLoadBalancerId(long loadBalancerId) {
+    public List<LBHealthCheckPolicyVO> listByLoadBalancerIdAndDisplayFlag(long loadBalancerId, Boolean forDisplay) {
         SearchCriteria<LBHealthCheckPolicyVO> sc = createSearchCriteria();
         sc.addAnd("loadBalancerId", SearchCriteria.Op.EQ, loadBalancerId);
+        if (forDisplay != null) {
+            sc.addAnd("display", SearchCriteria.Op.EQ, forDisplay);
+        }
 
         return listBy(sc);
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyDao.java b/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyDao.java
index 82e68d6..6669d70 100644
--- a/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyDao.java
+++ b/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyDao.java
@@ -25,7 +25,7 @@ public interface LBStickinessPolicyDao extends GenericDao<LBStickinessPolicyVO,
 
     void remove(long loadBalancerId, Boolean pending);
 
-    List<LBStickinessPolicyVO> listByLoadBalancerId(long loadBalancerId);
+    List<LBStickinessPolicyVO> listByLoadBalancerIdAndDisplayFlag(long loadBalancerId, boolean forDisplay);
 
     List<LBStickinessPolicyVO> listByLoadBalancerId(long loadBalancerId, boolean revoke);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyDaoImpl.java b/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyDaoImpl.java
index fdce8c7..e8295c5 100644
--- a/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyDaoImpl.java
@@ -47,9 +47,10 @@ public class LBStickinessPolicyDaoImpl extends GenericDaoBase<LBStickinessPolicy
     }
 
     @Override
-    public List<LBStickinessPolicyVO> listByLoadBalancerId(long loadBalancerId) {
+    public List<LBStickinessPolicyVO> listByLoadBalancerIdAndDisplayFlag(long loadBalancerId, boolean forDisplay) {
         SearchCriteria<LBStickinessPolicyVO> sc = createSearchCriteria();
         sc.addAnd("loadBalancerId", SearchCriteria.Op.EQ, loadBalancerId);
+        sc.addAnd("display", SearchCriteria.Op.EQ, forDisplay);
 
         return listBy(sc);
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyVO.java b/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyVO.java
index 6e8dfbb..9628a32 100644
--- a/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyVO.java
+++ b/engine/schema/src/com/cloud/network/dao/LBStickinessPolicyVO.java
@@ -64,6 +64,9 @@ public class LBStickinessPolicyVO implements StickinessPolicy {
     @Column(name = "revoke")
     private boolean revoke = false;
 
+    @Column(name = "display", updatable = true, nullable = false)
+    protected boolean display = true;
+
     protected LBStickinessPolicyVO() {
         this.uuid = UUID.randomUUID().toString();
     }
@@ -150,4 +153,13 @@ public class LBStickinessPolicyVO implements StickinessPolicy {
     public void setUuid(String uuid) {
         this.uuid = uuid;
     }
+
+    public void setDisplay(boolean display) {
+        this.display = display;
+    }
+
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
index a7761c4..b932e14 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -30,11 +30,6 @@ import java.util.Set;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBHealthCheckPolicyCmd;
 import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBStickinessPolicyCmd;
@@ -50,6 +45,7 @@ import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationSe
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.lb.ApplicationLoadBalancerRuleVO;
 import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.api.to.LoadBalancerTO;
 import com.cloud.configuration.ConfigurationManager;
@@ -169,6 +165,8 @@ import com.cloud.vm.VirtualMachine.State;
 import com.cloud.vm.dao.NicDao;
 import com.cloud.vm.dao.NicSecondaryIpDao;
 import com.cloud.vm.dao.UserVmDao;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
 
 @Local(value = {LoadBalancingRulesManager.class, LoadBalancingRulesService.class})
 public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements LoadBalancingRulesManager, LoadBalancingRulesService {
@@ -557,6 +555,10 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
         /* Finally Insert into DB */
         LBStickinessPolicyVO policy =
             new LBStickinessPolicyVO(loadBalancer.getId(), cmd.getLBStickinessPolicyName(), cmd.getStickinessMethodName(), cmd.getparamList(), cmd.getDescription());
+        Boolean forDisplay = cmd.getDisplay();
+        if (forDisplay != null) {
+            policy.setDisplay(forDisplay);
+        }
         policy = _lb2stickinesspoliciesDao.persist(policy);
 
         return policy;
@@ -621,6 +623,11 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
             new LBHealthCheckPolicyVO(loadBalancer.getId(), cmd.getPingPath(), cmd.getDescription(), cmd.getResponsTimeOut(), cmd.getHealthCheckInterval(),
                 cmd.getHealthyThreshold(), cmd.getUnhealthyThreshold());
 
+        Boolean forDisplay = cmd.getDisplay();
+        if (forDisplay != null) {
+            policy.setDisplay(forDisplay);
+        }
+
         policy = _lb2healthcheckDao.persist(policy);
         return policy;
     }
@@ -1494,7 +1501,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
                     }
                 }
 
-                List<LBHealthCheckPolicyVO> hcPolicies = _lb2healthcheckDao.listByLoadBalancerId(loadBalancerId);
+                List<LBHealthCheckPolicyVO> hcPolicies = _lb2healthcheckDao.listByLoadBalancerIdAndDisplayFlag(loadBalancerId, null);
                 for (LBHealthCheckPolicyVO lbHealthCheck : hcPolicies) {
                     lbHealthCheck.setRevoke(true);
                     _lb2healthcheckDao.persist(lbHealthCheck);
@@ -2006,7 +2013,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
     @Override
     public List<LbHealthCheckPolicy> getHealthCheckPolicies(long lbId) {
         List<LbHealthCheckPolicy> healthCheckPolicies = new ArrayList<LbHealthCheckPolicy>();
-        List<LBHealthCheckPolicyVO> hcDbpolicies = _lb2healthcheckDao.listByLoadBalancerId(lbId);
+        List<LBHealthCheckPolicyVO> hcDbpolicies = _lb2healthcheckDao.listByLoadBalancerIdAndDisplayFlag(lbId, null);
 
         for (LBHealthCheckPolicyVO policy : hcDbpolicies) {
             String pingpath = policy.getpingpath();
@@ -2204,6 +2211,8 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
     public List<LBStickinessPolicyVO> searchForLBStickinessPolicies(ListLBStickinessPoliciesCmd cmd) throws PermissionDeniedException {
         Account caller = CallContext.current().getCallingAccount();
         Long loadBalancerId = cmd.getLbRuleId();
+        boolean forDisplay = cmd.getDisplay();
+
         LoadBalancerVO loadBalancer = _lbDao.findById(loadBalancerId);
         if (loadBalancer == null) {
             return null;
@@ -2211,7 +2220,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
 
         _accountMgr.checkAccess(caller, null, loadBalancer);
 
-        List<LBStickinessPolicyVO> sDbpolicies = _lb2stickinesspoliciesDao.listByLoadBalancerId(cmd.getLbRuleId());
+        List<LBStickinessPolicyVO> sDbpolicies = _lb2stickinesspoliciesDao.listByLoadBalancerIdAndDisplayFlag(cmd.getLbRuleId(), forDisplay);
 
         return sDbpolicies;
     }
@@ -2220,12 +2229,14 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
     public List<LBHealthCheckPolicyVO> searchForLBHealthCheckPolicies(ListLBHealthCheckPoliciesCmd cmd) throws PermissionDeniedException {
         Account caller = CallContext.current().getCallingAccount();
         Long loadBalancerId = cmd.getLbRuleId();
+        boolean forDisplay = cmd.getDisplay();
+
         LoadBalancerVO loadBalancer = _lbDao.findById(loadBalancerId);
         if (loadBalancer == null) {
             return null;
         }
         _accountMgr.checkAccess(caller, null, loadBalancer);
-        List<LBHealthCheckPolicyVO> hcDbpolicies = _lb2healthcheckDao.listByLoadBalancerId(cmd.getLbRuleId());
+        List<LBHealthCheckPolicyVO> hcDbpolicies = _lb2healthcheckDao.listByLoadBalancerIdAndDisplayFlag(cmd.getLbRuleId(), forDisplay);
         return hcDbpolicies;
     }
 
@@ -2454,4 +2465,58 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
         this._lbProviders = lbProviders;
     }
 
+    @Override
+    @ActionEvent(eventType = EventTypes.EVENT_LB_STICKINESSPOLICY_UPDATE, eventDescription = "updating lb stickiness policy", async = true)
+    public StickinessPolicy updateLBStickinessPolicy(long id, String customId, Boolean forDisplay) {
+        LBStickinessPolicyVO policy = _lb2stickinesspoliciesDao.findById(id);
+        if (policy == null) {
+            throw new InvalidParameterValueException("Fail to find stickiness policy with " + id);
+        }
+
+        LoadBalancerVO loadBalancer = _lbDao.findById(Long.valueOf(policy.getLoadBalancerId()));
+        if (loadBalancer == null) {
+            throw new InvalidParameterException("Invalid Load balancer : " + policy.getLoadBalancerId() + " for Stickiness policy id: " + id);
+        }
+
+        _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, loadBalancer);
+
+        if (customId != null) {
+            policy.setUuid(customId);
+        }
+
+        if (forDisplay != null) {
+            policy.setDisplay(forDisplay);
+        }
+
+        _lb2stickinesspoliciesDao.update(id, policy);
+        return _lb2stickinesspoliciesDao.findById(id);
+    }
+
+    @Override
+    @ActionEvent(eventType = EventTypes.EVENT_LB_HEALTHCHECKPOLICY_UPDATE, eventDescription = "updating lb healthcheck policy", async = true)
+    public HealthCheckPolicy updateLBHealthCheckPolicy(long id, String customId, Boolean forDisplay) {
+        LBHealthCheckPolicyVO policy = _lb2healthcheckDao.findById(id);
+        if (policy == null) {
+            throw new InvalidParameterValueException("Fail to find stickiness policy with " + id);
+        }
+
+        LoadBalancerVO loadBalancer = _lbDao.findById(Long.valueOf(policy.getLoadBalancerId()));
+        if (loadBalancer == null) {
+            throw new InvalidParameterException("Invalid Load balancer : " + policy.getLoadBalancerId() + " for Stickiness policy id: " + id);
+        }
+
+        _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, loadBalancer);
+
+        if (customId != null) {
+            policy.setUuid(customId);
+        }
+
+        if (forDisplay != null) {
+            policy.setDisplay(forDisplay);
+        }
+
+        _lb2healthcheckDao.update(id, policy);
+        return _lb2healthcheckDao.findById(id);
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 6b37f45..da25298 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -38,9 +38,6 @@ import javax.crypto.spec.SecretKeySpec;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.acl.ControlledEntity;
 import org.apache.cloudstack.affinity.AffinityGroupProcessor;
 import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
@@ -346,6 +343,8 @@ import org.apache.cloudstack.api.command.user.loadbalancer.ListSslCertsCmd;
 import org.apache.cloudstack.api.command.user.loadbalancer.RemoveCertFromLoadBalancerCmd;
 import org.apache.cloudstack.api.command.user.loadbalancer.RemoveFromLoadBalancerRuleCmd;
 import org.apache.cloudstack.api.command.user.loadbalancer.UpdateApplicationLoadBalancerCmd;
+import org.apache.cloudstack.api.command.user.loadbalancer.UpdateLBHealthCheckPolicyCmd;
+import org.apache.cloudstack.api.command.user.loadbalancer.UpdateLBStickinessPolicyCmd;
 import org.apache.cloudstack.api.command.user.loadbalancer.UpdateLoadBalancerRuleCmd;
 import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd;
 import org.apache.cloudstack.api.command.user.nat.CreateIpForwardingRuleCmd;
@@ -508,6 +507,8 @@ import org.apache.cloudstack.storage.datastore.db.ImageStoreVO;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.cloudstack.utils.identity.ManagementServerNode;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.GetVncPortAnswer;
@@ -2992,6 +2993,9 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         cmdList.add(CreateVPCCmdByAdmin.class);
         cmdList.add(ListVPCsCmdByAdmin.class);
         cmdList.add(UpdateVPCCmdByAdmin.class);
+        cmdList.add(UpdateLBStickinessPolicyCmd.class);
+        cmdList.add(UpdateLBHealthCheckPolicyCmd.class);
+
         return cmdList;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/515fa261/setup/db/db/schema-430to440.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql
index d0dd073..cca6e1f 100644
--- a/setup/db/db/schema-430to440.sql
+++ b/setup/db/db/schema-430to440.sql
@@ -453,20 +453,20 @@ CREATE VIEW `cloud`.`user_vm_view` AS
            left join
         `cloud`.`user_vm_details` `custom_ram_size`  ON (((`custom_ram_size`.`vm_id` = `cloud`.`vm_instance`.`id`) and (`custom_ram_size`.`name` = 'memory')));
 
--- ACL DB schema        
+-- ACL DB schema
 CREATE TABLE `cloud`.`iam_group` (
   `id` bigint unsigned NOT NULL UNIQUE auto_increment,
   `name` varchar(255) NOT NULL,
   `description` varchar(255) default NULL,
   `uuid` varchar(40),
-  `path` varchar(255) NOT NULL,  
+  `path` varchar(255) NOT NULL,
   `account_id` bigint unsigned NOT NULL,
   `view` varchar(40) default 'User' COMMENT 'response review this group account should see for result',
   `removed` datetime COMMENT 'date the group was removed',
   `created` datetime COMMENT 'date the group was created',
   PRIMARY KEY  (`id`),
   INDEX `i_iam_group__removed`(`removed`),
-  CONSTRAINT `uc_iam_group__uuid` UNIQUE (`uuid`)  
+  CONSTRAINT `uc_iam_group__uuid` UNIQUE (`uuid`)
 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
 
 CREATE TABLE `cloud`.`iam_group_account_map` (
@@ -474,11 +474,11 @@ CREATE TABLE `cloud`.`iam_group_account_map` (
   `group_id` bigint unsigned NOT NULL,
   `account_id` bigint unsigned NOT NULL,
   `removed` datetime COMMENT 'date the account was removed from the group',
-  `created` datetime COMMENT 'date the account was assigned to the group',  
+  `created` datetime COMMENT 'date the account was assigned to the group',
   PRIMARY KEY  (`id`),
   CONSTRAINT `fk_iam_group_vm_map__group_id` FOREIGN KEY(`group_id`) REFERENCES `iam_group` (`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_iam_group_vm_map__account_id` FOREIGN KEY(`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;        
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 
 CREATE TABLE `cloud`.`iam_policy` (
@@ -487,7 +487,7 @@ CREATE TABLE `cloud`.`iam_policy` (
   `description` varchar(255) DEFAULT NULL,
   `uuid` varchar(40) DEFAULT NULL,
   `path` varchar(255) NOT NULL,
-  `account_id` bigint unsigned NOT NULL,  
+  `account_id` bigint unsigned NOT NULL,
   `removed` datetime DEFAULT NULL COMMENT 'date the role was removed',
   `created` datetime DEFAULT NULL COMMENT 'date the role was created',
   `policy_type` varchar(64) DEFAULT 'Static' COMMENT 'Static or Dynamic',
@@ -1661,3 +1661,8 @@ CREATE TABLE `cloud`.`network_acl_item_cidrs` (
   PRIMARY KEY (`id`),
   CONSTRAINT `fk_network_acl_item_id` FOREIGN KEY `fk_network_acl_item_id`(`network_acl_item_id`) REFERENCES `network_acl_item`(`id`) ON DELETE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+
+ALTER TABLE `cloud`.`load_balancer_healthcheck_policies` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the policy can be displayed to the end user';
+ALTER TABLE `cloud`.`load_balancer_stickiness_policies` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the policy can be displayed to the end user';
+