org.apache.jackrabbit.server.io
Class ImportContext

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byjava.util.Properties
              extended byorg.apache.jackrabbit.server.io.AbstractContext
                  extended byorg.apache.jackrabbit.server.io.ImportContext
All Implemented Interfaces:
Cloneable, org.apache.commons.chain.Context, Map, Serializable

public class ImportContext
extends AbstractContext

This Class implements an import context which is passed to the respective import commands. An import command can alter the current node for creating a recursive structure, thus is can lead to errors, if the configuration is not done properly. A import command should clear the input stream, after having processed it.

Please note, that this import context lacks an explicit DavResource member. Currently, this information is not needed in any of the known import commands but leaves this I/O framework more generic.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
ImportContext(ImportContext base, Node importRoot)
          Creats a new import context with the given root node and property defaults.
ImportContext(Node importRoot)
          Creates a new import context with the given root node
 
Method Summary
 ImportContext createSubContext(Node importRoot)
          Creates a new sub context which bases on this contexts properties
 String getContentLanguage()
          Returns the content language or null
 String getContentType()
          Returns the content type of the resource to be imported or null, if no contenttype was defined.
 Node getImportRoot()
          Returns the import root of the resource to import.
 InputStream getInputStream()
          Retruns the input stream of the resource to import.
 long getModificationTime()
          Returns the modification time of the resource
 Node getNode()
          Returns the current parent node of the resource to import.
 String getSystemId()
          Returns the system id of the resource to be imported.
 void setContentLanguage(String contentLanguage)
          Sets the content language.
 void setContentType(String contentType)
          Sets the content type of the resource.
 void setInputStream(InputStream inputStream)
          Sets the inpurt stream of the resource to import.
 void setModificationTime(long modificationTime)
          Sets the modification time of the resource
 void setNode(Node node)
          Sets the current parent node of the resource to import.
 void setSystemId(String systemId)
          sets the system id of this resource.
 
Methods inherited from class org.apache.jackrabbit.server.io.AbstractContext
enableCommand, enableCommand, getProperty, getProperty, isCommandEnabled
 
Methods inherited from class java.util.Properties
getProperty, list, list, load, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

ImportContext

public ImportContext(Node importRoot)
Creates a new import context with the given root node

Parameters:
importRoot - the import root node

ImportContext

public ImportContext(ImportContext base,
                     Node importRoot)
Creats a new import context with the given root node and property defaults.

Parameters:
base -
importRoot -
Method Detail

createSubContext

public ImportContext createSubContext(Node importRoot)
Creates a new sub context which bases on this contexts properties

Parameters:
importRoot -
Returns:

getInputStream

public InputStream getInputStream()
Retruns the input stream of the resource to import.

Returns:
the input stream.

setInputStream

public void setInputStream(InputStream inputStream)
Sets the inpurt stream of the resource to import. A import command that consumed the input stream should set this member to null.

Parameters:
inputStream - the input stream

getImportRoot

public Node getImportRoot()
Returns the import root of the resource to import.

Returns:
the import root of the resource to import.

getNode

public Node getNode()
Returns the current parent node of the resource to import. If no current parent node is defined, the import root is returned.

Returns:
the parent node.

setNode

public void setNode(Node node)
Sets the current parent node of the resource to import. A command can set this member in order to generate recursive structured.

Parameters:
node -

getSystemId

public String getSystemId()
Returns the system id of the resource to be imported. This id depends on the system the resource is comming from. it can be a filename, a display name of a webdav resource, an URI, etc.

Returns:
the system id of the resource to import

setSystemId

public void setSystemId(String systemId)
sets the system id of this resource.

Parameters:
systemId -

getContentType

public String getContentType()
Returns the content type of the resource to be imported or null, if no contenttype was defined.

Returns:
the content type of the resource

setContentType

public void setContentType(String contentType)
Sets the content type of the resource.

Parameters:
contentType - the content type.

getContentLanguage

public String getContentLanguage()
Returns the content language or null

Returns:
contentLanguage

setContentLanguage

public void setContentLanguage(String contentLanguage)
Sets the content language.

Parameters:
contentLanguage -

getModificationTime

public long getModificationTime()
Returns the modification time of the resource

Returns:
the modification time.

setModificationTime

public void setModificationTime(long modificationTime)
Sets the modification time of the resource

Parameters:
modificationTime - the modification time


Copyright © 2005 . All Rights Reserved.