Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.io.api
Interface IOManager

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
IOManagerLocal, IOManagerRemote
All Known Implementing Classes:
IOManagerBean, IOManagerImpl

public interface IOManager
extends java.io.Serializable

Service handling complex import/export of documents and associated resources.

Author:
Anahide Tchertchian

Field Summary
static java.lang.String DOCUMENTS_ADAPTER_NAME
           
 
Method Summary
 void addAdapter(java.lang.String name, IOResourceAdapter adapter)
          Adds an adapter with given name and definition.
 java.util.Collection<DocumentRef> copyDocumentsAndResources(java.lang.String repo, java.util.Collection<DocumentRef> sources, DocumentLocation targetLocation, java.util.Collection<java.lang.String> ioAdapters)
          Copy documents and resources to another location (on a same machine).
 void copyDocumentsAndResources(java.lang.String repo, java.util.Collection<DocumentRef> sources, IOManager remoteIOManager, DocumentLocation targetLocation, java.util.Collection<java.lang.String> ioAdapters)
          Remote copy.
 void copyDocumentsAndResources(java.lang.String repo, java.util.Collection<DocumentRef> sources, java.lang.String serverAddress, int jndiPort, DocumentLocation targetLocation, java.util.Collection<java.lang.String> ioAdapters)
          Remote copy.
 void copyDocumentsAndResources(java.lang.String repo, java.util.Collection<DocumentRef> sources, java.lang.String serverAddress, int jndiPort, DocumentLocation targetLocation, java.lang.String docReaderFactoryClassName, java.util.Map<java.lang.String,java.lang.Object> rFactoryParams, java.lang.String docWriterFactoryClassName, java.util.Map<java.lang.String,java.lang.Object> wFactoryParams, java.util.Collection<java.lang.String> ioAdapters)
          Copies documents and resources associated with the given sources from the local repository to a remote repository instance (available on a machine with the given serverAddress).
 void disposeExport(java.lang.String uri)
          Should be called by client code after using the export created by calling the externalizeExport(java.lang.String, java.util.Collection, java.util.Collection).
 void exportDocumentsAndResources(java.io.OutputStream out, java.lang.String repo, java.util.Collection<DocumentRef> sources, boolean recurse, java.lang.String format, java.util.Collection<java.lang.String> ioAdapters)
          Export documents and resources.
 java.lang.String externalizeExport(java.lang.String repo, java.util.Collection<DocumentRef> sources, java.util.Collection<java.lang.String> ioAdapters)
          Exports the documents and resources specified by sources and creates an external reachable URI (through stream service) from where a client could download the export.
 java.lang.String externalizeExport(java.lang.String repo, java.util.Collection<DocumentRef> sources, java.lang.String docReaderFactoryName, java.util.Map<java.lang.String,java.lang.Object> readerFactoryParams, java.util.Collection<java.lang.String> ioAdapters)
          Exports documents as an streamable archive - using all options
 java.lang.String externalizeExport(java.lang.String repo, java.lang.String docReaderFactoryName, java.util.Map<java.lang.String,java.lang.Object> readerFactoryParams, java.util.Collection<java.lang.String> ioAdapters)
          Exports the documents and resources using custom DocumentReader that will be created by specified readerFactoryName.
 IOResourceAdapter getAdapter(java.lang.String name)
          Returns the adapter with given name.
 void importDocumentsAndResources(java.io.InputStream in, java.lang.String repo, DocumentRef root)
          Import document and resources described by given input stream at given document location.
 void importExportedFile(java.lang.String uri, DocumentLocation targetLocation)
          Will be called after a successful export to import data from the file.
 void importExportedFile(java.lang.String uri, DocumentLocation targetLocation, java.lang.String docWriterFactoryClassName, java.util.Map<java.lang.String,java.lang.Object> wFactoryParams)
          Will be called after a successful export to import data from the file.
 void importFromStreamSource(java.lang.String uri, DocumentLocation targetLocation, java.lang.String docReaderFactoryClassName, java.util.Map<java.lang.String,java.lang.Object> rFactoryParams, java.lang.String docWriterFactoryClassName, java.util.Map<java.lang.String,java.lang.Object> wFactoryParams)
           
 void removeAdapter(java.lang.String name)
          Removes adapter with given name.
 

