Class AggregateImpl

java.lang.Object
org.apache.jackrabbit.vault.fs.impl.AggregateImpl
All Implemented Interfaces:
Aggregate, Dumpable

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 the AggregateManagerImpl and 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 Details

    • log

      protected static final org.slf4j.Logger log
      The default logger
  • Constructor Details

  • Method Details

    • getNode

      public Node getNode() throws RepositoryException
      Specified by:
      getNode in interface Aggregate
      Throws:
      RepositoryException
    • hasNode

      public boolean hasNode() throws RepositoryException
      Specified by:
      hasNode in interface Aggregate
      Throws:
      RepositoryException
    • invalidate

      public void invalidate()
    • getParent

      public Aggregate getParent()
      Specified by:
      getParent in interface Aggregate
    • getPath

      public String getPath()
      Specified by:
      getPath in interface Aggregate
    • getRepositoryAddress

      public RepositoryAddress getRepositoryAddress() throws RepositoryException
      Description copied from interface: Aggregate
      Returns the (absolute) repository address to the node that this artifact node represents.
      Specified by:
      getRepositoryAddress in interface Aggregate
      Returns:
      the repository address
      Throws:
      RepositoryException - if an error occurs.
    • allowsChildren

      public boolean allowsChildren()
      Description copied from interface: Aggregate
      Checks if this artifact node possibly allows children, i.e. is a folder.
      Specified by:
      allowsChildren in interface Aggregate
      Returns:
      true if this artifact node allows children; false otherwise.
    • getRelPath

      public String getRelPath()
      Description copied from interface: Aggregate
      Returns the relative path of this aggregate in respect to it's parent aggregate.
      Specified by:
      getRelPath in interface Aggregate
      Returns:
      the relative path
    • getName

      public String getName()
      Description copied from interface: Aggregate
      Returns the name of this aggregate.
      Specified by:
      getName in interface Aggregate
      Returns:
      the name of this aggregate.
    • getLeaves

      public List<? extends Aggregate> getLeaves() throws RepositoryException
      Description copied from interface: Aggregate
      Returns the leaves of this aggregate or null.
      Specified by:
      getLeaves in interface Aggregate
      Returns:
      the leaves
      Throws:
      RepositoryException - if an error occurs
    • getAggregate

      public Aggregate getAggregate(String relPath) throws RepositoryException
      Specified by:
      getAggregate in interface Aggregate
      Throws:
      RepositoryException
    • getArtifacts

      public ArtifactSet getArtifacts() throws RepositoryException
      Description copied from interface: Aggregate
      Returns the artifacts of this node.
      Specified by:
      getArtifacts in interface Aggregate
      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 unless recursive is 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: Aggregate
      Returns the artifact manager this node belongs to.
      Specified by:
      getManager in interface Aggregate
      Returns:
      the Vault filesystem.
    • isAttached

      public boolean isAttached() throws RepositoryException
      Description copied from interface: Aggregate
      Checks if this aggregate has an aggregator and its node exists.
      Specified by:
      isAttached in interface Aggregate
      Returns:
      true if 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.
      Specified by:
      dump in interface Dumpable
      Parameters:
      ctx - the dump context
      isLast - specifies if this is the last element to dump on this level
    • getNamespacePrefixes

      public String[] getNamespacePrefixes()
      Specified by:
      getNamespacePrefixes in interface Aggregate
    • getNamespaceURI

      public String getNamespaceURI(String prefix) throws RepositoryException
      Specified by:
      getNamespaceURI in interface Aggregate
      Throws:
      RepositoryException
    • getBinaries

      public Collection<Property> getBinaries()
      Description copied from interface: Aggregate
      Returns the collection of binary properties in this aggregate
      Specified by:
      getBinaries in interface Aggregate
      Returns:
      the binaries or null
    • walk

      public void walk(org.apache.jackrabbit.vault.fs.impl.io.AggregateWalkListener aggregateWalkListener) throws RepositoryException
      Walks 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.