gov.noaa.gdsg.xmldbremote.service
Class BaseHandler

java.lang.Object
  extended bygov.noaa.gdsg.xmldbremote.service.BaseHandler
Direct Known Subclasses:
CollectionHandler, ResourceHandler, ResourceSetHandler, ServiceHandler

public abstract class BaseHandler
extends java.lang.Object

The superclass for handler objects.

Version:
$Id: BaseHandler.java,v 1.2 2004/11/04 00:06:00 mrxtravis Exp $
Author:
tns

Constructor Summary
BaseHandler()
          Creates a new instance of BaseHandler
 
Method Summary
protected abstract  BaseTransport createTransportObject(java.lang.Object object)
          Subclass implement this in order to create the appropriate object and populate it with appropriate values.
protected  java.lang.Object[] getAllStoredObjects()
          Returns all known objects being held in session.
protected  java.lang.Object getObjectFromSession(BaseTransport transport)
          Using the transport id, finds the object the transport object represents.
protected  java.lang.Long nextId()
          Returns the next id
 BaseTransport saveForSession(java.lang.Object object)
          saves a service in session and returns the object that represents it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseHandler

public BaseHandler()
Creates a new instance of BaseHandler

Method Detail

nextId

protected java.lang.Long nextId()
Returns the next id

Returns:
the next available ID

getObjectFromSession

protected final java.lang.Object getObjectFromSession(BaseTransport transport)
Using the transport id, finds the object the transport object represents.

Parameters:
transport - The object used to represent the actual object.
Returns:
The actual obect.

saveForSession

public final BaseTransport saveForSession(java.lang.Object object)
                                   throws org.xmldb.api.base.XMLDBException
saves a service in session and returns the object that represents it

Parameters:
object - the object to save in session.
Returns:
The transport object which represents the object saved in the session.
Throws:
org.xmldb.api.base.XMLDBException - All exceptions are rethrown as one.

getAllStoredObjects

protected java.lang.Object[] getAllStoredObjects()
Returns all known objects being held in session.

Returns:
Object[]

createTransportObject

protected abstract BaseTransport createTransportObject(java.lang.Object object)
                                                throws org.xmldb.api.base.XMLDBException
Subclass implement this in order to create the appropriate object and populate it with appropriate values.

Parameters:
object - The actual object in which the mock object should be created to represent.
Returns:
The transport object representing the given object.
Throws:
org.xmldb.api.base.XMLDBException - All exceptions are rethrown as one.


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