com.abiquo.GridResourceProvider Class Reference

Auxiliary Grid class used to contact framework entity throw IGridAccess to obtain resources instances. More...

List of all members.

Public Member Functions

ResourceInstance deployService (IService resJava) throws ProvisionException
 Used to put a service on a framework entity and exposed as a Service.
List< ResourceInstance > forceProvisionResourcesOnAllNodes (String stResource) throws ProvisionException
 Forces the provisioning (a new instance creation) of resource resourceName on all available nodes (with the resourceName plugin loaded).

Protected Member Functions

 GridResourceProvider (IGridAccess inAccess, FrameworkConfiguration inConfig)
 class constructor used from Grid to expose its functionalities.
List< ResourceInstance > forceProvisionResources (String resourceName, int numReso) throws ProvisionException
 Require the creation of numReso new instances (provisioning) for the resource resourceName.
List< ResourceInstance > forceProvisionResources (String resourceName, int numReso, String nodeName) throws ProvisionException
 Similar to getResources but requiring new instances.
ResourceInstance getResource (String resourceName) throws NoEnoughResourcesException
 Obtains a reference to SOME resource resourceName.
ResourceInstance getResource (String resourceName, String nodeName) throws ProvisionException
 Obtains a reference to some resource of class resourceName and located on the nodeName.
List< ResourceInstance > getResources (String stResource, int numReso) throws NoEnoughResourcesException, FrameworkException
 The same as getResource(String) but we can specify how many instances we would like to get.
Iterator< ResourceInstance > getResourceSequence (String resourceName)
 A ranking sorted access to obtain resources instances.


Detailed Description

Auxiliary Grid class used to contact framework entity throw IGridAccess to obtain resources instances.

Implements transactions to get Resources. Resolve and provisioning messages request construction and response unwrapping.

Note: on this version all ResourceInstance created are Transient (not volatile) and Public, so resources access could be shared throw different uses and users.


Constructor & Destructor Documentation

com.abiquo.GridResourceProvider.GridResourceProvider ( IGridAccess  inAccess,
FrameworkConfiguration  inConfig 
) [protected]

class constructor used from Grid to expose its functionalities.

Parameters:
inAccess the in access
inConfig the in config


Member Function Documentation

ResourceInstance com.abiquo.GridResourceProvider.deployService ( IService  resJava  )  throws ProvisionException

Used to put a service on a framework entity and exposed as a Service.

It define the new Resource (as mw do with its plugins) and require a new instance (provisioning)

Returns:
the resource instance binding object to use this resource. Its abstractName (resource name, ResourceInstance.ID) can be used to require more instances using the same functions
Exceptions:
ProvisionException some error on class serialization

List<ResourceInstance> com.abiquo.GridResourceProvider.forceProvisionResources ( String  resourceName,
int  numReso 
) throws ProvisionException [protected]

Require the creation of numReso new instances (provisioning) for the resource resourceName.

Use scheduler to select on witch nodes are created.

Parameters:
resourceName the resource name required (use XXXResource.ID)
numReso how many new instances are required
Exceptions:
ProvisionException if there aren't any resource to book or there are too many instances of this resource
Returns:
a list with numReso resource instances with abstract name equals to resourceName

List<ResourceInstance> com.abiquo.GridResourceProvider.forceProvisionResources ( String  resourceName,
int  numReso,
String  nodeName 
) throws ProvisionException [protected]

Similar to getResources but requiring new instances.

nodeName can be null indicating that it's not a problem. nodeName only make sense when numReso = 1. Else it indicates provision on the same node different resource instances.

Parameters:
resourceName the resource type
numReso the num reso
nodeName the force FQDN
Returns:
the list of resources.
Exceptions:
ProvisionException,if there aren't any resource to book.
ProvisionException the just cant get resource exception

List<ResourceInstance> com.abiquo.GridResourceProvider.forceProvisionResourcesOnAllNodes ( String  stResource  )  throws ProvisionException

Forces the provisioning (a new instance creation) of resource resourceName on all available nodes (with the resourceName plugin loaded).

Parameters:
resourceName is the resource type (abstract name of the resource instance)
Exceptions:
ProvisionException if there aren't any resource to book or there are too many instances of this resource
Returns:
the list containing resource instance binding objects
Todo:
change to getAllNodesCAN

ResourceInstance com.abiquo.GridResourceProvider.getResource ( String  resourceName  )  throws NoEnoughResourcesException [protected]

Obtains a reference to SOME resource resourceName.

Use the scheduler to select the instance to return. allocated in any node of the grid depending on efficiency constraints. First try to reuse some living instance (previously provisioned) then require the creation of new instance.

Parameters:
resourceName is the resource type (abstract name of the resource instance)
Exceptions:
NoEnoughResourcesException,when there isn't any resource resourceName available (or too many)
Returns:
the resource instance binding class to access the resource

ResourceInstance com.abiquo.GridResourceProvider.getResource ( String  resourceName,
String  nodeName 
) throws ProvisionException [protected]

Obtains a reference to some resource of class resourceName and located on the nodeName.

It could reuse an existing resource or force its creation (provisioned).

Parameters:
resourceName is the resource type (abstract name of the resource instance)
nodeName the node locator (alias, address or session name)
Exceptions:
ProvisionException when the node on nodeName can not instantiate this resource (have not the plugin or too many instances)
Returns:
the resource instance binding object to access the resource

List<ResourceInstance> com.abiquo.GridResourceProvider.getResources ( String  stResource,
int  numReso 
) throws NoEnoughResourcesException, FrameworkException [protected]

The same as getResource(String) but we can specify how many instances we would like to get.

Resolution if it's necessary, it tries force provisioning.

Parameters:
resourceName is the resource type (abstract name of the resource instance)
numReso the number of resources to find.
Exceptions:
NoEnoughResourcesException when there isn't enough resources
Returns:
the list with the resource instances

Iterator<ResourceInstance> com.abiquo.GridResourceProvider.getResourceSequence ( String  resourceName  )  [protected]

A ranking sorted access to obtain resources instances.

Used to provision on the fly, when is better to peek a resource instance each time you need it (better than allocate first then use). Use the scheduler ranking.

Parameters:
resourceName is the resource type (abstract name of the resource instance)
Returns:
an Iterator over resourceInstances (always have next better)


The documentation for this class was generated from the following file:

Generated on Mon Sep 15 20:13:10 2008 for FrameworkAPI by  doxygen 1.5.5