Package com.xensource.xenapi

Examples of com.xensource.xenapi.Connection


        return new IpAssocAnswer(cmd, results);
    }

    protected Answer execute(Site2SiteVpnCfgCommand cmd) {
        Connection conn = getConnection();
        String args = "ipsectunnel.sh " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
        if (cmd.isCreate()) {
            args += " -A";
            args += " -l ";
            args += cmd.getLocalPublicIp();
View Full Code Here


        }
        return new Answer(cmd);
    }

    protected SetSourceNatAnswer execute(SetSourceNatCommand cmd) {
        Connection conn = getConnection();
        String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
        String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
        IpAddressTO pubIp = cmd.getIpAddress();
        try {
            VM router = getVM(conn, routerName);
View Full Code Here

    }

    private SetNetworkACLAnswer execute(SetNetworkACLCommand cmd) {
        String[] results = new String[cmd.getRules().length];
        String callResult;
        Connection conn = getConnection();
        String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
        String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
        String privateGw = cmd.getAccessDetail(NetworkElementCommand.VPC_PRIVATE_GATEWAY);

        try {
View Full Code Here

            return new SetNetworkACLAnswer(cmd, false, results);
        }
    }

    protected SetPortForwardingRulesAnswer execute(SetPortForwardingRulesVpcCommand cmd) {
        Connection conn = getConnection();

        String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
        String[] results = new String[cmd.getRules().length];
        int i = 0;
View Full Code Here

    }


    private SetStaticRouteAnswer execute(SetStaticRouteCommand cmd) {
        String callResult;
        Connection conn = getConnection();
        String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
        try {
            String[] results = new String[cmd.getStaticRoutes().length];
            String [][] rules = cmd.generateSRouteRules();
            StringBuilder sb = new StringBuilder();
View Full Code Here

    }


    protected NetworkUsageAnswer execute(NetworkUsageCommand cmd) {
        try {
            Connection conn = getConnection();
            if(cmd.getOption()!=null && cmd.getOption().equals("create") ){
                String result = networkUsage(conn, cmd.getPrivateIP(), "create", null);
                NetworkUsageAnswer answer = new NetworkUsageAnswer(cmd, result, 0L, 0L);
                return answer;
            }
View Full Code Here

    public StartAnswer execute(StartCommand cmd) {
        StartAnswer answer = super.execute(cmd);

        VirtualMachineTO vmSpec = cmd.getVirtualMachine();
        if (vmSpec.getType() == VirtualMachine.Type.ConsoleProxy) {
            Connection conn = getConnection();
            String publicIp = null;
            for (NicTO nic : vmSpec.getNics()) {
                if (nic.getType() == TrafficType.Guest) {
                    publicIp = nic.getIp();
                }
View Full Code Here

    @Override
    public StopAnswer execute(StopCommand cmd) {
        StopAnswer answer = super.execute(cmd);
        String vmName = cmd.getVmName();
        if (vmName.startsWith("v-")) {
            Connection conn = getConnection();
            callHostPlugin(conn, "vmops", "setDNATRule", "add", "false");
        }
        return answer;
    }
View Full Code Here

        return callHostPlugin(conn, "vmops", "routerProxy", "args", args);
    }

    protected NetworkUsageAnswer VPCNetworkUsage(NetworkUsageCommand cmd) {
        try {
            Connection conn = getConnection();
            String option = cmd.getOption();
            String publicIp = cmd.getGatewayIP();

            String args = "vpc_netusage.sh " + cmd.getPrivateIP();
            args += " -l " + publicIp+ " ";
View Full Code Here

    protected NetworkUsageAnswer execute(NetworkUsageCommand cmd) {
        if ( cmd.isForVpc() ) {
            return VPCNetworkUsage(cmd);
        }
        try {
            Connection conn = getConnection();
            if(cmd.getOption()!=null && cmd.getOption().equals("create") ){
                String result = networkUsage(conn, cmd.getPrivateIP(), "create", null);
                NetworkUsageAnswer answer = new NetworkUsageAnswer(cmd, result, 0L, 0L);
                return answer;
            }
View Full Code Here

TOP

Related Classes of com.xensource.xenapi.Connection

Copyright © 2018 www.massapicom. 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.