VIVO-870 Create IndividualDao.getAllIndividualUris()

This replaces IndividualDao.getAllOfThisTypeIterator(). It returns the list that was created instead of
the iterator.

This would require a change to ObjectSourceIFace, but we get rid of it instead. Nobody was using it.
This commit is contained in:
Jim Blake 2015-01-11 18:30:28 -05:00
parent 99c03ce49a
commit 0602406c53
6 changed files with 12 additions and 27 deletions

View file

@ -10,9 +10,8 @@ import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.VClass; import edu.cornell.mannlib.vitro.webapp.beans.VClass;
import edu.cornell.mannlib.vitro.webapp.edit.EditLiteral; import edu.cornell.mannlib.vitro.webapp.edit.EditLiteral;
import edu.cornell.mannlib.vitro.webapp.search.beans.ObjectSourceIface;
public interface IndividualDao extends ObjectSourceIface { public interface IndividualDao {
/** /**
* Returns a collection of DataPropertyStatements involving all the external ID literals for a given Individual. * Returns a collection of DataPropertyStatements involving all the external ID literals for a given Individual.
@ -85,9 +84,9 @@ public interface IndividualDao extends ObjectSourceIface {
public abstract Individual getIndividualByURI(String individualURI); public abstract Individual getIndividualByURI(String individualURI);
/** /**
* Returns an Iterator over all Individuals in the model that are user-viewable. * Returns a collection of all Individuals in the model that are user-viewable.
*/ */
public abstract Iterator<String> getAllOfThisTypeIterator(); public abstract Collection<String> getAllIndividualUris();
/** /**
* Returns an Iterator over all Individuals in the model that are user-viewable and have been updated since the specified time. * Returns an Iterator over all Individuals in the model that are user-viewable and have been updated since the specified time.

View file

@ -120,8 +120,8 @@ class IndividualDaoFiltering extends BaseFiltering implements IndividualDao{
/* ******************* unfiltered methods ****************** */ /* ******************* unfiltered methods ****************** */
public Iterator<String> getAllOfThisTypeIterator() { public Collection<String> getAllIndividualUris() {
return innerIndividualDao.getAllOfThisTypeIterator(); return innerIndividualDao.getAllIndividualUris();
} }

View file

@ -603,7 +603,7 @@ public class IndividualDaoJena extends JenaBaseDao implements IndividualDao {
return inds; return inds;
} }
public Iterator<String> getAllOfThisTypeIterator() { public Collection<String> getAllIndividualUris() {
//this is implemented in IndivdiualSDB //this is implemented in IndivdiualSDB
throw new NotImplementedException(); throw new NotImplementedException();
} }

View file

@ -4,6 +4,7 @@ package edu.cornell.mannlib.vitro.webapp.dao.jena;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
@ -437,9 +438,8 @@ public class IndividualDaoSDB extends IndividualDaoJena {
} }
@Override @Override
public Iterator<String> getAllOfThisTypeIterator() { public Collection<String> getAllIndividualUris() {
final List<String> list = final List<String> list = new LinkedList<String>();
new LinkedList<String>();
// get all labeled resources from any non-tbox and non-metadata graphs, // get all labeled resources from any non-tbox and non-metadata graphs,
// as well as the unnamed graph (first pattern below) // as well as the unnamed graph (first pattern below)
@ -472,8 +472,7 @@ public class IndividualDaoSDB extends IndividualDaoJena {
w.close(); w.close();
} }
return list.iterator(); return list;
} }
private Iterator<Individual> getIndividualIterator( private Iterator<Individual> getIndividualIterator(

View file

@ -1,13 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.beans;
import java.util.Iterator;
public interface ObjectSourceIface {
Iterator<String> getAllOfThisTypeIterator();
Iterator<String> getUpdatedSinceIterator(long msSinceEpoc);
}

View file

@ -130,9 +130,9 @@ public class IndividualDaoStub implements IndividualDao {
} }
@Override @Override
public Iterator<String> getAllOfThisTypeIterator() { public Collection<String> getAllIndividualUris() {
throw new RuntimeException( throw new RuntimeException(
"IndividualDaoStub.getAllOfThisTypeIterator() not implemented."); "IndividualDaoStub.getAllIndividualUris() not implemented.");
} }
@Override @Override