Interface Merger
-
- All Known Implementing Classes:
Mergers.AbstractMerger
,Mergers.DeleteBefore
,Mergers.Fail
,Mergers.Ignore
,Mergers.Replace
public interface Merger
A merger, which is responsible to handle UUID collision when encountered.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Merger.AfterMerge
The result ofmerge(java.lang.String)
.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
deleteBeforePartialImport()
int
getImportUuidBehavior()
Gets the UUID Behavior for JCR import
SeeImportUUIDBehavior
andSession.importXML(String, java.io.InputStream, int)
default void
jcrImportXml(Session session, String parentAbsPath, InputStream in)
Does a JCR import from the XML read from the givenInputStream
The save operation must be made by the caller.Merger.AfterMerge
merge(String id)
Merges the existing object with given idboolean
needsMerge(String id)
Returnstrue
if the object with the given id needs to be merged
-
-
-
Method Detail
-
deleteBeforePartialImport
default boolean deleteBeforePartialImport()
- Returns:
true
if existing objects must be deleted
-
needsMerge
boolean needsMerge(String id)
Returnstrue
if the object with the given id needs to be merged- Parameters:
id
- The id- Returns:
true
if the object with the given id needs to be merged
-
merge
Merger.AfterMerge merge(String id) throws MergeException
Merges the existing object with given id- Parameters:
id
- The id- Returns:
- What the caller must do after this method is finished.
- Throws:
MergeException
- If the merge cannot be done. This exception must propagate and stop the global import process.
-
getImportUuidBehavior
int getImportUuidBehavior()
Gets the UUID Behavior for JCR import
SeeImportUUIDBehavior
andSession.importXML(String, java.io.InputStream, int)
- Returns:
- the UUID Behavior
-
jcrImportXml
default void jcrImportXml(Session session, String parentAbsPath, InputStream in) throws RepositoryException, IOException
Does a JCR import from the XML read from the givenInputStream
The save operation must be made by the caller.
TheInputStream
must be closed by the caller.
Default implementation usesSession.importXML(java.lang.String, java.io.InputStream, int)
- Parameters:
session
- The JCRSession
parentAbsPath
- the absolute path of the node below which the deserialized subgraph is added.in
- TheInputStream
from which the XML to be deserialized is read.- Throws:
RepositoryException
- if another error occurs.IOException
- if an error during an I/O operation occurs.
-
-