Field Detail

DOCUMENTS_ADAPTER_NAME

static final java.lang.String DOCUMENTS_ADAPTER_NAME
See Also:
Constant Field Values
Method Detail

getAdapter

IOResourceAdapter getAdapter(java.lang.String name)
                             throws ClientException
Returns the adapter with given name.

Throws:
ClientException

addAdapter

void addAdapter(java.lang.String name,
                IOResourceAdapter adapter)
                throws ClientException
Adds an adapter with given name and definition.

Throws:
ClientException

removeAdapter

void removeAdapter(java.lang.String name)
                   throws ClientException
Removes adapter with given name.

Throws:
ClientException

importDocumentsAndResources

void importDocumentsAndResources(java.io.InputStream in,
                                 java.lang.String repo,
                                 DocumentRef root)
                                 throws java.io.IOException,
                                        ClientException,
                                        ImportDocumentException
Import document and resources described by given input stream at given document location.

Parameters:
in - stream representing the documents and resources to import. Can be a zip file of a group of export files. The service is responsible for unzipping and redirecting import to specific import services.
repo - the repository name.
root - Optional location of document that must be taken as root of the import (can be null).
Throws:
java.io.IOException
ClientException
ImportDocumentException - TODO

exportDocumentsAndResources

void exportDocumentsAndResources(java.io.OutputStream out,
                                 java.lang.String repo,
                                 java.util.Collection<DocumentRef> sources,
                                 boolean recurse,
                                 java.lang.String format,
                                 java.util.Collection<java.lang.String> ioAdapters)
                                 throws java.io.IOException,
                                        ClientException,
                                        ExportDocumentException
Export documents and resources.

Parameters:
out - stream that can be turned into a zip holding a group of file for each additional resources types.
repo - TODO
sources - locations of documents to export.
recurse - recurse into sources children
format - export format. XXX see what format is actually accepted.
ioAdapters - list of adapters to use for additional resources.
Throws:
java.io.IOException
ClientException
ExportDocumentException - TODO

copyDocumentsAndResources

java.util.Collection<DocumentRef> copyDocumentsAndResources(java.lang.String repo,
                                                            java.util.Collection<DocumentRef> sources,
                                                            DocumentLocation targetLocation,
                                                            java.util.Collection<java.lang.String> ioAdapters)
                                                            throws ClientException
Copy documents and resources to another location (on a same machine).

Parameters:
repo - the initial repository name.
sources - locations of documents to export.
targetLocation - location of the document where copies must be placed.
ioAdapters - list of adapters to use for additional resources.
Returns:
the list of copied documents references.
Throws:
ClientException

copyDocumentsAndResources

void copyDocumentsAndResources(java.lang.String repo,
                               java.util.Collection<DocumentRef> sources,
                               java.lang.String serverAddress,
                               int jndiPort,
                               DocumentLocation targetLocation,
                               java.util.Collection<java.lang.String> ioAdapters)
                               throws ClientException
Remote copy. Copy documents and resources to another location.

Throws:
ClientException

copyDocumentsAndResources

void copyDocumentsAndResources(java.lang.String repo,
                               java.util.Collection<DocumentRef> sources,
                               IOManager remoteIOManager,
                               DocumentLocation targetLocation,
                               java.util.Collection<java.lang.String> ioAdapters)
                               throws ClientException
Remote copy. Copy documents and resources to another location.

Throws:
ClientException

copyDocumentsAndResources

void copyDocumentsAndResources(java.lang.String repo,
                               java.util.Collection<DocumentRef> sources,
                               java.lang.String serverAddress,
                               int jndiPort,
                               DocumentLocation targetLocation,
                               java.lang.String docReaderFactoryClassName,
                               java.util.Map<java.lang.String,java.lang.Object> rFactoryParams,
                               java.lang.String docWriterFactoryClassName,
                               java.util.Map<java.lang.String,java.lang.Object> wFactoryParams,
                               java.util.Collection<java.lang.String> ioAdapters)
                               throws ClientException
