OpenNebula
Cloud API

org.opennebula.client.group
Class Group

java.lang.Object
  extended by org.opennebula.client.PoolElement
      extended by org.opennebula.client.group.Group

public class Group
extends PoolElement

This class represents an OpenNebula group. It also offers static XML-RPC call wrappers.


Field Summary
 
Fields inherited from class org.opennebula.client.PoolElement
client, id, xml, xpath
 
Constructor Summary
  Group(int id, Client client)
          Creates a new Group representation.
protected Group(org.w3c.dom.Node xmlElement, Client client)
           
 
Method Summary
static OneResponse allocate(Client client, java.lang.String name)
          Allocates a new group in OpenNebula
 boolean contains(int uid)
          Returns whether or not the user is part of this group
 OneResponse delete()
          Deletes the group from OpenNebula.
static OneResponse delete(Client client, int id)
          Deletes a group from OpenNebula.
 OneResponse info()
          Loads the xml representation of the group.
static OneResponse info(Client client, int id)
          Retrieves the information of the given group.
static OneResponse setQuota(Client client, int id, java.lang.String quota_template)
          Replaces the group quota template contents.
 OneResponse setQuota(java.lang.String quota_template)
          Replaces the group quota template contents.
 
Methods inherited from class org.opennebula.client.PoolElement
chmod, chmod, chmod, getId, getName, gid, id, processInfo, state, uid, xpath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Group

public Group(int id,
             Client client)
Creates a new Group representation.

Parameters:
id - The group id.
client - XML-RPC Client.

Group

protected Group(org.w3c.dom.Node xmlElement,
                Client client)
See Also:
PoolElement
Method Detail

allocate

public static OneResponse allocate(Client client,
                                   java.lang.String name)
Allocates a new group in OpenNebula

Parameters:
client - XML-RPC Client.
name - Name for the new group.
Returns:
If successful the message contains the associated id generated for this group.

info

public static OneResponse info(Client client,
                               int id)
Retrieves the information of the given group.

Parameters:
client - XML-RPC Client.
id - The group id.
Returns:
If successful the message contains the string with the information returned by OpenNebula.

delete

public static OneResponse delete(Client client,
                                 int id)
Deletes a group from OpenNebula.

Parameters:
client - XML-RPC Client.
id - The group id.
Returns:
A encapsulated response.

setQuota

public static OneResponse setQuota(Client client,
                                   int id,
                                   java.lang.String quota_template)
Replaces the group quota template contents.

Parameters:
client - XML-RPC Client.
id - The group id of the target group we want to modify.
quota_template - New quota template contents.
Returns:
If successful the message contains the group id.

info

public OneResponse info()
Loads the xml representation of the group. The info is also stored internally.

See Also:
info(Client, int)

delete

public OneResponse delete()
Deletes the group from OpenNebula.

See Also:
delete(Client, int)

setQuota

public OneResponse setQuota(java.lang.String quota_template)
Replaces the group quota template contents.

Parameters:
quota_template - New quota template contents.
Returns:
If successful the message contains the group id.

contains

public boolean contains(int uid)
Returns whether or not the user is part of this group

Parameters:
uid - The user ID.
Returns:
Whether or not the user is part of this group.

OpenNebula
Cloud API

Visit OpenNebula.org
Copyright 2002-2012 © OpenNebula Project Leads (OpenNebula.org).