Package org.wso2.carbon.ec2client

Examples of org.wso2.carbon.ec2client.EC2Client.associateAddress()


            String localInstanceId = System.getenv("instance_id");

            // Associate this address with this instance only if any other instance has not assigned it to itself
            for (Address address : addressList) {
                if (address.getInstance() == null) {
                    ec2Client.associateAddress(localInstanceId, elasticIP);
                } else if (!address.getInstance().getInstanceId().equals(localInstanceId) &&
                           !(address.getInstance().getCurrentState().equals(InstanceState.RUNNING) || address.getInstance().getCurrentState().equals(InstanceState.PENDING))) {
                    ec2Client.associateAddress(localInstanceId, elasticIP);
                }
            }
View Full Code Here


            for (Address address : addressList) {
                if (address.getInstance() == null) {
                    ec2Client.associateAddress(localInstanceId, elasticIP);
                } else if (!address.getInstance().getInstanceId().equals(localInstanceId) &&
                           !(address.getInstance().getCurrentState().equals(InstanceState.RUNNING) || address.getInstance().getCurrentState().equals(InstanceState.PENDING))) {
                    ec2Client.associateAddress(localInstanceId, elasticIP);
                }
            }
        } catch (Exception e) {
            log.fatal("Cannot initialize system", e);
            e.printStackTrace();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.