Copies documents and resources associated with the given sources from the local repository to a remote repository instance (available on a machine with the given serverAddress).

Also if there are custom DocumentReader and DocumentWriter classes that should be used when externalizing documents and/or when re-creating them at the remote location, they could be created through specific factory classes (specified as class names). These factory classes are instantiated and provided with the given factoryParams in order to build custom DocumentReader or DocumentWriter objects.

Parameters:
repo -
sources -
serverAddress -
jndiPort -
targetLocation -
docReaderFactoryClassName - classname for a DocumentReaderFactory custom implementation
rFactoryParams - params to be given to custom DocumentReaderFactory to create DocumentReader
docWriterFactoryClassName - classname for a DocumentWriterFactory custom implementation
wFactoryParams - params to be given to custom DocumentWriterFactory to create DocumentWriter
ioAdapters -
Throws:
ClientException

externalizeExport

java.lang.String externalizeExport(java.lang.String repo,
                                   java.util.Collection<DocumentRef> sources,
                                   java.util.Collection<java.lang.String> ioAdapters)
                                   throws ClientException
Exports the documents and resources specified by sources and creates an external reachable URI (through stream service) from where a client could download the export.

Parameters:
repo -
sources -
ioAdapters -
Returns:
Throws:
ClientException

externalizeExport

java.lang.String externalizeExport(java.lang.String repo,
                                   java.lang.String docReaderFactoryName,
                                   java.util.Map<java.lang.String,java.lang.Object> readerFactoryParams,
                                   java.util.Collection<java.lang.String> ioAdapters)
                                   throws ClientException
Exports the documents and resources using custom DocumentReader that will be created by specified readerFactoryName. Creates an external reachable URI (through stream service) from where a client could download the export.

Parameters:
repo -
docReaderFactoryName -
readerFactoryParams -
ioAdapters -
Returns:
Throws:
ClientException

externalizeExport

java.lang.String externalizeExport(java.lang.String repo,
                                   java.util.Collection<DocumentRef> sources,
                                   java.lang.String docReaderFactoryName,
                                   java.util.Map<java.lang.String,java.lang.Object> readerFactoryParams,
                                   java.util.Collection<java.lang.String> ioAdapters)
                                   throws ClientException
Exports documents as an streamable archive - using all options

Parameters:
repo -
sources -
docReaderFactoryName -
readerFactoryParams -
ioAdapters -
Returns:
Throws:
ClientException

disposeExport

void disposeExport(java.lang.String uri)
                   throws ClientException
Should be called by client code after using the export created by calling the externalizeExport(java.lang.String, java.util.Collection, java.util.Collection).

Parameters:
uri -
Throws:
ClientException

importExportedFile

void importExportedFile(java.lang.String uri,
                        DocumentLocation targetLocation)
                        throws ClientException
Will be called after a successful export to import data from the file.

Parameters:
uri -
targetLocation -
Throws:
ClientException

importExportedFile

void importExportedFile(java.lang.String uri,
                        DocumentLocation targetLocation,
                        java.lang.String docWriterFactoryClassName,
                        java.util.Map<java.lang.String,java.lang.Object> wFactoryParams)
                        throws ClientException
Will be called after a successful export to import data from the file.

Parameters:
uri -
targetLocation -
docWriterFactoryClassName -
wFactoryParams -
Throws:
ClientException

importFromStreamSource

void importFromStreamSource(java.lang.String uri,
                            DocumentLocation targetLocation,
                            java.lang.String docReaderFactoryClassName,
                            java.util.Map<java.lang.String,java.lang.Object> rFactoryParams,
                            java.lang.String docWriterFactoryClassName,
                            java.util.Map<java.lang.String,java.lang.Object> wFactoryParams)
                            throws ClientException
Throws:
ClientException

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.