use of dk.dbc.opensearch.commons.repository.IRepositoryIdentifier 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.IRepositoryIdentifier in project solr-document-store by DBCDK.
the class SolrIndexer method getTrackingId.
private String getTrackingId(IRepositoryDAO repositoryDAO, String pid) throws IllegalStateException, RepositoryException {
IRepositoryIdentifier identifier = repositoryDAO.createIdentifier(pid);
String label = repositoryDAO.getObjectLabel(identifier);
return "SolrWorker:" + pid + "<" + label;
}
use of dk.dbc.opensearch.commons.repository.IRepositoryIdentifier 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();
}
}
use of dk.dbc.opensearch.commons.repository.IRepositoryIdentifier in project solr-document-store by DBCDK.
the class SolrIndexer method getObjectData.
private String getObjectData(IRepositoryDAO repositoryDAO, String pid) throws IllegalStateException, RepositoryException {
IRepositoryIdentifier identifier = repositoryDAO.createIdentifier(pid);
String data = repositoryDAO.exportObject(identifier);
return data;
}
Aggregations