org.globus.wsrf
Interface ResourceHome

All Known Implementing Classes:
ResourceHomeImpl, SingletonResourceHome

public interface ResourceHome

Defines a basic interface through which resources are discovered, and removed. The purpose of ResourceHome is to interact with a collection of resources of the same type. Each resource type will have its own custom implementation the ResourceHome interface. The implementation is expected to provide custom methods for creating new resources and optionally methods that act on a set of resource objects.


Method Summary
 Resource find(ResourceKey key)
          Retrives a resource.
 Class getKeyTypeClass()
          The resource key type.
 QName getKeyTypeName()
          The name of the resource key.
 void remove(ResourceKey key)
          Removes a resource.
 

Method Detail

getKeyTypeClass

public Class getKeyTypeClass()
The resource key type. The ResourceKey used or passed to this ResourceHome must have match this type (corresponds to ResourceKey.getValue()).

Returns:
the type of the key.

getKeyTypeName

public QName getKeyTypeName()
The name of the resource key. The ResourceKey used or passed to this ResourceHome must have match this name (corresponds to ResourceKey.getName()).

Returns:
the name of the key.

find

public Resource find(ResourceKey key)
              throws ResourceException,
                     NoSuchResourceException,
                     InvalidResourceKeyException
Retrives a resource. Note: This function must not return null. It must return the resource object or throw an exception if there is no resource with the specified key.

Returns:
non-null resource object.
Throws:
NoSuchResourceException - if no resource exists with the given key
InvalidResourceKeyException - if the resource key is invalid.
ResourceException - if any other error occurs.

remove

public void remove(ResourceKey key)
            throws ResourceException,
                   NoSuchResourceException,
                   InvalidResourceKeyException,
                   RemoveNotSupportedException
Removes a resource. If the resource implements the RemoveCallback interface, the implementation must invoke this the remove operation on the resource.

Throws:
NoSuchResourceException - if no resource exists with the given key
InvalidResourceKeyException - if the resource key is invalid.
RemoveNotSupportedException - if remove operation is not supported.
ResourceException - if any other error occurs.