uk.org.ogsadai.service.wsrf.resource
Class DataServiceResourceWrapperHome

java.lang.Object
  |
  +--uk.org.ogsadai.service.wsrf.resource.DataServiceResourceWrapperHome
All Implemented Interfaces:
org.globus.wsrf.jndi.Initializable, org.globus.wsrf.ResourceHome

public class DataServiceResourceWrapperHome
extends java.lang.Object
implements org.globus.wsrf.ResourceHome, org.globus.wsrf.jndi.Initializable

A ResourceHome for DataServiceResourceWrappers.

The key type class is specified in the JNDI configuration file.

The key type name is specified in uk.org.ogsadai.service.wsrf.WSRFConstants#DATA_SERVICE_RESOURCE_KEY.

Author:
The OGSA-DAI Team.
See Also:
ResourceHome, Initializable, DataServiceResource, DataServiceResourceWrapper

Constructor Summary
DataServiceResourceWrapperHome()
           
 
Method Summary
 void add(org.globus.wsrf.ResourceKey key, java.lang.Object resource)
          Add a DataServiceResourceWrapper with the given ResourceKey.
 org.globus.wsrf.ResourceKey create(java.lang.Object id, java.lang.String defaultRoot, java.lang.String configRoot, SecurityContextProvider securityContextProvider)
          Create a new DataServiceResource, wrapped in a DataServiceResourceWrapper, add it to the "home" and return its ResourceKey.
 org.globus.wsrf.Resource find(org.globus.wsrf.ResourceKey key)
          (non-JavaDoc)
 java.lang.Object[] getKeys()
          Return an array of the current keys.
 java.lang.Class getKeyTypeClass()
          (non-JavaDoc)
 javax.xml.namespace.QName getKeyTypeName()
          (non-JavaDoc)
 void initialize()
          (non-JavaDoc)
 void remove(org.globus.wsrf.ResourceKey key)
          (non-JavaDoc)
 void setResourceKeyType(java.lang.String clazz)
          Set the class used for resource keys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataServiceResourceWrapperHome

public DataServiceResourceWrapperHome()
Method Detail

create

public org.globus.wsrf.ResourceKey create(java.lang.Object id,
                                          java.lang.String defaultRoot,
                                          java.lang.String configRoot,
                                          SecurityContextProvider securityContextProvider)
                                   throws DataServiceResourceInternalException,
                                          DataServiceResourceUserException
Create a new DataServiceResource, wrapped in a DataServiceResourceWrapper, add it to the "home" and return its ResourceKey.

Parameters:
id - - ID of this data service resource wrapper - used to construct the ResourceKey
defaultRoot - - default root directory for all relative path. This can be null.
configRoot - - directory within which configuration files for this resource are located. This can be absolute or relative or null.
securityContextProvider - - object providing security information for use in accessing properties.
Throws:
DataServiceResourceInternalException - if there is an internal problem experienced when parsing files or creating a data service resource wrapper..
DataServiceResourceUserException - if there is a user-caused problem e.g. if id is null, configuration files cannot be found, or are of the incorrect format.
See Also:
DataServiceResource, DataServiceResourceWrapper

initialize

public void initialize()
                throws java.lang.Exception
(non-JavaDoc)

Specified by:
initialize in interface org.globus.wsrf.jndi.Initializable
Throws:
DAIServiceResourceUserException - if there is no key type class.
java.lang.Exception
See Also:
Initializable.initialize()

getKeyTypeClass

public java.lang.Class getKeyTypeClass()
(non-JavaDoc)

Specified by:
getKeyTypeClass in interface org.globus.wsrf.ResourceHome
See Also:
ResourceHome.getKeyTypeClass()

getKeyTypeName

public javax.xml.namespace.QName getKeyTypeName()
(non-JavaDoc)

Specified by:
getKeyTypeName in interface org.globus.wsrf.ResourceHome
See Also:
ResourceHome.getKeyTypeName(), WSRFConstants.DATA_SERVICE_RESOURCE_KEY

setResourceKeyType

public void setResourceKeyType(java.lang.String clazz)
                        throws java.lang.ClassNotFoundException
Set the class used for resource keys.

Throws:
java.lang.ClassNotFoundException - if the class does not exist on the CLASSPATH.

find

public org.globus.wsrf.Resource find(org.globus.wsrf.ResourceKey key)
                              throws org.globus.wsrf.ResourceException,
                                     org.globus.wsrf.NoSuchResourceException,
                                     org.globus.wsrf.InvalidResourceKeyException
(non-JavaDoc)

Specified by:
find in interface org.globus.wsrf.ResourceHome
org.globus.wsrf.ResourceException
org.globus.wsrf.NoSuchResourceException
org.globus.wsrf.InvalidResourceKeyException
See Also:
ResourceHome.find(org.globus.wsrf.ResourceKey)

remove

public void remove(org.globus.wsrf.ResourceKey key)
            throws org.globus.wsrf.ResourceException,
                   org.globus.wsrf.NoSuchResourceException,
                   org.globus.wsrf.InvalidResourceKeyException,
                   org.globus.wsrf.RemoveNotSupportedException
(non-JavaDoc)

Specified by:
remove in interface org.globus.wsrf.ResourceHome
org.globus.wsrf.ResourceException
org.globus.wsrf.NoSuchResourceException
org.globus.wsrf.InvalidResourceKeyException
org.globus.wsrf.RemoveNotSupportedException
See Also:
ResourceHome.remove(org.globus.wsrf.ResourceKey)

add

public void add(org.globus.wsrf.ResourceKey key,
                java.lang.Object resource)
         throws org.globus.wsrf.InvalidResourceKeyException,
                DataServiceResourceUserException
Add a DataServiceResourceWrapper with the given ResourceKey. If the given resource is not a DataServiceResourceWrapper then it is not added.

Parameters:
key - - resource key.
resource - - DataServiceResourceWrapper.
Throws:
org.globus.wsrf.InvalidResourceKeyException - if key is null.
DataServiceResourceUserException - if resource is null or not of type DataServiceResourceWrapper

getKeys

public java.lang.Object[] getKeys()
Return an array of the current keys.

Returns:
array of current keys.