Package org.fcrepo.kernel.impl.services
Class ReferenceServiceImpl
- java.lang.Object
-
- org.fcrepo.kernel.impl.services.ReferenceServiceImpl
-
- All Implemented Interfaces:
ReferenceService
@Component("referenceServiceImpl") public class ReferenceServiceImpl extends Object implements ReferenceService
Implementation of reference service.- Since:
- 6.0.0
- Author:
- whikloj
-
-
Constructor Summary
Constructors Constructor Description ReferenceServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commitTransaction(Transaction tx)
Commit any pending references.void
deleteAllReferences(Transaction tx, FedoraId resourceId)
Delete all references from a resource to any other resource.DataSource
getDataSource()
Get the JDBC datastore.RdfStream
getInboundReferences(Transaction tx, FedoraResource resource)
Return a RDF stream of statements referring to the provided resource.void
reset()
Truncates the reference index.void
rollbackTransaction(Transaction tx)
Rollback any pending references.void
setDataSource(DataSource dataSource)
Set the JDBC datastore.void
setUp()
void
updateReferences(Transaction tx, FedoraId resourceId, String userPrincipal, RdfStream rdfStream)
Parse the stream of triples for references, add any new ones and remove any missing ones.
-
-
-
Constructor Detail
-
ReferenceServiceImpl
public ReferenceServiceImpl()
-
-
Method Detail
-
setUp
@PostConstruct public void setUp()
-
getInboundReferences
public RdfStream getInboundReferences(@Nonnull Transaction tx, FedoraResource resource)
Description copied from interface:ReferenceService
Return a RDF stream of statements referring to the provided resource.- Specified by:
getInboundReferences
in interfaceReferenceService
- Parameters:
tx
- the transaction or null if no transaction.resource
- the resource to get inbound references for.- Returns:
- RDF stream of inbound reference triples.
-
deleteAllReferences
public void deleteAllReferences(@Nonnull Transaction tx, FedoraId resourceId)
Description copied from interface:ReferenceService
Delete all references from a resource to any other resource.- Specified by:
deleteAllReferences
in interfaceReferenceService
- Parameters:
tx
- the transactionresourceId
- the ID of the resource referencing others.
-
updateReferences
public void updateReferences(@Nonnull Transaction tx, FedoraId resourceId, String userPrincipal, RdfStream rdfStream)
Description copied from interface:ReferenceService
Parse the stream of triples for references, add any new ones and remove any missing ones.- Specified by:
updateReferences
in interfaceReferenceService
- Parameters:
tx
- the transactionresourceId
- the subject ID of the triples.userPrincipal
- the user who's action is updating references.rdfStream
- the RDF stream.
-
commitTransaction
public void commitTransaction(Transaction tx)
Description copied from interface:ReferenceService
Commit any pending references.- Specified by:
commitTransaction
in interfaceReferenceService
- Parameters:
tx
- the transaction.
-
rollbackTransaction
@Transactional(propagation=NOT_SUPPORTED) public void rollbackTransaction(Transaction tx)
Description copied from interface:ReferenceService
Rollback any pending references.- Specified by:
rollbackTransaction
in interfaceReferenceService
- Parameters:
tx
- the transaction.
-
reset
public void reset()
Description copied from interface:ReferenceService
Truncates the reference index. This should only be called when rebuilding the index.- Specified by:
reset
in interfaceReferenceService
-
setDataSource
public void setDataSource(DataSource dataSource)
Set the JDBC datastore.- Parameters:
dataSource
- the dataStore.
-
getDataSource
public DataSource getDataSource()
Get the JDBC datastore.- Returns:
- the dataStore.
-
-