Class AggregateManagerImpl
java.lang.Object
org.apache.jackrabbit.vault.fs.impl.AggregateManagerImpl
- All Implemented Interfaces:
AggregateManager,NodeTypesCollector
The artifact manager exposes an artifact node tree using the configured
aggregators and serializers.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddNodeTypes(Node node) Add the primary and mixin node types of that node to the internal set of used node types.voiddumpConfig(PrintWriter out) Dumps the configuration to the given writer for debugging purposes.getAggregator(Node node, String path) Returns the aggregator for the given node ornullif none found.Returns the configstatic VaultFsConfigReturns the default configstatic VaultFsConfigReturns the default configstatic DefaultWorkspaceFilterReturns the default workspace filterReturns the repository address of the mountpoint of this artifacts node tree.getNamespaceURI(String prefix) Returns the node types used in the aggregates (so far).getRoot()Returns the root aggregate of the treeReturns the session of this manager.Returns the user id of the session of this manager.Returns the name of the workspace of this manager.Returns the workspace filter.booleanChecks if this tree is still mounted and if the attached session is still live.static AggregateManagermount(VaultFsConfig config, WorkspaceFilter wspFilter, Repository rep, Credentials credentials, RepositoryAddress mountpoint) Creates a new artifact manager that is rooted at the given path using the provided repository, credentials and workspace to create the session.static AggregateManagermount(VaultFsConfig config, WorkspaceFilter wspFilter, RepositoryAddress mountpoint, Session session) Creates a new artifact manager that is rooted at the given node.voidvoidvoidvoidstartTracking(ProgressTrackerListener pTracker) Starts tracking aggregate lifecyclesvoidStops tracking of aggregate lifecyclevoidunmount()Releases all resources attached to this artifact managerwriteAggregate(AggregateImpl node, String reposName, ArtifactSetImpl artifacts) Writes the artifact set back to the repository.
-
Method Details
-
mount
public static AggregateManager mount(VaultFsConfig config, WorkspaceFilter wspFilter, RepositoryAddress mountpoint, Session session) throws RepositoryException Creates a new artifact manager that is rooted at the given node.- Parameters:
config- fs configwspFilter- the workspace filtermountpoint- the address of the mountpointsession- the repository session- Returns:
- an artifact manager
- Throws:
RepositoryException- if an error occurs.
-
mount
public static AggregateManager mount(VaultFsConfig config, WorkspaceFilter wspFilter, Repository rep, Credentials credentials, RepositoryAddress mountpoint) throws RepositoryException Creates a new artifact manager that is rooted at the given path using the provided repository, credentials and workspace to create the session.- Parameters:
config- fs configwspFilter- the workspace filterrep- the jcr repositorycredentials- the credentialsmountpoint- the address of the mountpoint- Returns:
- an artifact manager
- Throws:
RepositoryException- if an error occurs.
-
getDefaultConfig
Returns the default config- Returns:
- the default config
-
getDefaultBinaryReferencesConfig
Returns the default config- Returns:
- the default config
-
getDefaultWorkspaceFilter
Returns the default workspace filter- Returns:
- the default workspace filter
-
unmount
Description copied from interface:AggregateManagerReleases all resources attached to this artifact manager- Specified by:
unmountin interfaceAggregateManager- Throws:
RepositoryException- if an error occurs.
-
getRoot
Description copied from interface:AggregateManagerReturns the root aggregate of the tree- Specified by:
getRootin interfaceAggregateManager- Returns:
- the root aggregate.
- Throws:
RepositoryException- if an error occurs.
-
getMountpoint
Description copied from interface:AggregateManagerReturns the repository address of the mountpoint of this artifacts node tree.- Specified by:
getMountpointin interfaceAggregateManager- Returns:
- the mountpoint
-
getNodeTypes
Description copied from interface:NodeTypesCollectorReturns the node types used in the aggregates (so far).- Specified by:
getNodeTypesin interfaceNodeTypesCollector- Returns:
- node types
-
addNodeTypes
Add the primary and mixin node types of that node to the internal set of used node types.- Specified by:
addNodeTypesin interfaceNodeTypesCollector- Parameters:
node- the node- Throws:
RepositoryException- if an error occurs
-
getNamespaceURI
- Throws:
RepositoryException
-
startTracking
Description copied from interface:AggregateManagerStarts tracking aggregate lifecycles- Specified by:
startTrackingin interfaceAggregateManager- Parameters:
pTracker- optional listener
-
stopTracking
public void stopTracking()Description copied from interface:AggregateManagerStops tracking of aggregate lifecycle- Specified by:
stopTrackingin interfaceAggregateManager
-
onAggregateCreated
public void onAggregateCreated() -
onAggregateCollected
public void onAggregateCollected() -
onAggregatePrepared
public void onAggregatePrepared() -
getAggregator
Description copied from interface:AggregateManagerReturns the aggregator for the given node ornullif none found.- Specified by:
getAggregatorin interfaceAggregateManager- Parameters:
node- for which the aggregator is to be returnedpath- the path of the node ornull- Returns:
- the aggregator or
null - Throws:
RepositoryException- if a repository error occurs.
-
getWorkspaceFilter
Description copied from interface:AggregateManagerReturns the workspace filter.- Specified by:
getWorkspaceFilterin interfaceAggregateManager- Returns:
- the workspace filter.
-
writeAggregate
public ImportInfo writeAggregate(AggregateImpl node, String reposName, ArtifactSetImpl artifacts) throws RepositoryException, IOException Writes the artifact set back to the repository.- Parameters:
node- the artifact node to writereposName- the name of the new node ornullartifacts- the artifact to write- Returns:
- infos about the modifications
- Throws:
RepositoryException- if an error occurs.IOException- if an I/O error occurs.
-
isMounted
public boolean isMounted()Description copied from interface:AggregateManagerChecks if this tree is still mounted and if the attached session is still live.- Specified by:
isMountedin interfaceAggregateManager- Returns:
trueif still mounted
-
getUserId
Description copied from interface:AggregateManagerReturns the user id of the session of this manager.- Specified by:
getUserIdin interfaceAggregateManager- Returns:
- the user id.
- Throws:
RepositoryException- if an error occurs.
-
getWorkspace
Description copied from interface:AggregateManagerReturns the name of the workspace of this manager.- Specified by:
getWorkspacein interfaceAggregateManager- Returns:
- the name of the workspace.
- Throws:
RepositoryException- if an error occurs.
-
getSession
Description copied from interface:AggregateManagerReturns the session of this manager.- Specified by:
getSessionin interfaceAggregateManager- Returns:
- the jcr session
-
dumpConfig
Description copied from interface:AggregateManagerDumps the configuration to the given writer for debugging purposes.- Specified by:
dumpConfigin interfaceAggregateManager- Parameters:
out- the writer- Throws:
IOException- if an I/O error occurs
-
getConfig
Description copied from interface:AggregateManagerReturns the config- Specified by:
getConfigin interfaceAggregateManager- Returns:
- the config
-