Package org.apache.jackrabbit.server.io
Class VersionHandler
- java.lang.Object
-
- org.apache.jackrabbit.server.io.DefaultHandler
-
- org.apache.jackrabbit.server.io.VersionHandler
-
- All Implemented Interfaces:
CopyMoveHandler,DeleteHandler,IOHandler,PropertyHandler
public class VersionHandler extends DefaultHandler implements IOHandler
-
-
Constructor Summary
Constructors Constructor Description VersionHandler()VersionHandler(IOManager ioManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanExport(ExportContext context, boolean isCollection)Returns true if the export root is a node and if it contains a child node with namejcr:contentin case this export is not intended for a collection.booleancanExport(ExportContext context, DavResource resource)Returns true, if this handler can run a successful export based on the specified context and resource.booleancanImport(ImportContext context, boolean isCollection)Returns true, if this handler can run a successful import based on the specified context.booleancanImport(ImportContext context, DavResource resource)Returns true, if this handler can run a successful import based on the specified context and resource.booleancanImport(PropertyImportContext context, boolean isCollection)Returns true, if this handler can run a property import based on the specified context.booleanexportProperties(PropertyExportContext exportContext, boolean isCollection)Exports properties to the given context.protected NodegetContentNode(ExportContext context, boolean isCollection)Retrieves the content node that contains the data to be exported.booleanimportContent(ImportContext context, boolean isCollection)Runs the import for the given context and indicates by a boolean return value, if the import could be completed successfully.booleanimportContent(ImportContext context, DavResource resource)Runs the import for the given context and resource.Map<? extends PropEntry,?>importProperties(PropertyImportContext importContext, boolean isCollection)Imports, modifies or removes properties according the thechange listavailable from the import context.-
Methods inherited from class org.apache.jackrabbit.server.io.DefaultHandler
canCopy, canDelete, canExport, canMove, copy, delete, detect, exportContent, exportContent, exportData, exportProperties, forceCompatibleContentNodes, getCollectionNodeType, getContentNode, getContentNodeType, getIOManager, getName, getNodeType, importData, importProperties, move, setCollectionNodetype, setContentNodetype, setDefaultNodetype, setIOManager
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.server.io.IOHandler
exportContent, exportContent, getIOManager, getName, setIOManager
-
-
-
-
Constructor Detail
-
VersionHandler
public VersionHandler()
-
VersionHandler
public VersionHandler(IOManager ioManager)
-
-
Method Detail
-
canImport
public boolean canImport(ImportContext context, boolean isCollection)
Description copied from interface:IOHandlerReturns true, if this handler can run a successful import based on the specified context.- Specified by:
canImportin interfaceIOHandler- Overrides:
canImportin classDefaultHandler- See Also:
IOHandler.canImport(ImportContext, boolean)
-
canImport
public boolean canImport(ImportContext context, DavResource resource)
Description copied from interface:IOHandlerReturns true, if this handler can run a successful import based on the specified context and resource. A simple implementation may choose to return the same asIOHandler.canImport(ImportContext, boolean)where the isCollection flag is determined byDavResource.isCollection().- Specified by:
canImportin interfaceIOHandler- Overrides:
canImportin classDefaultHandler- See Also:
IOHandler.canImport(ImportContext, DavResource)
-
importContent
public boolean importContent(ImportContext context, boolean isCollection) throws IOException
Description copied from interface:IOHandlerRuns the import for the given context and indicates by a boolean return value, if the import could be completed successfully. If the specifiedImportContextdoes not provide astreamthe implementation is free, to only import properties of to refuse the import.Please note, that it is the responsibility of the specified
ImportContextto assert, that its stream is not consumed multiple times when being passed to a chain ofIOHandlers.- Specified by:
importContentin interfaceIOHandler- Overrides:
importContentin classDefaultHandler- Returns:
- true if the import was successful.
- Throws:
IOException- if an unexpected error occurs or if this method has been called althoughIOHandler.canImport(ImportContext, boolean)returns false.- See Also:
IOHandler.importContent(ImportContext, boolean)
-
importContent
public boolean importContent(ImportContext context, DavResource resource) throws IOException
Description copied from interface:IOHandlerRuns the import for the given context and resource. It indicates by a boolean return value, if the import could be completed successfully. If the specifiedImportContextdoes not provide astreamthe implementation is free, to only import properties of to refuse the import. A simple implementation may return the same asIOHandler.importContent(ImportContext, boolean)where the isCollection flag is determined byDavResource.isCollection()Please note, that it is the responsibility of the specified
ImportContextto assert, that its stream is not consumed multiple times when being passed to a chain ofIOHandlers.- Specified by:
importContentin interfaceIOHandler- Overrides:
importContentin classDefaultHandler- Returns:
- Throws:
IOException- if an unexpected error occurs or if this method has been called althoughIOHandler.canImport(ImportContext, DavResource)returns false.- See Also:
IOHandler.importContent(ImportContext, DavResource)
-
canExport
public boolean canExport(ExportContext context, boolean isCollection)
Description copied from class:DefaultHandlerReturns true if the export root is a node and if it contains a child node with namejcr:contentin case this export is not intended for a collection.- Specified by:
canExportin interfaceIOHandler- Overrides:
canExportin classDefaultHandler- Parameters:
context-isCollection-- Returns:
- true if the export root is a
Versionnode. False otherwise. - See Also:
IOHandler.canExport(ExportContext, boolean)
-
canExport
public boolean canExport(ExportContext context, DavResource resource)
Description copied from interface:IOHandlerReturns true, if this handler can run a successful export based on the specified context and resource. A simple implementation may choose to return the same asIOHandler.canExport(ExportContext, boolean)where the isCollection flag is determined byDavResource.isCollection().- Specified by:
canExportin interfaceIOHandler- Overrides:
canExportin classDefaultHandler- Returns:
- true if the export root is a
Versionnode. False otherwise. - See Also:
IOHandler.canExport(ExportContext, DavResource)
-
canImport
public boolean canImport(PropertyImportContext context, boolean isCollection)
Description copied from interface:PropertyHandlerReturns true, if this handler can run a property import based on the specified context.- Specified by:
canImportin interfacePropertyHandler- Overrides:
canImportin classDefaultHandler- Returns:
- true if this
PropertyHandlercan import properties given the specified parameters.
-
importProperties
public Map<? extends PropEntry,?> importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException
Description copied from interface:PropertyHandlerImports, modifies or removes properties according the thechange listavailable from the import context. Note, that according to JSR 170 setting a property value tonullis equivalent to its removal.The return value of this method must be used to provided detailed information about any kind of failures.
- Specified by:
importPropertiesin interfacePropertyHandler- Overrides:
importPropertiesin classDefaultHandler- Returns:
- Map listing those properties that failed to be updated. An empty map indicates a successful import for all properties listed in the context.
- Throws:
RepositoryException- IfPropertyHandler.canImport(PropertyImportContext, boolean)returns false for the given parameters or if some other unrecoverable error occurred. Note, that normal failure of a property update must be reported with the return value and should not result in an exception.
-
exportProperties
public boolean exportProperties(PropertyExportContext exportContext, boolean isCollection) throws RepositoryException
Description copied from interface:PropertyHandlerExports properties to the given context. Note that the export must be consistent with properties that might be exposed by content export such as defined byIOHandler.exportContent(ExportContext, boolean).- Specified by:
exportPropertiesin interfacePropertyHandler- Overrides:
exportPropertiesin classDefaultHandler- Returns:
- true if the export succeeded.
- Throws:
RepositoryException- If an attempt is made to export properties even ifPropertyHandler.canExport(PropertyExportContext, boolean)returns false or if some other unrecoverable error occurs.- See Also:
PropertyHandler.exportProperties(PropertyExportContext, boolean)
-
getContentNode
protected Node getContentNode(ExportContext context, boolean isCollection) throws RepositoryException
Retrieves the content node that contains the data to be exported.- Overrides:
getContentNodein classDefaultHandler- Parameters:
context-isCollection-- Returns:
- content node used for the export
- Throws:
RepositoryException
-
-