Class AggregateManagerImpl
- java.lang.Object
-
- org.apache.jackrabbit.vault.fs.impl.AggregateManagerImpl
-
- All Implemented Interfaces:
AggregateManager,NodeTypesCollector
public class AggregateManagerImpl extends Object implements AggregateManager
The artifact manager exposes an artifact node tree using the configured aggregators and serializers.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNodeTypes(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.AggregatorgetAggregator(Node node, String path)Returns the aggregator for the given node ornullif none found.VaultFsConfiggetConfig()Returns the configstatic VaultFsConfiggetDefaultBinaryReferencesConfig()Returns the default configstatic VaultFsConfiggetDefaultConfig()Returns the default configstatic DefaultWorkspaceFiltergetDefaultWorkspaceFilter()Returns the default workspace filterRepositoryAddressgetMountpoint()Returns the repository address of the mountpoint of this artifacts node tree.StringgetNamespaceURI(String prefix)Set<String>getNodeTypes()Returns the node types used in the aggregates (so far).AggregateImplgetRoot()Returns the root aggregate of the treeSessiongetSession()Returns the session of this manager.StringgetUserId()Returns the user id of the session of this manager.StringgetWorkspace()Returns the name of the workspace of this manager.WorkspaceFiltergetWorkspaceFilter()Returns the workspace filter.booleanisMounted()Checks 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.voidonAggregateCollected()voidonAggregateCreated()voidonAggregatePrepared()voidstartTracking(ProgressTrackerListener pTracker)Starts tracking aggregate lifecyclesvoidstopTracking()Stops tracking of aggregate lifecyclevoidunmount()Releases all resources attached to this artifact managerImportInfowriteAggregate(AggregateImpl node, String reposName, ArtifactSetImpl artifacts)Writes the artifact set back to the repository.
-
-
-
Method Detail
-
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
public static VaultFsConfig getDefaultConfig()
Returns the default config- Returns:
- the default config
-
getDefaultBinaryReferencesConfig
public static VaultFsConfig getDefaultBinaryReferencesConfig()
Returns the default config- Returns:
- the default config
-
getDefaultWorkspaceFilter
public static DefaultWorkspaceFilter getDefaultWorkspaceFilter()
Returns the default workspace filter- Returns:
- the default workspace filter
-
unmount
public void unmount() throws RepositoryExceptionDescription copied from interface:AggregateManagerReleases all resources attached to this artifact manager- Specified by:
unmountin interfaceAggregateManager- Throws:
RepositoryException- if an error occurs.
-
getRoot
public AggregateImpl getRoot() throws RepositoryException
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
public RepositoryAddress 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
public Set<String> getNodeTypes()
Description copied from interface:NodeTypesCollectorReturns the node types used in the aggregates (so far).- Specified by:
getNodeTypesin interfaceNodeTypesCollector- Returns:
- node types
-
addNodeTypes
public void addNodeTypes(Node node) throws RepositoryException
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
public String getNamespaceURI(String prefix) throws RepositoryException
- Throws:
RepositoryException
-
startTracking
public void startTracking(ProgressTrackerListener pTracker)
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
public Aggregator getAggregator(Node node, String path) throws RepositoryException
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
public WorkspaceFilter 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
public String getUserId() throws RepositoryException
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
public String getWorkspace() throws RepositoryException
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
public Session getSession()
Description copied from interface:AggregateManagerReturns the session of this manager.- Specified by:
getSessionin interfaceAggregateManager- Returns:
- the jcr session
-
dumpConfig
public void dumpConfig(PrintWriter out) throws IOException
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
public VaultFsConfig getConfig()
Description copied from interface:AggregateManagerReturns the config- Specified by:
getConfigin interfaceAggregateManager- Returns:
- the config
-
-