@Repository public class CassandraRecordDAO extends Object
| Constructor and Description |
|---|
CassandraRecordDAO() |
| Modifier and Type | Method and Description |
|---|---|
void |
addOrReplaceFileInRepresentation(String cloudId,
String schema,
String version,
eu.europeana.cloud.common.model.File file)
Adds or modifies given file to list of files of representation.
|
eu.europeana.cloud.common.model.Representation |
createRepresentation(String cloudId,
String schema,
String providerId,
Date creationTime)
Creates new temporary version for a specific record's representation.
|
void |
deleteRecord(String cloudId)
Deletes record with all representations and all versions.
|
void |
deleteRepresentation(String cloudId,
String schema)
Deletes representation with all versions.
|
void |
deleteRepresentation(String cloudId,
String schema,
String version)
Deletes record's representation in specified version.
|
List<eu.europeana.cloud.common.model.File> |
getFilesForRepresentation(String cloudId,
String schema,
String version)
Returns files for representation.
|
eu.europeana.cloud.common.model.Representation |
getLatestPersistentRepresentation(String cloudId,
String schema)
Returns latest persistent version of record's representation.
|
eu.europeana.cloud.common.model.Record |
getRecord(String cloudId)
Returns a record containing latest persistent representation in each
schema.
|
eu.europeana.cloud.common.model.Representation |
getRepresentation(String cloudId,
String schema,
String version)
Returns a representation of a record in specified schema and version.
|
List<eu.europeana.cloud.common.model.Representation> |
listRepresentationVersions(String cloudId)
Returns all versions of all representations (persistent or not) for a
cloud id.
|
List<eu.europeana.cloud.common.model.Representation> |
listRepresentationVersions(String cloudId,
String schema)
Returns all versions of representation (persistent or not), sorted from
the most recent to the oldes.
|
void |
persistRepresentation(String cloudId,
String schema,
String version,
Date creationTime)
Makes a certain temporary representation version a persistent one.
|
boolean |
providerHasRepresentations(String providerId)
Checks if given provider has any representations.
|
void |
removeFileFromRepresentation(String cloudId,
String schema,
String version,
String fileName)
Removes file entry from list of files belonging to record representation.
|
public eu.europeana.cloud.common.model.Record getRecord(String cloudId) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException
cloudId - com.datastax.driver.core.exceptions.NoHostAvailableExceptioncom.datastax.driver.core.exceptions.QueryExecutionExceptionpublic void deleteRecord(String cloudId) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException
cloudId - indentifier of record to be deleted.com.datastax.driver.core.exceptions.NoHostAvailableExceptioncom.datastax.driver.core.exceptions.QueryExecutionExceptionpublic void deleteRepresentation(String cloudId, String schema) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException
cloudId - identifier of recordschema - schema of representation to be deleted.com.datastax.driver.core.exceptions.NoHostAvailableExceptioncom.datastax.driver.core.exceptions.QueryExecutionExceptionpublic void deleteRepresentation(String cloudId, String schema, String version) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException
cloudId - identifier of recordschema - schema of representationversion - version of representationcom.datastax.driver.core.exceptions.NoHostAvailableExceptioncom.datastax.driver.core.exceptions.QueryExecutionExceptionpublic eu.europeana.cloud.common.model.Representation getLatestPersistentRepresentation(String cloudId, String schema)
cloudId - identifier of recordschema - schema of representationpublic eu.europeana.cloud.common.model.Representation createRepresentation(String cloudId, String schema, String providerId, Date creationTime) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException
cloudId - identifier of recordschema - schema of representationproviderId - representation version providercreationTime - creation datecom.datastax.driver.core.exceptions.NoHostAvailableExceptioncom.datastax.driver.core.exceptions.QueryExecutionExceptionpublic eu.europeana.cloud.common.model.Representation getRepresentation(String cloudId, String schema, String version) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException
cloudId - id of the recordschema - schema of the representationversion - version of the representation.com.datastax.driver.core.exceptions.QueryExecutionException - if error occured while executing a query.com.datastax.driver.core.exceptions.NoHostAvailableException - if no Cassandra host are available.public List<eu.europeana.cloud.common.model.File> getFilesForRepresentation(String cloudId, String schema, String version) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException
cloudId - schema - version - com.datastax.driver.core.exceptions.NoHostAvailableExceptioncom.datastax.driver.core.exceptions.QueryExecutionExceptionpublic void persistRepresentation(String cloudId, String schema, String version, Date creationTime) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException
cloudId - id of the recordschema - schema of the representationversion - version of the representationcreationTime - date of creationcom.datastax.driver.core.exceptions.QueryExecutionException - if error occured while executing a query.com.datastax.driver.core.exceptions.NoHostAvailableException - if no Cassandra host are available.public List<eu.europeana.cloud.common.model.Representation> listRepresentationVersions(String cloudId, String schema) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException, eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException
cloudId - record idschema - schema ideu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - when there is no representation matching requested parameterscom.datastax.driver.core.exceptions.NoHostAvailableExceptioncom.datastax.driver.core.exceptions.QueryExecutionExceptionpublic List<eu.europeana.cloud.common.model.Representation> listRepresentationVersions(String cloudId) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException
cloudId - record idcom.datastax.driver.core.exceptions.NoHostAvailableExceptioncom.datastax.driver.core.exceptions.QueryExecutionExceptionpublic void addOrReplaceFileInRepresentation(String cloudId, String schema, String version, eu.europeana.cloud.common.model.File file) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException
cloudId - record ifschema - schema idversion - version idfile - filecom.datastax.driver.core.exceptions.QueryExecutionException - if error occured while executing a query.com.datastax.driver.core.exceptions.NoHostAvailableException - if no Cassandra host are available.public void removeFileFromRepresentation(String cloudId, String schema, String version, String fileName) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException
cloudId - record ifschema - schema idversion - version idfileName - name of file to be removed from representationcom.datastax.driver.core.exceptions.QueryExecutionException - if error occured while executing a query.com.datastax.driver.core.exceptions.NoHostAvailableException - if no Cassandra host are available.public boolean providerHasRepresentations(String providerId) throws com.datastax.driver.core.exceptions.NoHostAvailableException, com.datastax.driver.core.exceptions.QueryExecutionException
providerId - identifier of the providercom.datastax.driver.core.exceptions.QueryExecutionException - if error occured while executing a query.com.datastax.driver.core.exceptions.NoHostAvailableException - if no Cassandra host are available.Copyright © 2013–2017 Europeana Cloud Development Team. All rights reserved.