uk.ac.soton.itinnovation.grid.service.utils.gridservit
Class GridServiceUtils

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.service.utils.gridservit.GridServiceUtils

public abstract class GridServiceUtils
extends Object

Helper methods for writing grid services. This class is replacing GridServiceLite. It is used as a utility class rather than as a base class, making it easier to integrate with existing code.


Constructor Summary
GridServiceUtils()
           
 
Method Summary
static org.apache.axis.message.addressing.EndpointReferenceType generateEPR(GridResource bean, URL serviceAddress)
          Generate an EPR from a resource's bean.
static org.apache.axis.message.addressing.EndpointReferenceType[] getResources(String pbacType, Class type, String state, EPRGenerator generator, SubjectDescription user)
          Shared code for each service's getResources().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridServiceUtils

public GridServiceUtils()
Method Detail

generateEPR

public static org.apache.axis.message.addressing.EndpointReferenceType generateEPR(GridResource bean,
                                                                                   URL serviceAddress)
Generate an EPR from a resource's bean. Note: the bean's hibernate session is open when this method is invoked, and can be retreived using SingletonSessionFactory.getFactory()'s getCurrentSession method.

Parameters:
bean - hibernated bean containing information about the resource
serviceAddress - value for the address field of the EPR
Returns:
an EPR with the address, type, status and management EPR fields filled in

getResources

public static org.apache.axis.message.addressing.EndpointReferenceType[] getResources(String pbacType,
                                                                                      Class type,
                                                                                      String state,
                                                                                      EPRGenerator generator,
                                                                                      SubjectDescription user)
                                                                               throws GridFailureException
Shared code for each service's getResources().

Parameters:
pbacType - return resources of this type
type - the Java class of the hibernated resources
state - PBAC state to filter on, or null for all
generator - callback to use to create EPRs from hibernated beans
user - only return resources accessible by this user, or null for all resources
Returns:
a list of matching resource EPRs
Throws:
GridFailureException
See Also:
PDP.getResources(java.lang.String, uk.ac.soton.itinnovation.grid.types.SubjectDescription, java.lang.String)


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