gov.noaa.gdsg.xmldbremote.service
Class ResourceHandler

java.lang.Object
  extended bygov.noaa.gdsg.xmldbremote.service.BaseHandler
      extended bygov.noaa.gdsg.xmldbremote.service.ResourceHandler

public class ResourceHandler
extends BaseHandler

This object is deisnged to keep track of Resource objects

Version:
$Id: ResourceHandler.java,v 1.2 2004/12/29 01:06:46 mrxtravis Exp $
Author:
tns

Constructor Summary
ResourceHandler()
          Creates a new instance of ResourceHandler
 
Method Summary
protected  BaseTransport createTransportObject(java.lang.Object object)
          Creates the Resource Transport object.
 java.lang.String getContentAsDOMText(ResourceTransport transport)
          Returns the resource content as an XML String.
 java.lang.String getDocumentId(ResourceTransport transport)
          Returns the document id.
 org.xmldb.api.base.Collection getParentCollection(ResourceTransport transport)
          Wrappes the Resrouce#getParentCollection method.
 void setContentAsDOMText(ResourceTransport transport, java.lang.String xml)
          Sets the resource content as the specified DOM String.
 
Methods inherited from class gov.noaa.gdsg.xmldbremote.service.BaseHandler
getAllStoredObjects, getObjectFromSession, nextId, saveForSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceHandler

public ResourceHandler()
Creates a new instance of ResourceHandler

Method Detail

createTransportObject

protected BaseTransport createTransportObject(java.lang.Object object)
                                       throws org.xmldb.api.base.XMLDBException
Creates the Resource Transport object.

Specified by:
createTransportObject in class BaseHandler
Parameters:
object - The object in which to create a lightweight transport object.
Returns:
The new transport object.
Throws:
org.xmldb.api.base.XMLDBException - IF something goes wrong.

getContentAsDOMText

public java.lang.String getContentAsDOMText(ResourceTransport transport)
                                     throws org.xmldb.api.base.XMLDBException
Returns the resource content as an XML String.

Parameters:
transport - The object representing the object in which the contents will be extracted.
Returns:
A string representing the resource.
Throws:
org.xmldb.api.base.XMLDBException - All exceptions are caught and rethrown.

getDocumentId

public java.lang.String getDocumentId(ResourceTransport transport)
                               throws org.xmldb.api.base.XMLDBException
Returns the document id.

Parameters:
transport - The transport representing the object in which to tget a document id.
Returns:
Whatever is returned by the wrapped method.
Throws:
org.xmldb.api.base.XMLDBException - If the wrapped method throws one.

setContentAsDOMText

public void setContentAsDOMText(ResourceTransport transport,
                                java.lang.String xml)
                         throws org.xmldb.api.base.XMLDBException
Sets the resource content as the specified DOM String.

Parameters:
transport - The transport object representing the actual object.
xml - The XML to set as DOM.
Throws:
org.xmldb.api.base.XMLDBException - All exceptions are caught and rethrown.

getParentCollection

public org.xmldb.api.base.Collection getParentCollection(ResourceTransport transport)
                                                  throws org.xmldb.api.base.XMLDBException
Wrappes the Resrouce#getParentCollection method.

Parameters:
transport - The object representing the actual object to work on.
Returns:
Whatever the mapped method throws.
Throws:
org.xmldb.api.base.XMLDBException - If the wrapped method throws one.


Copyright © 2004 DOC > NOAA > NGDC > EDSD. All Rights Reserved.