@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getListener() == null) ? 0 : getListener().hashCode()); hashCode = prime * hashCode + ((getPolicyNames() == null) ? 0 : getPolicyNames().hashCode()); return hashCode; }
/** * 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 (getListener() != null) sb.append("Listener: ").append(getListener()).append(","); if (getPolicyNames() != null) sb.append("PolicyNames: ").append(getPolicyNames()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListenerDescription == false) return false; ListenerDescription other = (ListenerDescription) obj; if (other.getListener() == null ^ this.getListener() == null) return false; if (other.getListener() != null && other.getListener().equals(this.getListener()) == 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; }
/** * <p> * The policies. If there are no policies enabled, the list is empty. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param policyNames <p> * The policies. If there are no policies enabled, the list is * empty. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListenerDescription 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; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getListener() == null) ? 0 : getListener().hashCode()); hashCode = prime * hashCode + ((getPolicyNames() == null) ? 0 : getPolicyNames().hashCode()); return hashCode; }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getListener() != null) sb.append("Listener: " + getListener() + ","); if (getPolicyNames() != null) sb.append("PolicyNames: " + getPolicyNames()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListenerDescription == false) return false; ListenerDescription other = (ListenerDescription) obj; if (other.getListener() == null ^ this.getListener() == null) return false; if (other.getListener() != null && other.getListener().equals(this.getListener()) == 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; } }
public void marshall(ListenerDescription _listenerDescription, Request<?> request, String _prefix) { String prefix; if (_listenerDescription.getListener() != null) { prefix = _prefix + "Listener"; Listener listener = _listenerDescription.getListener(); ListenerStaxMarshaller.getInstance().marshall(listener, request, prefix + "."); } if (_listenerDescription.getPolicyNames() != null) { prefix = _prefix + "PolicyNames"; java.util.List<String> policyNames = _listenerDescription.getPolicyNames(); int policyNamesIndex = 1; String policyNamesPrefix = prefix; for (String policyNamesItem : policyNames) { prefix = policyNamesPrefix + ".member." + policyNamesIndex; if (policyNamesItem != null) { request.addParameter(prefix, StringUtils.fromString(policyNamesItem)); } policyNamesIndex++; } prefix = policyNamesPrefix; } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getListener() == null) ? 0 : getListener().hashCode()); hashCode = prime * hashCode + ((getPolicyNames() == null) ? 0 : getPolicyNames().hashCode()); return hashCode; }
/** * 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 (getListener() != null) sb.append("Listener: ").append(getListener()).append(","); if (getPolicyNames() != null) sb.append("PolicyNames: ").append(getPolicyNames()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListenerDescription == false) return false; ListenerDescription other = (ListenerDescription) obj; if (other.getListener() == null ^ this.getListener() == null) return false; if (other.getListener() != null && other.getListener().equals(this.getListener()) == 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; }
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())); }
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())); }
Set<String> policiesToRetrieve = new HashSet<>(); Map<String, String> policyNameMap = new HashMap<>(); source.getListenerDescriptions().forEach(d -> policiesToRetrieve.addAll(d.getPolicyNames())); List<PolicyDescription> sourcePolicies = sourceClient.describeLoadBalancerPolicies( new DescribeLoadBalancerPoliciesRequest() .withLoadBalancerName(loadBalancerName) .withLoadBalancerPort(l.getListener().getLoadBalancerPort()) .withPolicyNames(l.getPolicyNames().stream().map(policyNameMap::get).collect(Collectors.toList()))