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;