@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLoadBalancerName() == null) ? 0 : getLoadBalancerName().hashCode()); hashCode = prime * hashCode + ((getLoadBalancerPort() == null) ? 0 : getLoadBalancerPort().hashCode()); hashCode = prime * hashCode + ((getPolicyNames() == null) ? 0 : getPolicyNames().hashCode()); return hashCode; }
/** * Constructs a new SetLoadBalancerPoliciesOfListenerRequest object. Callers should use the setter or fluent setter * (with...) methods to initialize any additional object members. * * @param loadBalancerName * The name of the load balancer. * @param loadBalancerPort * The external port of the load balancer. * @param policyNames * The names of the policies. This list must include all policies to be enabled. If you omit a policy that is * currently enabled, it is disabled. If the list is empty, all current policies are disabled. */ public SetLoadBalancerPoliciesOfListenerRequest(String loadBalancerName, Integer loadBalancerPort, java.util.List<String> policyNames) { setLoadBalancerName(loadBalancerName); setLoadBalancerPort(loadBalancerPort); setPolicyNames(policyNames); }
private void enableStickinessOnListener(String loadbalancerName, ListenerDescription listenerDescription) { log.info("Enable stickiness on loadbalancer " + loadbalancerName + " : " + listenerDescription.getListener().getLoadBalancerPort()); List<String> policyNames = new ArrayList<>(listenerDescription.getPolicyNames()); policyNames.add(DEPLOY_STICKINESS_POLICY + "-" + loadbalancerName); awsElbClient.setLoadBalancerPoliciesOfListener(new SetLoadBalancerPoliciesOfListenerRequest().withLoadBalancerName(loadbalancerName).withPolicyNames(policyNames).withLoadBalancerPort(listenerDescription.getListener().getLoadBalancerPort())); }
/** * <p> * The names of the policies. This list must include all policies to be enabled. If you omit a policy that is * currently enabled, it is disabled. If the list is empty, all current policies are disabled. * </p> * * @param policyNames * The names of the policies. This list must include all policies to be enabled. If you omit a policy that is * currently enabled, it is disabled. If the list is empty, all current policies are disabled. * @return Returns a reference to this object so that method calls can be chained together. */ public SetLoadBalancerPoliciesOfListenerRequest withPolicyNames(java.util.Collection<String> policyNames) { setPolicyNames(policyNames); return this; }
/** * <p> * The external port of the load balancer. * </p> * * @param loadBalancerPort * The external port of the load balancer. * @return Returns a reference to this object so that method calls can be chained together. */ public SetLoadBalancerPoliciesOfListenerRequest withLoadBalancerPort(Integer loadBalancerPort) { setLoadBalancerPort(loadBalancerPort); return this; }
/** * <p> * The name of the load balancer. * </p> * * @param loadBalancerName * The name of the load balancer. * @return Returns a reference to this object so that method calls can be chained together. */ public SetLoadBalancerPoliciesOfListenerRequest withLoadBalancerName(String loadBalancerName) { setLoadBalancerName(loadBalancerName); return this; }
/** * <p> * The names of the policies. This list must include all policies to be * enabled. If you omit a policy that is currently enabled, it is disabled. * If the list is empty, all current policies are disabled. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param policyNames <p> * The names of the policies. This list must include all policies * to be enabled. If you omit a policy that is currently enabled, * it is disabled. If the list is empty, all current policies are * disabled. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public SetLoadBalancerPoliciesOfListenerRequest withPolicyNames(String... policyNames) { if (getPolicyNames() == null) { this.policyNames = new java.util.ArrayList<String>(policyNames.length); } for (String value : policyNames) { this.policyNames.add(value); } return this; }
private void disableStickinessOnListener(String loadbalancerName, ListenerDescription listenerDescription) { log.info("Disable stickiness on loadbalancer " + loadbalancerName + " : " + listenerDescription.getListener().getLoadBalancerPort()); List<String> policyNames = new ArrayList<>(listenerDescription.getPolicyNames()); policyNames.remove(DEPLOY_STICKINESS_POLICY + "-" + loadbalancerName); awsElbClient.setLoadBalancerPoliciesOfListener(new SetLoadBalancerPoliciesOfListenerRequest().withLoadBalancerName(loadbalancerName).withPolicyNames(policyNames).withLoadBalancerPort(listenerDescription.getListener().getLoadBalancerPort())); }
/** * <p> * The names of the policies. This list must include all policies to be enabled. If you omit a policy that is * currently enabled, it is disabled. If the list is empty, all current policies are disabled. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setPolicyNames(java.util.Collection)} or {@link #withPolicyNames(java.util.Collection)} if you want to * override the existing values. * </p> * * @param policyNames * The names of the policies. This list must include all policies to be enabled. If you omit a policy that is * currently enabled, it is disabled. If the list is empty, all current policies are disabled. * @return Returns a reference to this object so that method calls can be chained together. */ public SetLoadBalancerPoliciesOfListenerRequest withPolicyNames(String... policyNames) { if (this.policyNames == null) { setPolicyNames(new com.amazonaws.internal.SdkInternalList<String>(policyNames.length)); } for (String ele : policyNames) { this.policyNames.add(ele); } return this; }
/** * <p> * The external port of the load balancer. * </p> * * @param loadBalancerPort * The external port of the load balancer. * @return Returns a reference to this object so that method calls can be chained together. */ public SetLoadBalancerPoliciesOfListenerRequest withLoadBalancerPort(Integer loadBalancerPort) { setLoadBalancerPort(loadBalancerPort); return this; }
/** * <p> * The name of the load balancer. * </p> * * @param loadBalancerName * The name of the load balancer. * @return Returns a reference to this object so that method calls can be chained together. */ public SetLoadBalancerPoliciesOfListenerRequest withLoadBalancerName(String loadBalancerName) { setLoadBalancerName(loadBalancerName); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SetLoadBalancerPoliciesOfListenerRequest == false) return false; SetLoadBalancerPoliciesOfListenerRequest other = (SetLoadBalancerPoliciesOfListenerRequest) obj; if (other.getLoadBalancerName() == null ^ this.getLoadBalancerName() == null) return false; if (other.getLoadBalancerName() != null && other.getLoadBalancerName().equals(this.getLoadBalancerName()) == false) return false; if (other.getLoadBalancerPort() == null ^ this.getLoadBalancerPort() == null) return false; if (other.getLoadBalancerPort() != null && other.getLoadBalancerPort().equals(this.getLoadBalancerPort()) == false) return false; if (other.getPolicyNames() == null ^ this.getPolicyNames() == null) return false; if (other.getPolicyNames() != null && other.getPolicyNames().equals(this.getPolicyNames()) == false) return false; return true; }
new SetLoadBalancerPoliciesOfListenerRequest() .withLoadBalancerName(loadBalancerName) .withLoadBalancerPort(l.getListener().getLoadBalancerPort()) .withPolicyNames(l.getPolicyNames().stream().map(policyNameMap::get).collect(Collectors.toList()))
/** * Constructs a new SetLoadBalancerPoliciesOfListenerRequest object. Callers * should use the setter or fluent setter (with...) methods to initialize * any additional object members. * * @param loadBalancerName <p> * The name of the load balancer. * </p> * @param loadBalancerPort <p> * The external port of the load balancer. * </p> * @param policyNames <p> * The names of the policies. This list must include all policies * to be enabled. If you omit a policy that is currently enabled, * it is disabled. If the list is empty, all current policies are * disabled. * </p> */ public SetLoadBalancerPoliciesOfListenerRequest(String loadBalancerName, Integer loadBalancerPort, java.util.List<String> policyNames) { setLoadBalancerName(loadBalancerName); setLoadBalancerPort(loadBalancerPort); setPolicyNames(policyNames); }
/** * <p> * The names of the policies. This list must include all policies to be * enabled. If you omit a policy that is currently enabled, it is disabled. * If the list is empty, all current policies are disabled. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param policyNames <p> * The names of the policies. This list must include all policies * to be enabled. If you omit a policy that is currently enabled, * it is disabled. If the list is empty, all current policies are * disabled. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public SetLoadBalancerPoliciesOfListenerRequest withPolicyNames( java.util.Collection<String> policyNames) { setPolicyNames(policyNames); return this; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getLoadBalancerName() != null) sb.append("LoadBalancerName: ").append(getLoadBalancerName()).append(","); if (getLoadBalancerPort() != null) sb.append("LoadBalancerPort: ").append(getLoadBalancerPort()).append(","); if (getPolicyNames() != null) sb.append("PolicyNames: ").append(getPolicyNames()); sb.append("}"); return sb.toString(); }
/** * Constructs a new SetLoadBalancerPoliciesOfListenerRequest object. Callers should use the setter or fluent setter * (with...) methods to initialize any additional object members. * * @param loadBalancerName * The name of the load balancer. * @param loadBalancerPort * The external port of the load balancer. * @param policyNames * The names of the policies. This list must include all policies to be enabled. If you omit a policy that is * currently enabled, it is disabled. If the list is empty, all current policies are disabled. */ public SetLoadBalancerPoliciesOfListenerRequest(String loadBalancerName, Integer loadBalancerPort, java.util.List<String> policyNames) { setLoadBalancerName(loadBalancerName); setLoadBalancerPort(loadBalancerPort); setPolicyNames(policyNames); }
/** * <p> * The names of the policies. This list must include all policies to be enabled. If you omit a policy that is * currently enabled, it is disabled. If the list is empty, all current policies are disabled. * </p> * * @param policyNames * The names of the policies. This list must include all policies to be enabled. If you omit a policy that is * currently enabled, it is disabled. If the list is empty, all current policies are disabled. * @return Returns a reference to this object so that method calls can be chained together. */ public SetLoadBalancerPoliciesOfListenerRequest withPolicyNames(java.util.Collection<String> policyNames) { setPolicyNames(policyNames); return this; }
request.setHttpMethod(HttpMethodName.POST); if (setLoadBalancerPoliciesOfListenerRequest.getLoadBalancerName() != null) { request.addParameter("LoadBalancerName", StringUtils.fromString(setLoadBalancerPoliciesOfListenerRequest.getLoadBalancerName())); if (setLoadBalancerPoliciesOfListenerRequest.getLoadBalancerPort() != null) { request.addParameter("LoadBalancerPort", StringUtils.fromInteger(setLoadBalancerPoliciesOfListenerRequest.getLoadBalancerPort())); if (setLoadBalancerPoliciesOfListenerRequest.getPolicyNames().isEmpty()) { request.addParameter("PolicyNames", ""); if (!setLoadBalancerPoliciesOfListenerRequest.getPolicyNames().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) setLoadBalancerPoliciesOfListenerRequest.getPolicyNames()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<String> policyNamesList = (com.amazonaws.internal.SdkInternalList<String>) setLoadBalancerPoliciesOfListenerRequest .getPolicyNames(); int policyNamesListIndex = 1;
/** * <p> * The names of the policies. This list must include all policies to be enabled. If you omit a policy that is * currently enabled, it is disabled. If the list is empty, all current policies are disabled. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setPolicyNames(java.util.Collection)} or {@link #withPolicyNames(java.util.Collection)} if you want to * override the existing values. * </p> * * @param policyNames * The names of the policies. This list must include all policies to be enabled. If you omit a policy that is * currently enabled, it is disabled. If the list is empty, all current policies are disabled. * @return Returns a reference to this object so that method calls can be chained together. */ public SetLoadBalancerPoliciesOfListenerRequest withPolicyNames(String... policyNames) { if (this.policyNames == null) { setPolicyNames(new com.amazonaws.internal.SdkInternalList<String>(policyNames.length)); } for (String ele : policyNames) { this.policyNames.add(ele); } return this; }