|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.soton.itinnovation.grid.service.ogsadai.OgsaDaiDataResourceManager
public abstract class OgsaDaiDataResourceManager
Implementation of DataResourceManager that provides functionality common to all
OGSA-DAI based services. This functionality includes configuration file handling, creating
an OgsaDaiInstance, and convenience methods to read and write files.
| Field Summary | |
|---|---|
protected File |
configurationDirectory
|
protected static org.apache.log4j.Logger |
log
|
protected OgsaDaiInstance |
ogsaDaiInstance
|
protected String |
schemaUrl
|
protected File |
skeletonDirectory
|
| Constructor Summary | |
|---|---|
OgsaDaiDataResourceManager()
Finds configuration directories, calls reloadConfiguration(), calls createOgsaDaiInstance(). |
|
| Method Summary | |
|---|---|
protected void |
createOgsaDaiInstance()
Create a DefaultOgsaDaiInstance. |
protected String |
getGriaConfigDirectory()
Find the path to the GRIA configuration directory. |
OgsaDaiInstance |
getOgsaDaiInstance()
|
protected String |
getSchemaURL(String webInfPath)
Return a file:// URL pointing to a directory containing the OGSA-DAI XML schema directory. |
protected ServiceConfiguration |
getServiceConfiguration()
Return a ServiceConfiguration object - if possible from a cache. |
protected String |
getWebInfDirectory()
Return the absolute path to the web service's WEB-INF directory. |
boolean |
isConfigurationLoaded()
Determine whether configuration files have been loaded and the service is ready to respond to requests. |
protected Properties |
loadPropertiesFile(String fileName)
Convenience method to load and return a properties file given by a filename. |
protected String |
readFile(InputStream stream)
Read and return the contents of an input stream. |
protected String |
readFileFromClassPath(String fileName)
Read and return the contents of a file from the classpath. |
protected String |
readSkeletonFile(String fileName)
Read and return the contents of a skeleton file. |
void |
setConfigurationLoaded(boolean isConfigurationLoaded)
Set the isConfigurationLoaded field. |
protected void |
writeFile(File file,
String data)
Write the contents of a string to a file This is a convenience method. |
protected void |
writeFile(File directory,
String fileName,
String data)
Write the contents of a string to a named file in a given directory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface uk.ac.soton.itinnovation.grid.service.dataresource.DataResourceManager |
|---|
connectDataResource, connectDataResourceRole, createDataResource, createDataResourceRole, createDataResourceSubscription, createDefaultRoles, destroyDataResource, destroyDataResourceRole, destroyDataResourceSubscription, disconnectDataResource, disconnectDataResourceRole, reloadConfiguration, writeDataResourceConfiguration |
| Field Detail |
|---|
protected File skeletonDirectory
protected File configurationDirectory
protected String schemaUrl
protected OgsaDaiInstance ogsaDaiInstance
protected static org.apache.log4j.Logger log
| Constructor Detail |
|---|
public OgsaDaiDataResourceManager()
createOgsaDaiInstance().
| Method Detail |
|---|
protected void createOgsaDaiInstance()
DefaultOgsaDaiInstance. Override this method if you need to create
a different implementation of OgsaDaiInstance.
protected String readSkeletonFile(String fileName)
throws IOException
skeletonDirectory. This is a convenience method.
fileName - The name of the skeleton file relative to skeletonDirectory
IOException
protected String readFileFromClassPath(String fileName)
throws IOException
fileName - The name of the file to read
IOException
protected String readFile(InputStream stream)
throws IOException
stream - The stream from which to read
IOException
protected void writeFile(File directory,
String fileName,
String data)
throws IOException
directory - fileName - data -
IOException
protected void writeFile(File file,
String data)
throws IOException
file - data -
IOExceptionprotected String getWebInfDirectory()
protected String getSchemaURL(String webInfPath)
SCHEMA-PATH/schema/ogsadai/xsd/sessions_config.xsd
Where SCHEMA-PATH is replaced with the return value of this method.
webInfPath - The path to the web service's WEB-INF directory.
Usually obtained from getWebInfDirectory()
protected Properties loadPropertiesFile(String fileName)
throws PropertyConfigurationException
fileName - The name of the properties file relative to the GRIA configuration directory.
PropertyConfigurationException
protected String getGriaConfigDirectory()
throws PropertyConfigurationException
PropertyConfigurationException
protected ServiceConfiguration getServiceConfiguration()
throws PropertyConfigurationException
ServiceConfiguration object - if possible from a cache.
PropertyConfigurationExceptionpublic boolean isConfigurationLoaded()
DataResourceManager
isConfigurationLoaded in interface DataResourceManagerpublic void setConfigurationLoaded(boolean isConfigurationLoaded)
isConfigurationLoaded field. Subclasses should call this in their
reloadConfiguration method.
public OgsaDaiInstance getOgsaDaiInstance()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||