public final class CassandraAclRepository extends Object implements AclRepository
AclRepository using the DataStax Java Driver.| Constructor and Description |
|---|
CassandraAclRepository(eu.europeana.cloud.cassandra.CassandraConnectionProvider provider,
boolean initSchema)
Constructs a new
CassandraAclRepositoryImpl. |
CassandraAclRepository(com.datastax.driver.core.Session session,
String keyspace)
Constructs a new
CassandraAclRepositoryImpl. |
CassandraAclRepository(com.datastax.driver.core.Session session,
String keyspace,
boolean initSchema)
Constructs a new
CassandraAclRepositoryImpl and optionally
creates the Cassandra keyspace and schema for storing ACLs. |
| Modifier and Type | Method and Description |
|---|---|
void |
createAclsTable()
Creates the schema for the table holding
AclEntry
representations. |
void |
createAoisTable()
Creates the schema for the table holding
AclObjectIdentity
representations. |
void |
createChilrenTable()
Creates the schema for the table holding
AclObjectIdentity
children. |
void |
deleteAcls(List<AclObjectIdentity> objectIdsToDelete)
Removes all relevant records for the provided
AclObjectIdentity
instances. |
AclObjectIdentity |
findAclObjectIdentity(AclObjectIdentity objectId)
Loads a fully populated
AclObjectIdentity object from the
database for the provided AclObjectIdentity. |
List<AclObjectIdentity> |
findAclObjectIdentityChildren(AclObjectIdentity objectId)
Loads the
AclObjectIdentity instances that use the specified
parent. |
Map<AclObjectIdentity,Set<AclEntry>> |
findAcls(List<AclObjectIdentity> objectIdsToLookup)
Loads the
AclEntry instances that apply for the passed
AclObjectIdentity objects. |
void |
saveAcl(AclObjectIdentity aoi)
Saves an
AclObjectIdentity record in the database. |
void |
updateAcl(AclObjectIdentity aoi,
List<AclEntry> entries)
Changes an existing
AclObjectIdentity or the related
AclEntry records in the database. |
public CassandraAclRepository(eu.europeana.cloud.cassandra.CassandraConnectionProvider provider,
boolean initSchema)
CassandraAclRepositoryImpl.provider - providing the Session to use for connectivity
with Cassandra.initSchema - whether the keyspace and schema for storing ACLs should // *
be created.public CassandraAclRepository(com.datastax.driver.core.Session session,
String keyspace)
CassandraAclRepositoryImpl.session - the Session to use for connectivity with
Cassandra.keyspace - whether the keyspace and schema for storing ACLs should be
created.public CassandraAclRepository(com.datastax.driver.core.Session session,
String keyspace,
boolean initSchema)
CassandraAclRepositoryImpl and optionally
creates the Cassandra keyspace and schema for storing ACLs.session - the Session to use for connectivity with
Cassandra.keyspace - whether the keyspace and schema for storing ACLs should be
created.initSchema - whether the keyspace and schema for storing ACLs should be
created.public Map<AclObjectIdentity,Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup)
AclRepositoryAclEntry instances that apply for the passed
AclObjectIdentity objects. The returned map is keyed on the
passed objects, with the values being sets of the applicable
AclEntry instances, sorted by the order parameter. Any unknown
objects will not have a map key.findAcls in interface AclRepositoryobjectIdsToLookup - the objects to find AclEntry information
for.AclEntry instances for each
AclObjectIdentity passed as an argument.public AclObjectIdentity findAclObjectIdentity(AclObjectIdentity objectId)
AclRepositoryAclObjectIdentity object from the
database for the provided AclObjectIdentity. The provided object
must contain 'id' and 'objectClass' information.findAclObjectIdentity in interface AclRepositoryobjectId - the AclObjectIdentity to load from the database.AclObjectIdentity object.public List<AclObjectIdentity> findAclObjectIdentityChildren(AclObjectIdentity objectId)
AclRepositoryAclObjectIdentity instances that use the specified
parent.findAclObjectIdentityChildren in interface AclRepositoryobjectId - the object to find children for.public void deleteAcls(List<AclObjectIdentity> objectIdsToDelete)
AclRepositoryAclObjectIdentity
instances.deleteAcls in interface AclRepositoryobjectIdsToDelete - the AclObjectIdentity instances
representing the records to delete.public void saveAcl(AclObjectIdentity aoi) throws AclAlreadyExistsException
AclRepositoryAclObjectIdentity record in the database. It will have
no entries.saveAcl in interface AclRepositoryaoi - the AclObjectIdentity to save.AclAlreadyExistsException - if the passed object identity already
has a record.public void updateAcl(AclObjectIdentity aoi, List<AclEntry> entries) throws AclNotFoundException
AclRepositoryAclObjectIdentity or the related
AclEntry records in the database.updateAcl in interface AclRepositoryaoi - the AclObjectIdentity to update.entries - the list of AclEntry objects to update.AclNotFoundException - if the relevant record could not be found.public void createAoisTable()
AclObjectIdentity
representations.public void createChilrenTable()
AclObjectIdentity
children.public void createAclsTable()
AclEntry
representations.Copyright © 2013–2019 Europeana Cloud Development Team. All rights reserved.