Example usage for com.amazonaws.services.elasticloadbalancing.model SetLoadBalancerPoliciesOfListenerRequest setPolicyNames

List of usage examples for com.amazonaws.services.elasticloadbalancing.model SetLoadBalancerPoliciesOfListenerRequest setPolicyNames

Introduction

In this page you can find the example usage for com.amazonaws.services.elasticloadbalancing.model SetLoadBalancerPoliciesOfListenerRequest setPolicyNames.

Prototype


public void setPolicyNames(java.util.Collection<String> policyNames) 

Source Link

Document

The names of the policies.

Usage

From source file:org.openinfinity.cloud.service.administrator.EC2Wrapper.java

License:Apache License

public void setLoadBalancerPoliciesOfListener(String policyName, String lbName, Integer lbPort) {
    if (this.cloudType == InstanceService.CLOUD_TYPE_AMAZON) {
        try {//w w w  .  j  ava2 s. c om
            SetLoadBalancerPoliciesOfListenerRequest request = new SetLoadBalancerPoliciesOfListenerRequest();
            request.setLoadBalancerName(lbName);
            request.setLoadBalancerPort(lbPort);
            ArrayList<String> policyList = new ArrayList<String>();
            policyList.add(policyName);
            request.setPolicyNames(policyList);
            LOG.info(request.toString());
            lb.setLoadBalancerPoliciesOfListener(request);
        } catch (Exception e) {
            String message = e.getMessage();
            LOG.error("Error setting load balancer policy: " + message);
            ExceptionUtil.throwSystemException(message, e);
        }
    }
}