Class AggregateImpl
- java.lang.Object
-
- org.apache.jackrabbit.vault.fs.impl.AggregateImpl
-
public class AggregateImpl extends Object implements Aggregate
Collects the items that form an aggregate. The aggregates form a tree on top of the repository one by invoking the respective aggregators. The aggregates are controlled via theAggregateManagerImpland are loaded dynamically when traversing through the tree.The aggregates can then later be used by the aggregators to provide the artifacts of this aggregate.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.LoggerlogThe default logger
-
Constructor Summary
Constructors Modifier Constructor Description protectedAggregateImpl(AggregateImpl parent, String path, Aggregator aggregator)Creates a new sub aggregateprotectedAggregateImpl(AggregateManagerImpl mgr, String path, Aggregator aggregator)Creates a new root aggregate
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsChildren()Checks if this artifact node possibly allows children, i.e. is a folder.AggregateBuildercreate(String reposName)Creates a new child artifact node with the given name.voiddump(DumpContext ctx, boolean isLast)Dumps some human readable information using the given context.AggregategetAggregate(String relPath)ArtifactSetgetArtifacts()Returns the artifacts of this node.Collection<Property>getBinaries()Returns the collection of binary properties in this aggregateAggregateBuildergetBuilder()Returns an artifact output for this node that allows writing the artifacts.List<? extends Aggregate>getLeaves()Returns the leaves of this aggregate ornull.AggregateManagerImplgetManager()Returns the artifact manager this node belongs to.StringgetName()Returns the name of this aggregate.String[]getNamespacePrefixes()StringgetNamespaceURI(String prefix)NodegetNode()AggregategetParent()StringgetPath()StringgetRelPath()Returns the relative path of this aggregate in respect to it's parent aggregate.RepositoryAddressgetRepositoryAddress()Returns the (absolute) repository address to the node that this artifact node represents.booleanhasNode()voidinvalidate()booleanisAttached()Checks if this aggregate has an aggregator and its node exists.ImportInforemove(boolean recursive)Removes this artifact node from the tree.voidwalk(org.apache.jackrabbit.vault.fs.impl.io.AggregateWalkListener aggregateWalkListener)Walks the node tree and invokes the callbacks in the listener according to the configured filters.
-
-
-
Constructor Detail
-
AggregateImpl
protected AggregateImpl(AggregateManagerImpl mgr, String path, Aggregator aggregator) throws RepositoryException
Creates a new root aggregate- Parameters:
mgr- Aggregate managerpath- the path of the aggregateaggregator- aggregator- Throws:
RepositoryException- if a error occurs
-
AggregateImpl
protected AggregateImpl(AggregateImpl parent, String path, Aggregator aggregator) throws RepositoryException
Creates a new sub aggregate- Parameters:
parent- parent aggregatepath- path of aggregateaggregator- aggregator- Throws:
RepositoryException- if a error occurs
-
-
Method Detail
-
getNode
public Node getNode() throws RepositoryException
- Specified by:
getNodein interfaceAggregate- Throws:
RepositoryException
-
hasNode
public boolean hasNode() throws RepositoryException- Specified by:
hasNodein interfaceAggregate- Throws:
RepositoryException
-
invalidate
public void invalidate()
-
getRepositoryAddress
public RepositoryAddress getRepositoryAddress() throws RepositoryException
Description copied from interface:AggregateReturns the (absolute) repository address to the node that this artifact node represents.- Specified by:
getRepositoryAddressin interfaceAggregate- Returns:
- the repository address
- Throws:
RepositoryException- if an error occurs.
-
allowsChildren
public boolean allowsChildren()
Description copied from interface:AggregateChecks if this artifact node possibly allows children, i.e. is a folder.- Specified by:
allowsChildrenin interfaceAggregate- Returns:
trueif this artifact node allows children;falseotherwise.
-
getRelPath
public String getRelPath()
Description copied from interface:AggregateReturns the relative path of this aggregate in respect to it's parent aggregate.- Specified by:
getRelPathin interfaceAggregate- Returns:
- the relative path
-
getName
public String getName()
Description copied from interface:AggregateReturns the name of this aggregate.
-
getLeaves
public List<? extends Aggregate> getLeaves() throws RepositoryException
Description copied from interface:AggregateReturns the leaves of this aggregate ornull.- Specified by:
getLeavesin interfaceAggregate- Returns:
- the leaves
- Throws:
RepositoryException- if an error occurs
-
getAggregate
public Aggregate getAggregate(String relPath) throws RepositoryException
- Specified by:
getAggregatein interfaceAggregate- Throws:
RepositoryException
-
getArtifacts
public ArtifactSet getArtifacts() throws RepositoryException
Description copied from interface:AggregateReturns the artifacts of this node.- Specified by:
getArtifactsin interfaceAggregate- Returns:
- the artifacts
- Throws:
RepositoryException- if this file is not attached to the fs, yet.
-
getBuilder
public AggregateBuilder getBuilder() throws RepositoryException
Returns an artifact output for this node that allows writing the artifacts.- Returns:
- an artifact output.
- Throws:
RepositoryException- if this file is not attached to the fs, yet.
-
create
public AggregateBuilder create(String reposName) throws RepositoryException
Creates a new child artifact node with the given name. Please note, that the returned node is not attached to the tree.If this artifact node does not allow children a RepositoryException is thrown.
- Parameters:
reposName- the (repository) name for the new node- Returns:
- a new child node.
- Throws:
RepositoryException- if an error occurs.
-
remove
public ImportInfo remove(boolean recursive) throws RepositoryException
Removes this artifact node from the tree. If this artifact node has directory and non-directory artifacts only the non-directory artifacts are removed unlessrecursiveis specified.- Parameters:
recursive- specifies if directories are removed as well.- Returns:
- infos about the modifications
- Throws:
RepositoryException- if an error occurs.
-
getManager
public AggregateManagerImpl getManager()
Description copied from interface:AggregateReturns the artifact manager this node belongs to.- Specified by:
getManagerin interfaceAggregate- Returns:
- the Vault filesystem.
-
isAttached
public boolean isAttached() throws RepositoryExceptionDescription copied from interface:AggregateChecks if this aggregate has an aggregator and its node exists.- Specified by:
isAttachedin interfaceAggregate- Returns:
trueif this aggregate is attached- Throws:
RepositoryException- if an error occurs
-
dump
public void dump(DumpContext ctx, boolean isLast)
Dumps some human readable information using the given context.
-
getNamespacePrefixes
public String[] getNamespacePrefixes()
- Specified by:
getNamespacePrefixesin interfaceAggregate
-
getNamespaceURI
public String getNamespaceURI(String prefix) throws RepositoryException
- Specified by:
getNamespaceURIin interfaceAggregate- Throws:
RepositoryException
-
getBinaries
public Collection<Property> getBinaries()
Description copied from interface:AggregateReturns the collection of binary properties in this aggregate- Specified by:
getBinariesin interfaceAggregate- Returns:
- the binaries or
null
-
walk
public void walk(org.apache.jackrabbit.vault.fs.impl.io.AggregateWalkListener aggregateWalkListener) throws RepositoryExceptionWalks the node tree and invokes the callbacks in the listener according to the configured filters. For each tree there are the following events generated: events := OnWalkBegin { nodeEvent } OnWalkEnd; nodeEvent := OnNodeBegin { propEvent } OnChildBegin { nodeEvent } OnNodeEnd; propEvent := OnProperty;- Parameters:
aggregateWalkListener- the listener that receives the events- Throws:
RepositoryException- if an repository error occurs.
-
-