uk.ac.soton.itinnovation.grid.client.helpers
Class BillingHelper

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.client.helpers.BillingHelper

public class BillingHelper
extends Object


Constructor Summary
BillingHelper(StateRepository repository)
          Create a new BillingHelper.
 
Method Summary
static SOAPHeaderElement[] createBillingHeaders(org.apache.axis.message.addressing.EndpointReferenceType info)
          Create the SOAP headers to hold the billing information, if any.
 org.apache.axis.message.addressing.EndpointReferenceType getBillingHeader(org.apache.axis.message.addressing.EndpointReferenceType[] possibleServices, StorableInStateRepository service)
          Find an account or SLA that meets the service's requirements.
 org.apache.axis.message.addressing.EndpointReferenceType getBillingHeader(ManagedGridService service)
          Find an account or SLA that meets the service's requirements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BillingHelper

public BillingHelper(StateRepository repository)
Create a new BillingHelper.

Parameters:
repository - the repository to search for client accounts, trade accounts and SLAs.
Method Detail

getBillingHeader

public org.apache.axis.message.addressing.EndpointReferenceType getBillingHeader(ManagedGridService service)
                                                                          throws RemoteException,
                                                                                 NoSuitableAccountException
Find an account or SLA that meets the service's requirements. This is a wrapper around getBillingHeader(EndpointReferenceType[], StorableInStateRepository) which first queries the service to find out what it needs.

Parameters:
service - the service to be used
Returns:
the EPR of a suitable management resource, or null if none is required
Throws:
NoSuitableAccountException - if no suitable resource is available
RemoteException - if we tried to contact a local management service for help and it failed in some way

getBillingHeader

public org.apache.axis.message.addressing.EndpointReferenceType getBillingHeader(org.apache.axis.message.addressing.EndpointReferenceType[] possibleServices,
                                                                                 StorableInStateRepository service)
                                                                          throws RemoteException,
                                                                                 NoSuitableAccountException
Find an account or SLA that meets the service's requirements. The service trusts possibleServices. Pick one where we have and account and return the account.

This will contact the a client management service for an EPR if available, or will choose one from the local repository otherwise.

Returns:
the EPR of a suitable management resource, or null if none is required
Throws:
NoSuitableAccountException - if no suitable resource is available
RemoteException - if we tried to contact a local management service for help and it failed in some way

createBillingHeaders

public static SOAPHeaderElement[] createBillingHeaders(org.apache.axis.message.addressing.EndpointReferenceType info)
Create the SOAP headers to hold the billing information, if any.

Parameters:
info - EPR of a management resource (trade account or SLA), or null if none is required
Returns:
an array of SOAP headers that should be added to the message
See Also:
createBillingHeader(org.apache.axis.message.addressing.EndpointReferenceType)


Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.