net.dpml.station
Class ApplianceContentHandler

java.lang.Object
  extended by java.net.ContentHandler
      extended by net.dpml.transit.ContentHandler
          extended by net.dpml.station.ApplianceContentHandler
All Implemented Interfaces:
ApplianceContentManager, ApplianceFactory, ContentManager
Direct Known Subclasses:
PlanContentHandler

public class ApplianceContentHandler
extends ContentHandler
implements ApplianceContentManager, ApplianceFactory

Content handler for the appliance artifact type.

Version:
2.1.0
Author:
Digital Product Management Library

Constructor Summary
  ApplianceContentHandler()
          Creation of a new applicance content handler.
protected ApplianceContentHandler(Logger logger)
          Creation of a new applicance content handler.
 
Method Summary
 ApplianceManager[] getApplianceManagers()
          Return the set of applicance managers established by the handler.
 Object getContent(URLConnection connection)
          Returns the content in the form of a Appliance.
 Object getContent(URLConnection connection, Class[] classes)
          Returns the content assignable to the first recognized class in the list of suppied classes.
 String getType()
          Returns the type thar the content handler supports.
 Appliance newAppliance(URLConnection connection, String partition)
          Create a new appliance using the supplied connection object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplianceContentHandler

public ApplianceContentHandler()
Creation of a new applicance content handler.


ApplianceContentHandler

protected ApplianceContentHandler(Logger logger)
Creation of a new applicance content handler.

Parameters:
logger - the assigned logging channel
Method Detail

getApplianceManagers

public ApplianceManager[] getApplianceManagers()
Return the set of applicance managers established by the handler.

Specified by:
getApplianceManagers in interface ApplianceContentManager
Returns:
the appliance managers

getType

public String getType()
Returns the type thar the content handler supports.

Specified by:
getType in interface ContentManager
Specified by:
getType in class ContentHandler
Returns:
the content type name

getContent

public Object getContent(URLConnection connection)
                  throws IOException
Returns the content in the form of a Appliance.

Specified by:
getContent in class ContentHandler
Parameters:
connection - the url connection
Returns:
the application handler
Throws:
IOException - if an IO error occurs

getContent

public Object getContent(URLConnection connection,
                         Class[] classes)
                  throws IOException
Returns the content assignable to the first recognized class in the list of suppied classes. If the class array is empty the application handler is returned. If none of the classes are recognized, null is returned.

Overrides:
getContent in class ContentHandler
Parameters:
connection - the url connection
classes - the selection class array
Returns:
the resolved instance
Throws:
IOException - if an IO error occurs

newAppliance

public Appliance newAppliance(URLConnection connection,
                              String partition)
                       throws IOException
Create a new appliance using the supplied connection object.

Specified by:
newAppliance in interface ApplianceFactory
Parameters:
connection - the URL connection
partition - an optional partition name
Returns:
the appliance
Throws:
IOException - if an IO error occurs