mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
125484 slanglois: MNT-16155 Update source headers - remove old Copyrights from Java and JSP dource files git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@125603 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
67 lines
1.6 KiB
Java
67 lines
1.6 KiB
Java
|
|
package org.alfresco.repo.transfer;
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Collection;
|
|
import java.util.HashSet;
|
|
import java.util.Set;
|
|
|
|
import org.alfresco.service.cmr.repository.NodeRef;
|
|
import org.alfresco.service.cmr.transfer.NodeFinder;
|
|
|
|
/**
|
|
* A {@link NodeFinder} that sums the results of multiple {@link NodeFinder}s.
|
|
* @author Nick Smith
|
|
* @since 4.0
|
|
*
|
|
*/
|
|
public class CompositeNodeFinder extends AbstractNodeFinder
|
|
{
|
|
private final Collection<NodeFinder> finders;
|
|
|
|
public CompositeNodeFinder(NodeFinder... finders)
|
|
{
|
|
this.finders = Arrays.asList(finders);
|
|
}
|
|
|
|
public CompositeNodeFinder(Collection<NodeFinder> finders)
|
|
{
|
|
this.finders = finders;
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
@Override
|
|
public void init()
|
|
{
|
|
super.init();
|
|
for (NodeFinder finder : finders)
|
|
{
|
|
if(finder instanceof AbstractNodeFinder)
|
|
{
|
|
AbstractNodeFinder nodeFinder = (AbstractNodeFinder) finder;
|
|
nodeFinder.setServiceRegistry(serviceRegistry);
|
|
nodeFinder.init();
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
public Set<NodeRef> findFrom(NodeRef thisNode)
|
|
{
|
|
HashSet<NodeRef> results = new HashSet<NodeRef>();
|
|
for (NodeFinder finder : finders)
|
|
{
|
|
Set<NodeRef> result = finder.findFrom(thisNode);
|
|
if(result != null)
|
|
{
|
|
results.addAll(result);
|
|
}
|
|
}
|
|
return results;
|
|
}
|
|
}
|