Package systems.dmx.core.storage.spi
Interface DMXStorage
-
- All Known Implementing Classes:
Neo4jStorage
public interface DMXStorage
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DMXTransaction
beginTx()
void
deleteAssoc(long assocId)
void
deleteAssocProperty(long assocId, String propUri)
void
deleteTopic(long topicId)
Deletes the topic.void
deleteTopicProperty(long topicId, String propUri)
Iterable<AssocModelImpl>
fetchAllAssocs()
Iterable<TopicModelImpl>
fetchAllTopics()
AssocModelImpl
fetchAssoc(long assocId)
Fetches an assoc by ID.List<AssocModelImpl>
fetchAssocAssocs(long assocId)
List<RelatedAssocModelImpl>
fetchAssocRelatedAssocs(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
<M extends RelatedObjectModel>
List<M>fetchAssocRelatedObjects(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTypeUri)
List<RelatedTopicModelImpl>
fetchAssocRelatedTopics(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
List<AssocModelImpl>
fetchAssocs(String assocTypeUri, long topicId1, long topicId2, String roleTypeUri1, String roleTypeUri2)
Returns the associations between two topics.List<AssocModelImpl>
fetchAssocs(String key, Object value)
Fetches assocs by exact value.List<AssocModelImpl>
fetchAssocsBetweenTopicAndAssoc(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri)
List<AssocModelImpl>
fetchAssocsByProperty(String propUri, Object propValue)
List<AssocModelImpl>
fetchAssocsByPropertyRange(String propUri, Number from, Number to)
DMXObjectModelImpl
fetchObject(long id)
List<PlayerModel>
fetchPlayerModels(long assocId)
Object
fetchProperty(long id, String propUri)
List<RelatedAssocModelImpl>
fetchRelatedAssocs(long objectId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
List<RelatedTopicModelImpl>
fetchRelatedTopics(long objectId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
TopicModelImpl
fetchTopic(long topicId)
Fetches a topic by ID.List<AssocModelImpl>
fetchTopicAssocs(long topicId)
List<RelatedAssocModelImpl>
fetchTopicRelatedAssocs(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
<M extends RelatedObjectModel>
List<M>fetchTopicRelatedObjects(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTypeUri)
List<RelatedTopicModelImpl>
fetchTopicRelatedTopics(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
List<TopicModelImpl>
fetchTopics(String key, Object value)
Fetches topics by exact value.List<TopicModelImpl>
fetchTopicsByProperty(String propUri, Object propValue)
List<TopicModelImpl>
fetchTopicsByPropertyRange(String propUri, Number from, Number to)
Object
getDatabaseVendorObject()
Object
getDatabaseVendorObject(long objectId)
ModelFactoryImpl
getModelFactory()
boolean
hasProperty(long id, String propUri)
void
indexAssocProperty(long assocId, String propUri, Object propValue)
void
indexTopicFulltext(long topicId, String text, String indexKey)
void
indexTopicProperty(long topicId, String propUri, Object propValue)
List<AssocModelImpl>
queryAssocs(String key, Object value)
List<AssocModelImpl>
queryAssocsByRoleType(String roleTypeUri)
List<AssocModelImpl>
queryAssocsFulltext(String key, Object value)
List<TopicModelImpl>
queryTopics(String key, Object value)
List<TopicModelImpl>
queryTopicsFulltext(String key, Object value)
boolean
setupRootNode()
void
shutdown()
void
storeAssoc(AssocModelImpl assocModel)
void
storeAssocProperty(long assocId, String propUri, Object propValue, boolean addToIndex)
void
storeAssocTypeUri(long assocId, String assocTypeUri)
void
storeAssocUri(long assocId, String uri)
Stores and indexes the association's URI.void
storeAssocValue(long assocId, SimpleValue value, String indexKey, boolean isHtmlValue)
Stores and indexes an association value.void
storeRoleTypeUri(long assocId, long playerId, String roleTypeUri)
void
storeTopic(TopicModelImpl topicModel)
Stores a rudimentary topic in the DB.void
storeTopicProperty(long topicId, String propUri, Object propValue, boolean addToIndex)
void
storeTopicTypeUri(long topicId, String topicTypeUri)
void
storeTopicUri(long topicId, String uri)
Stores and indexes the topic's URI.void
storeTopicValue(long topicId, SimpleValue value, String indexKey, boolean isHtmlValue)
Stores and indexes a topic value.
-
-
-
Method Detail
-
fetchTopic
TopicModelImpl fetchTopic(long topicId)
Fetches a topic by ID.- Returns:
- The fetched topic.
-
fetchTopics
List<TopicModelImpl> fetchTopics(String key, Object value)
Fetches topics by exact value.
-
queryTopics
List<TopicModelImpl> queryTopics(String key, Object value)
-
queryTopicsFulltext
List<TopicModelImpl> queryTopicsFulltext(String key, Object value)
- Returns:
- The fetched topics.
-
fetchAllTopics
Iterable<TopicModelImpl> fetchAllTopics()
-
storeTopic
void storeTopic(TopicModelImpl topicModel)
Stores a rudimentary topic in the DB.Only the topic URI and the topic type URI are stored. The topic value (simple or composite) is not stored. The "Instantiation" association is not stored.
An URI uniqueness check is performed. If the DB already contains a topic or an association with the URI passed, an exception is thrown and nothing is stored.
- Parameters:
topicModel
- The topic to store. Once the method returns the topic model contains: - the ID of the stored topic. - an empty URI ("") in casenull
was passed. - an empty simple value ("") in casenull
was passed.
-
storeTopicUri
void storeTopicUri(long topicId, String uri)
Stores and indexes the topic's URI.
-
storeTopicTypeUri
void storeTopicTypeUri(long topicId, String topicTypeUri)
-
storeTopicValue
void storeTopicValue(long topicId, SimpleValue value, String indexKey, boolean isHtmlValue)
Stores and indexes a topic value.- Parameters:
indexKey
- must not nullindexValue
- Optional: the value to be indexed. If indexValue is not specified, value is used. ### FIXDOC
-
deleteTopic
void deleteTopic(long topicId)
Deletes the topic.Prerequisite: the topic has no relations.
-
fetchAssoc
AssocModelImpl fetchAssoc(long assocId)
Fetches an assoc by ID.- Returns:
- The fetched assoc.
-
fetchAssocs
List<AssocModelImpl> fetchAssocs(String key, Object value)
Fetches assocs by exact value.
-
queryAssocs
List<AssocModelImpl> queryAssocs(String key, Object value)
-
queryAssocsFulltext
List<AssocModelImpl> queryAssocsFulltext(String key, Object value)
- Returns:
- The fetched assocs.
-
queryAssocsByRoleType
List<AssocModelImpl> queryAssocsByRoleType(String roleTypeUri)
-
fetchAssocs
List<AssocModelImpl> fetchAssocs(String assocTypeUri, long topicId1, long topicId2, String roleTypeUri1, String roleTypeUri2)
Returns the associations between two topics. If no such association exists an empty set is returned.- Parameters:
assocTypeUri
- Assoc type filter. Passnull
to switch filter off.
-
fetchAssocsBetweenTopicAndAssoc
List<AssocModelImpl> fetchAssocsBetweenTopicAndAssoc(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri)
-
fetchAllAssocs
Iterable<AssocModelImpl> fetchAllAssocs()
-
fetchPlayerModels
List<PlayerModel> fetchPlayerModels(long assocId)
-
storeAssoc
void storeAssoc(AssocModelImpl assocModel)
-
storeAssocUri
void storeAssocUri(long assocId, String uri)
Stores and indexes the association's URI.
-
storeAssocTypeUri
void storeAssocTypeUri(long assocId, String assocTypeUri)
-
storeAssocValue
void storeAssocValue(long assocId, SimpleValue value, String indexKey, boolean isHtmlValue)
Stores and indexes an association value.- Parameters:
indexKey
- must not nullindexValue
- Optional: the value to be indexed. If indexValue is not specified, value is used. ### FIXDOC
-
storeRoleTypeUri
void storeRoleTypeUri(long assocId, long playerId, String roleTypeUri)
-
deleteAssoc
void deleteAssoc(long assocId)
-
fetchObject
DMXObjectModelImpl fetchObject(long id)
-
fetchTopicAssocs
List<AssocModelImpl> fetchTopicAssocs(long topicId)
-
fetchAssocAssocs
List<AssocModelImpl> fetchAssocAssocs(long assocId)
-
fetchTopicRelatedTopics
List<RelatedTopicModelImpl> fetchTopicRelatedTopics(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
- Parameters:
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be null- Returns:
- The fetched topics.
-
fetchTopicRelatedAssocs
List<RelatedAssocModelImpl> fetchTopicRelatedAssocs(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
- Parameters:
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be null- Returns:
- The fetched associations.
-
fetchAssocRelatedTopics
List<RelatedTopicModelImpl> fetchAssocRelatedTopics(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
- Parameters:
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be null- Returns:
- The fetched topics.
-
fetchAssocRelatedAssocs
List<RelatedAssocModelImpl> fetchAssocRelatedAssocs(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
- Parameters:
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be null- Returns:
- The fetched associations.
-
fetchTopicRelatedObjects
<M extends RelatedObjectModel> List<M> fetchTopicRelatedObjects(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTypeUri)
-
fetchAssocRelatedObjects
<M extends RelatedObjectModel> List<M> fetchAssocRelatedObjects(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTypeUri)
-
fetchRelatedTopics
List<RelatedTopicModelImpl> fetchRelatedTopics(long objectId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
- Parameters:
objectId
- id of a topic or an associationassocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be null- Returns:
- The fetched topics.
-
fetchRelatedAssocs
List<RelatedAssocModelImpl> fetchRelatedAssocs(long objectId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
- Parameters:
objectId
- id of a topic or an associationassocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be null- Returns:
- The fetched associations.
-
fetchProperty
Object fetchProperty(long id, String propUri)
- Parameters:
id
- id of a topic or an association
-
hasProperty
boolean hasProperty(long id, String propUri)
- Parameters:
id
- id of a topic or an association
-
fetchTopicsByProperty
List<TopicModelImpl> fetchTopicsByProperty(String propUri, Object propValue)
-
fetchTopicsByPropertyRange
List<TopicModelImpl> fetchTopicsByPropertyRange(String propUri, Number from, Number to)
-
fetchAssocsByProperty
List<AssocModelImpl> fetchAssocsByProperty(String propUri, Object propValue)
-
fetchAssocsByPropertyRange
List<AssocModelImpl> fetchAssocsByPropertyRange(String propUri, Number from, Number to)
-
storeTopicProperty
void storeTopicProperty(long topicId, String propUri, Object propValue, boolean addToIndex)
-
storeAssocProperty
void storeAssocProperty(long assocId, String propUri, Object propValue, boolean addToIndex)
-
deleteTopicProperty
void deleteTopicProperty(long topicId, String propUri)
-
deleteAssocProperty
void deleteAssocProperty(long assocId, String propUri)
-
beginTx
DMXTransaction beginTx()
-
setupRootNode
boolean setupRootNode()
-
shutdown
void shutdown()
-
getDatabaseVendorObject
Object getDatabaseVendorObject()
-
getDatabaseVendorObject
Object getDatabaseVendorObject(long objectId)
-
getModelFactory
ModelFactoryImpl getModelFactory()
-
-