public class VersionHistoryHandler extends Object implements IOHandler, PropertyHandler
VersionHistoryHandler
...Constructor and Description |
---|
VersionHistoryHandler() |
VersionHistoryHandler(IOManager ioManager) |
Modifier and Type | Method and Description |
---|---|
boolean |
canExport(ExportContext context,
boolean isCollection)
Returns true, if this handler can run a successful export based on the
specified context.
|
boolean |
canExport(ExportContext context,
DavResource resource)
Returns true, if this handler can run a successful export based on
the specified context and resource.
|
boolean |
canExport(PropertyExportContext context,
boolean isCollection)
Returns true, if this handler can run a successful export based on the
specified context.
|
boolean |
canImport(ImportContext context,
boolean isCollection)
Returns true, if this handler can run a successful import based on the
specified context.
|
boolean |
canImport(ImportContext context,
DavResource resource)
Returns true, if this handler can run a successful import based on
the specified context and resource.
|
boolean |
canImport(PropertyImportContext context,
boolean isCollection)
Returns true, if this handler can run a property import based on the
specified context.
|
boolean |
exportContent(ExportContext context,
boolean isCollection)
Runs the export for the given context.
|
boolean |
exportContent(ExportContext context,
DavResource resource)
Runs the export for the given context and resource.
|
boolean |
exportProperties(PropertyExportContext exportContext,
boolean isCollection)
Exports properties to the given context.
|
IOManager |
getIOManager()
Returns the
IOManager that called this handler or null . |
String |
getName()
Returns a human readable name for this
IOHandler . |
boolean |
importContent(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.
|
boolean |
importContent(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 the
change list available from
the import context. |
void |
setIOManager(IOManager ioManager)
Sets the
IOManager that called this handler. |
public VersionHistoryHandler()
public VersionHistoryHandler(IOManager ioManager)
public IOManager getIOManager()
IOHandler
IOManager
that called this handler or null
.getIOManager
in interface IOHandler
public void setIOManager(IOManager ioManager)
IOHandler
IOManager
that called this handler.setIOManager
in interface IOHandler
public String getName()
IOHandler
IOHandler
.public boolean canImport(ImportContext context, boolean isCollection)
IOHandler
public boolean canImport(ImportContext context, DavResource resource)
IOHandler
IOHandler.canImport(ImportContext, boolean)
where the isCollection flag is determined by
DavResource.isCollection()
.public boolean importContent(ImportContext context, boolean isCollection) throws IOException
IOHandler
ImportContext
does not provide a stream
the implementation is free, to only import properties of to refuse the
import.
Please note, that it is the responsibility of the specified
ImportContext
to assert, that its stream is not consumed
multiple times when being passed to a chain of IOHandler
s.
importContent
in interface IOHandler
IOException
- if an unexpected error occurs or if this method has
been called although IOHandler.canImport(ImportContext, boolean)
returns false.public boolean importContent(ImportContext context, DavResource resource) throws IOException
IOHandler
ImportContext
does not provide a stream
the implementation is free, to only import properties of to refuse the
import. A simple implementation may return the same as
IOHandler.importContent(ImportContext, boolean)
where the
isCollection flag is determined by DavResource.isCollection()
Please note, that it is the responsibility of the specified
ImportContext
to assert, that its stream is not consumed
multiple times when being passed to a chain of IOHandler
s.
importContent
in interface IOHandler
IOException
- if an unexpected error occurs or if this method has
been called although IOHandler.canImport(ImportContext, DavResource)
returns false.IOHandler.importContent(ImportContext, boolean)
public boolean canExport(ExportContext context, boolean isCollection)
IOHandler
public boolean canExport(ExportContext context, DavResource resource)
IOHandler
IOHandler.canExport(ExportContext, boolean)
where the isCollection flag is determined by
DavResource.isCollection()
.public boolean exportContent(ExportContext context, boolean isCollection) throws IOException
IOHandler
ExportContext
does not provide a stream
the implementation should set the properties only and ignore the content to
be exported. A simple implementation may return the same as
IOHandler.exportContent(ExportContext, boolean)
where the
isCollection flag is determined by DavResource.isCollection()
Please note, that it is the responsibility of the specified
ExportContext
to assert, that its stream is not written
multiple times when being passed to a chain of IOHandler
s.
exportContent
in interface IOHandler
IOException
- if an unexpected error occurs or if this method has
been called although IOHandler.canExport(ExportContext, boolean)
returns false.public boolean exportContent(ExportContext context, DavResource resource) throws IOException
IOHandler
ExportContext
does not provide a stream
the implementation should set the properties only and ignore the content to
be exported. A simple implementation may return the same as
IOHandler.exportContent(ExportContext, boolean)
where the
isCollection flag is determined by DavResource.isCollection()
Please note, that it is the responsibility of the specified
ExportContext
to assert, that its stream is not written
multiple times when being passed to a chain of IOHandler
s.
exportContent
in interface IOHandler
IOException
- if an unexpected error occurs or if this method has
been called although IOHandler.canExport(ExportContext, DavResource)
returns false.public boolean canImport(PropertyImportContext context, boolean isCollection)
PropertyHandler
canImport
in interface PropertyHandler
PropertyHandler
can import properties
given the specified parameters.public Map<? extends PropEntry,?> importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException
PropertyHandler
change list
available from
the import context. Note, that according to JSR 170 setting a property
value to null
is equivalent to its removal.
The return value of this method must be used to provided detailed information about any kind of failures.
importProperties
in interface PropertyHandler
RepositoryException
- If
PropertyHandler.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.public boolean canExport(PropertyExportContext context, boolean isCollection)
PropertyHandler
canExport
in interface PropertyHandler
PropertyHandler
is export properties
given the specified parameters.public boolean exportProperties(PropertyExportContext exportContext, boolean isCollection) throws RepositoryException
PropertyHandler
IOHandler.exportContent(ExportContext, boolean)
.exportProperties
in interface PropertyHandler
RepositoryException
- If an attempt is made to export properties
even if PropertyHandler.canExport(PropertyExportContext, boolean)
returns false or if some other unrecoverable error occurs.Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.