org.apache.jackrabbit.server.io
Interface PropertyHandler

All Known Implementing Classes:
DefaultHandler, DirListingExportHandler, VersionHandler, VersionHistoryHandler, XmlHandler, ZipHandler

public interface PropertyHandler

PropertyHandler interface defines methods for importing and exporting resource properties.


Method Summary
 boolean canExport(PropertyExportContext context, boolean isCollection)
          Returns true, if this handler can run a successful export based on the specified context.
 boolean canImport(PropertyImportContext context, boolean isCollection)
          Returns true, if this handler can run a property import based on the specified context.
 boolean exportProperties(PropertyExportContext exportContext, boolean isCollection)
          Exports properties to the given context.
 Map<? extends PropEntry,?> importProperties(PropertyImportContext importContext, boolean isCollection)
          Imports, modifies or removes properties according the the change list available from the import context.
 

Method Detail

canExport

boolean canExport(PropertyExportContext context,
                  boolean isCollection)
Returns true, if this handler can run a successful export based on the specified context.

Parameters:
context -
isCollection -
Returns:
true if this PropertyHandler is export properties given the specified parameters.

exportProperties

boolean exportProperties(PropertyExportContext exportContext,
                         boolean isCollection)
                         throws RepositoryException
Exports properties to the given context. Note that the export must be consistent with properties that might be exposed by content export such as defined by IOHandler.exportContent(ExportContext, boolean).

Parameters:
exportContext -
isCollection -
Returns:
true if the export succeeded.
Throws:
RepositoryException - If an attempt is made to export properties even if PropertyHandler#canExport{PropertyExportContext, boolean)} returns false or if some other unrecoverable error occurs.

canImport

boolean canImport(PropertyImportContext context,
                  boolean isCollection)
Returns true, if this handler can run a property import based on the specified context.

Parameters:
context -
isCollection -
Returns:
true if this PropertyHandler can import properties given the specified parameters.

importProperties

Map<? extends PropEntry,?> importProperties(PropertyImportContext importContext,
                                            boolean isCollection)
                                            throws RepositoryException
Imports, modifies or removes properties according the the 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.

Parameters:
importContext -
isCollection -
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 - If canImport(PropertyImportContext, boolean) returns false for the given parameters or if some other unrecoverable error occured. Note, that normal failure of a property update must be reported with the return value and should not result in an exception.


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.