org.apache.jackrabbit.rmi.xml
Class SessionImportContentHandler

java.lang.Object
  extended by org.apache.jackrabbit.rmi.xml.ImportContentHandler
      extended by org.apache.jackrabbit.rmi.xml.SessionImportContentHandler
All Implemented Interfaces:
ContentHandler

public class SessionImportContentHandler
extends ImportContentHandler

SAX content handler for importing XML data to a JCR Session. This utility class can be used to implement the Session.getImportContentHandler(String, int) method in terms of the Session.importXML(String, InputStream, int) method.

Author:
Jukka Zitting

Constructor Summary
SessionImportContentHandler(Session session, String path, int uuidBehaviour)
          Creates a SAX content handler for importing XML data to the given session and path.
 
Method Summary
protected  void importXML(byte[] xml)
          Imports the serialized XML stream using the standard Session.importXML(String, InputStream, int) method.
 
Methods inherited from class org.apache.jackrabbit.rmi.xml.ImportContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionImportContentHandler

public SessionImportContentHandler(Session session,
                                   String path,
                                   int uuidBehaviour)
Creates a SAX content handler for importing XML data to the given session and path.

Parameters:
session - repository session
path - import content path
uuidBehaviour - UUID behaviour mode
Method Detail

importXML

protected void importXML(byte[] xml)
                  throws Exception
Imports the serialized XML stream using the standard Session.importXML(String, InputStream, int) method. Imports the given XML data. This method is called by the endDocument() method after the received XML stream has been serialized.

Subclasses must implement this method to provide the actual import mechanism.

Specified by:
importXML in class ImportContentHandler
Parameters:
xml - the XML data to import
Throws:
Exception - on import errors


Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.