use of dk.dbc.opensearch.commons.repository.ISysRelationsStream in project solr-document-store by DBCDK.
the class SolrIndexer method unitFor.
@Lock(LockType.READ)
public String unitFor(String pid) throws RepositoryException {
try (IRepositoryDAO dao = daoProvider.getRepository()) {
IRepositoryIdentifier id = dao.createIdentifier(pid);
if (!dao.hasObject(id)) {
throw new IllegalStateException("Doesn't have pid: " + pid);
}
if (dao.getObjectState(id) == IRepositoryDAO.State.DELETED) {
return null;
}
ISysRelationsStream relations = dao.getSysRelationsStream(id);
IRepositoryIdentifier unit = relations.getUnitFor();
return unit.toString();
}
}
use of dk.dbc.opensearch.commons.repository.ISysRelationsStream in project solr-document-store by DBCDK.
the class SolrIndexer method workFor.
@Lock(LockType.READ)
public String workFor(String unit) throws RepositoryException {
if (unit == null) {
return null;
}
try (IRepositoryDAO dao = daoProvider.getRepository()) {
ISysRelationsStream relations = dao.getSysRelationsStream(dao.createIdentifier(unit));
IRepositoryIdentifier work = relations.getWorkFor();
return work.toString();
}
}
Aggregations