Package org.opennebula.client.user

Examples of org.opennebula.client.user.User


        int userID = Integer.parseInt( rc.getMessage() );
        System.out.println("The allocation request returned this ID: " + userID);

        // We can create a representation for the new user, using the returned
        // user-ID
        User javaUser = new User(userID, oneClient);

        // And request its information
        rc = javaUser.info();

        // Alternatively we could have requested the user's info with the
        // static info method:
        // rc = User.info(oneClient, userID);
        // and processed the xml returned in the message of the OneResponse.

        if (rc.isError())
        {
            System.out.println(rc.getErrorMessage());
            return;
        }

        // This is how the info returned looks like...
        System.out.println("Info for " + javaUser.xpath("name") + "...");
        System.out.println(rc.getMessage());

        // Wait a second... what was that xpath method for?
        // Now that we have the user's info loaded, we can use xpath expressions
        // without parsing and initializing any xml, as simple as
        // String name = javaUser.xpath("name");

        // The user pool information is now outdated, so we need to call the
        // info method again
        userpool.info();
        printUserPool(userpool);

        // Let's delete this new user, using its ID
        System.out.println("Deleting " + javaUser.getName() + "...");
        rc = javaUser.delete();

        if (rc.isError())
        {
            System.out.println(rc.getErrorMessage());
            return;
View Full Code Here


        res = User.allocate(client, name, password);

        assertTrue( res.getErrorMessage(), !res.isError() );

        int uid = Integer.parseInt(res.getMessage());
        user    = new User(uid, client);
    }
View Full Code Here

TOP

Related Classes of org.opennebula.client.user.User

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.