Package com.xensource.xenapi

Examples of com.xensource.xenapi.Session


        return true;

    }

    protected boolean pingXenServer() {
        Session slaveSession = null;
        Connection slaveConn = null;
        try {
            URL slaveUrl = null;
            slaveUrl = _connPool.getURL(_host.ip);
            slaveConn = new Connection(slaveUrl, 10);
View Full Code Here


                Thread.sleep(10000);
            } catch (InterruptedException e) {
            }       
            for (int i = 0 ; i < 15; i++) {
                Connection slaveConn = null;
                Session slaveSession = null;
                try {
                    if (s_logger.isDebugEnabled()) {
                        s_logger.debug("Logging on as the slave to " + hostIp);
                    }
                    slaveConn = new Connection(getURL(hostIp), 10);
View Full Code Here

                    if (s_logger.isDebugEnabled()) {
                        s_logger.debug("Logging on as the slave to " + slaveIp);
                    }
                    slaveConn = null;
                    masterConn = null;
                    Session slaveSession = null;

                    slaveConn = new Connection(getURL(slaveIp), 10);
                    slaveSession = slaveLocalLoginWithPassword(slaveConn, username, password);
   
                    if (s_logger.isDebugEnabled()) {
View Full Code Here

    protected Session slaveLocalLoginWithPassword(Connection conn, String username, Queue<String> password) throws
            BadServerResponse,
            XenAPIException,
            XmlRpcException {
        Session s = null;
        boolean logged_in=false;
        Exception ex = null;
        while (!logged_in){
            try {
                s = Session.slaveLocalLoginWithPassword(conn, username, password.peek());
View Full Code Here

    protected Session loginWithPassword(Connection conn, String username, Queue<String> password, String version)throws
            BadServerResponse,
            XenAPIException,
            XmlRpcException  {
        Session s = null;
        boolean logged_in=false;
        Exception ex = null;
        while (!logged_in){
            try {
                s = Session.loginWithPassword(conn, username, password.peek(), APIVersion.latest().toString());
View Full Code Here

        return true;

    }

    protected boolean pingXenServer() {
        Session slaveSession = null;
        Connection slaveConn = null;
        try {
            URL slaveUrl = null;
            slaveUrl = _connPool.getURL(_host.ip);
            slaveConn = new Connection(slaveUrl, 10);
View Full Code Here

            }

            if ( mConn == null ) {
                try {
                    Connection conn = new Connection(getURL(ipAddress), 5);
                    Session sess = loginWithPassword(conn, username, password, APIVersion.latest().toString());
                    Host host = sess.getThisHost(conn);
                    Boolean hostenabled = host.getEnabled(conn);
                    if( sess != null ){
                        try{
                            Session.logout(conn);
                        } catch (Exception e) {
                        }
                        conn.dispose();
                    }
                    if (!hostenabled) {
                        String msg = "Unable to create master connection, due to master Host " + ipAddress + " is not enabled";
                        s_logger.debug(msg);
                        throw new CloudRuntimeException(msg);
                    }
                    mConn = new XenServerConnection(getURL(ipAddress), ipAddress, username, password, _retries, _interval, wait);
                    loginWithPassword(mConn, username, password, APIVersion.latest().toString());
                catch (Types.HostIsSlave e) {
                    String maddress = e.masterIPAddress;
                    mConn = new XenServerConnection(getURL(maddress), maddress, username, password, _retries, _interval, wait);
                    try {
                        Session session = loginWithPassword(mConn, username, password, APIVersion.latest().toString());
                        Host host = session.getThisHost(mConn);
                        if (!host.getEnabled(mConn)) {
                            String msg = "Unable to create master connection, due to master Host " + maddress + " is not enabled";
                            s_logger.debug(msg);
                            throw new CloudRuntimeException(msg);
                        }
View Full Code Here

    }



    protected Session slaveLocalLoginWithPassword(Connection conn, String username, Queue<String> password) throws BadServerResponse, XenAPIException, XmlRpcException {
        Session s = null;
        boolean logged_in = false;
        Exception ex = null;
        while (!logged_in) {
            try {
                s = Session.slaveLocalLoginWithPassword(conn, username, password.peek());
View Full Code Here

        return s;
    }

    protected Session loginWithPassword(Connection conn, String username, Queue<String> password, String version) throws BadServerResponse, XenAPIException,
        XmlRpcException {
        Session s = null;
        boolean logged_in = false;
        Exception ex = null;
        while (!logged_in) {
            try {
                s = Session.loginWithPassword(conn, username, password.peek(), APIVersion.latest().toString());
View Full Code Here

        return true;

    }

    protected boolean pingXenServer() {
        Session slaveSession = null;
        Connection slaveConn = null;
        try {
            URL slaveUrl = null;
            slaveUrl = _connPool.getURL(_host.ip);
            slaveConn = new Connection(slaveUrl, 10);
View Full Code Here

TOP

Related Classes of com.xensource.xenapi.Session

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.