com.waveset.session
Class Importer

java.lang.Object
  extended bycom.waveset.session.Importer

public class Importer
extends java.lang.Object

A class that implements the import operation.


Field Summary
static java.lang.String code_id
           
static java.lang.String EXCHANGE_WRAPPER_ELEMENT
           
static java.lang.String SYSCONFIG
          Id of the system configuration object.
protected static WSTrace trace
           
 
Constructor Summary
Importer(LocalSession session, com.waveset.server.Server server)
          Build an importer.
 
Method Summary
 void importObjects(java.io.InputStream input, BulkMonitor monitor, boolean force)
           
 void importObjects(java.lang.String file, BulkMonitor monitor, boolean force)
          Import a collection of objects defined in an import file.
 void importXml(java.lang.String xml, BulkMonitor monitor)
          Import a collection of objects defined in an XML string.
protected  void internalIncludeFile(java.lang.String file)
          Given a filename import the file's xml.
 boolean isPreserved(java.lang.String id)
          Test to see if an object is marked for preservation.
 boolean isProtected(PersistentObject obj, PersistentObject existing)
          Test to see if an object is protected.
 void setForce(boolean b)
          Enable force mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trace

protected static WSTrace trace

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

SYSCONFIG

public static final java.lang.String SYSCONFIG
Id of the system configuration object.

See Also:
Constant Field Values

EXCHANGE_WRAPPER_ELEMENT

public static final java.lang.String EXCHANGE_WRAPPER_ELEMENT
See Also:
Constant Field Values
Constructor Detail

Importer

public Importer(LocalSession session,
                com.waveset.server.Server server)
         throws WavesetException
Build an importer.

Method Detail

setForce

public void setForce(boolean b)
Enable force mode.


importObjects

public void importObjects(java.lang.String file,
                          BulkMonitor monitor,
                          boolean force)
                   throws WavesetException
Import a collection of objects defined in an import file. The XML is expected to be a document, that contains one or more PersistentObject serializations.

!! We should be using a SAX parsing interface here assuming that the input file can be arbitrarily large. For now, we'll bring it in as a string and use the DOM parser.

Throws:
WavesetException

importObjects

public void importObjects(java.io.InputStream input,
                          BulkMonitor monitor,
                          boolean force)
                   throws WavesetException
Throws:
WavesetException

importXml

public void importXml(java.lang.String xml,
                      BulkMonitor monitor)
               throws WavesetException
Import a collection of objects defined in an XML string. The XML is expected to be a document, that contains one or more PersistentObject serializations.

We'll assume that with the string interface we can use the DOM parser.

Throws:
WavesetException

internalIncludeFile

protected void internalIncludeFile(java.lang.String file)
                            throws WavesetException
Given a filename import the file's xml.

Throws:
WavesetException

isPreserved

public boolean isPreserved(java.lang.String id)
Test to see if an object is marked for preservation.


isProtected

public boolean isProtected(PersistentObject obj,
                           PersistentObject existing)
                    throws WavesetException
Test to see if an object is protected. This is a bit like the CheckinVisitor but we don't want to run that during an import. Added to catch a few specific dangerous cases like importing a TaskDefinition when there are running TaskInstances and the WFProcess changed.

Throws:
WavesetException