public class StorageDecorator extends Object
Modifier and Type | Field and Description |
---|---|
private Logger |
logger |
private DeepaMehtaStorage |
storage |
Constructor and Description |
---|
StorageDecorator(DeepaMehtaStorage storage) |
Modifier and Type | Method and Description |
---|---|
(package private) DeepaMehtaTransaction |
beginTx() |
(package private) void |
deleteAssociation(long assocId) |
(package private) void |
deleteTopic(long topicId)
Deletes the topic.
|
(package private) Iterator<AssociationModel> |
fetchAllAssociations() |
(package private) Iterator<TopicModel> |
fetchAllTopics() |
(package private) AssociationModel |
fetchAssociation(long assocId) |
(package private) AssociationModel |
fetchAssociation(String assocTypeUri,
long topicId1,
long topicId2,
String roleTypeUri1,
String roleTypeUri2)
Convenience method (checks singularity).
|
(package private) AssociationModel |
fetchAssociation(String key,
SimpleValue value)
Looks up a single association by exact value.
|
(package private) List<AssociationModel> |
fetchAssociationAssociations(long assocId) |
(package private) AssociationModel |
fetchAssociationBetweenTopicAndAssociation(String assocTypeUri,
long topicId,
long assocId,
String topicRoleTypeUri,
String assocRoleTypeUri)
Convenience method (checks singularity).
|
(package private) RelatedAssociationModel |
fetchAssociationRelatedAssociation(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri)
Convenience method (checks singularity).
|
(package private) ResultList<RelatedAssociationModel> |
fetchAssociationRelatedAssociations(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
(package private) RelatedTopicModel |
fetchAssociationRelatedTopic(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
Convenience method (checks singularity).
|
(package private) ResultList<RelatedTopicModel> |
fetchAssociationRelatedTopics(long assocId,
List<String> assocTypeUris,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri,
int maxResultSize)
Convenience method (receives *list* of association types).
|
(package private) ResultList<RelatedTopicModel> |
fetchAssociationRelatedTopics(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri,
int maxResultSize) |
(package private) List<AssociationModel> |
fetchAssociations(String assocTypeUri,
long topicId1,
long topicId2,
String roleTypeUri1,
String roleTypeUri2)
Returns the associations between two topics.
|
(package private) List<AssociationModel> |
fetchAssociations(String key,
SimpleValue value) |
(package private) List<AssociationModel> |
fetchAssociationsBetweenTopicAndAssociation(String assocTypeUri,
long topicId,
long assocId,
String topicRoleTypeUri,
String assocRoleTypeUri) |
(package private) List<AssociationModel> |
fetchAssociationsByProperty(String propUri,
Object propValue) |
(package private) List<AssociationModel> |
fetchAssociationsByPropertyRange(String propUri,
Number from,
Number to) |
(package private) int |
fetchMigrationNr() |
(package private) DeepaMehtaObjectModel |
fetchObject(long id) |
(package private) long[] |
fetchPlayerIds(long assocId) |
(package private) Object |
fetchProperty(long id,
String propUri) |
(package private) RelatedTopicModel |
fetchRelatedTopic(long objectId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
Convenience method (checks singularity).
|
(package private) ResultList<RelatedTopicModel> |
fetchRelatedTopics(long objectId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
(package private) TopicModel |
fetchTopic(long topicId) |
(package private) TopicModel |
fetchTopic(String key,
SimpleValue value)
Looks up a single topic by exact value.
|
(package private) List<AssociationModel> |
fetchTopicAssociations(long topicId) |
(package private) RelatedAssociationModel |
fetchTopicRelatedAssociation(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri)
Convenience method (checks singularity).
|
(package private) ResultList<RelatedAssociationModel> |
fetchTopicRelatedAssociations(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
(package private) RelatedTopicModel |
fetchTopicRelatedTopic(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
Convenience method (checks singularity).
|
(package private) ResultList<RelatedTopicModel> |
fetchTopicRelatedTopics(long topicId,
List<String> assocTypeUris,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri,
int maxResultSize)
Convenience method (receives *list* of association types).
|
(package private) ResultList<RelatedTopicModel> |
fetchTopicRelatedTopics(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri,
int maxResultSize) |
(package private) List<TopicModel> |
fetchTopics(String key,
SimpleValue value) |
(package private) List<TopicModel> |
fetchTopicsByProperty(String propUri,
Object propValue) |
(package private) List<TopicModel> |
fetchTopicsByPropertyRange(String propUri,
Number from,
Number to) |
(package private) Object |
getDatabaseVendorObject() |
(package private) Object |
getDatabaseVendorObject(long objectId) |
(package private) boolean |
hasProperty(long id,
String propUri) |
(package private) void |
indexAssociationValue(long assocId,
IndexMode indexMode,
String indexKey,
SimpleValue indexValue) |
(package private) void |
indexTopicValue(long topicId,
IndexMode indexMode,
String indexKey,
SimpleValue indexValue) |
(package private) boolean |
init()
Initializes the database.
|
(package private) List<TopicModel> |
queryTopics(String key,
SimpleValue value) |
(package private) void |
removeAssociationProperty(long assocId,
String propUri) |
(package private) void |
removeTopicProperty(long topicId,
String propUri) |
(package private) void |
shutdown() |
(package private) void |
storeAssociation(AssociationModel model) |
(package private) void |
storeAssociationProperty(long assocId,
String propUri,
Object propValue,
boolean addToIndex) |
(package private) void |
storeAssociationTypeUri(long assocId,
String assocTypeUri) |
(package private) void |
storeAssociationUri(long assocId,
String uri)
Stores and indexes the association's URI.
|
(package private) void |
storeAssociationValue(long assocId,
SimpleValue value)
Convenience method (no indexing).
|
(package private) void |
storeAssociationValue(long assocId,
SimpleValue value,
List<IndexMode> indexModes,
String indexKey,
SimpleValue indexValue)
Stores and indexes the association's value.
|
(package private) void |
storeMigrationNr(int migrationNr) |
(package private) void |
storeRoleTypeUri(long assocId,
long playerId,
String roleTypeUri) |
(package private) void |
storeTopic(TopicModel model)
Creates a topic.
|
(package private) void |
storeTopicProperty(long topicId,
String propUri,
Object propValue,
boolean addToIndex) |
(package private) void |
storeTopicTypeUri(long topicId,
String topicTypeUri) |
(package private) void |
storeTopicUri(long topicId,
String uri)
Stores and indexes the topic's URI.
|
(package private) void |
storeTopicValue(long topicId,
SimpleValue value)
Convenience method (no indexing).
|
(package private) void |
storeTopicValue(long topicId,
SimpleValue value,
List<IndexMode> indexModes,
String indexKey,
SimpleValue indexValue)
Stores and indexes the topic's value.
|
private DeepaMehtaStorage storage
public StorageDecorator(DeepaMehtaStorage storage)
TopicModel fetchTopic(long topicId)
TopicModel fetchTopic(String key, SimpleValue value)
null
is returned.
If more than one topic is found a runtime exception is thrown.
IMPORTANT: Looking up a topic this way requires the corresponding type to be indexed with indexing mode
dm4.core.key
.
List<TopicModel> fetchTopics(String key, SimpleValue value)
List<TopicModel> queryTopics(String key, SimpleValue value)
Iterator<TopicModel> fetchAllTopics()
void storeTopic(TopicModel model)
The topic's URI is stored and indexed.
void storeTopicUri(long topicId, String uri)
void storeTopicTypeUri(long topicId, String topicTypeUri)
void storeTopicValue(long topicId, SimpleValue value)
void storeTopicValue(long topicId, SimpleValue value, List<IndexMode> indexModes, String indexKey, SimpleValue indexValue)
void indexTopicValue(long topicId, IndexMode indexMode, String indexKey, SimpleValue indexValue)
void deleteTopic(long topicId)
Prerequisite: the topic has no relations.
AssociationModel fetchAssociation(long assocId)
AssociationModel fetchAssociation(String key, SimpleValue value)
null
is returned.
If more than one association is found a runtime exception is thrown.
IMPORTANT: Looking up an association this way requires the corresponding type to be indexed with indexing mode
dm4.core.key
.
List<AssociationModel> fetchAssociations(String key, SimpleValue value)
AssociationModel fetchAssociation(String assocTypeUri, long topicId1, long topicId2, String roleTypeUri1, String roleTypeUri2)
null
is returned.
If more than one association exist, a runtime exception is thrown.assocTypeUri
- Association type filter. Pass null
to switch filter off.
### FIXME: for methods with a singular return value all filters should be mandatoryList<AssociationModel> fetchAssociations(String assocTypeUri, long topicId1, long topicId2, String roleTypeUri1, String roleTypeUri2)
assocTypeUri
- Association type filter. Pass null
to switch filter off.AssociationModel fetchAssociationBetweenTopicAndAssociation(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri)
List<AssociationModel> fetchAssociationsBetweenTopicAndAssociation(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri)
Iterator<AssociationModel> fetchAllAssociations()
long[] fetchPlayerIds(long assocId)
void storeAssociationUri(long assocId, String uri)
void storeAssociationTypeUri(long assocId, String assocTypeUri)
void storeRoleTypeUri(long assocId, long playerId, String roleTypeUri)
void storeAssociationValue(long assocId, SimpleValue value)
void storeAssociationValue(long assocId, SimpleValue value, List<IndexMode> indexModes, String indexKey, SimpleValue indexValue)
void indexAssociationValue(long assocId, IndexMode indexMode, String indexKey, SimpleValue indexValue)
void storeAssociation(AssociationModel model)
void deleteAssociation(long assocId)
DeepaMehtaObjectModel fetchObject(long id)
List<AssociationModel> fetchTopicAssociations(long topicId)
List<AssociationModel> fetchAssociationAssociations(long assocId)
RelatedTopicModel fetchTopicRelatedTopic(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullResultList<RelatedTopicModel> fetchTopicRelatedTopics(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri, int maxResultSize)
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullResultList<RelatedTopicModel> fetchTopicRelatedTopics(long topicId, List<String> assocTypeUris, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri, int maxResultSize)
assocTypeUris
- may *not* be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullRelatedAssociationModel fetchTopicRelatedAssociation(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
ResultList<RelatedAssociationModel> fetchTopicRelatedAssociations(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersAssocTypeUri
- may be nullRelatedTopicModel fetchAssociationRelatedTopic(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
ResultList<RelatedTopicModel> fetchAssociationRelatedTopics(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri, int maxResultSize)
ResultList<RelatedTopicModel> fetchAssociationRelatedTopics(long assocId, List<String> assocTypeUris, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri, int maxResultSize)
assocTypeUris
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullRelatedAssociationModel fetchAssociationRelatedAssociation(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
ResultList<RelatedAssociationModel> fetchAssociationRelatedAssociations(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersAssocTypeUri
- may be nullRelatedTopicModel fetchRelatedTopic(long objectId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
objectId
- id of a topic or an associationassocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullResultList<RelatedTopicModel> fetchRelatedTopics(long objectId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
objectId
- id of a topic or an associationassocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullObject fetchProperty(long id, String propUri)
boolean hasProperty(long id, String propUri)
List<TopicModel> fetchTopicsByProperty(String propUri, Object propValue)
List<TopicModel> fetchTopicsByPropertyRange(String propUri, Number from, Number to)
List<AssociationModel> fetchAssociationsByProperty(String propUri, Object propValue)
List<AssociationModel> fetchAssociationsByPropertyRange(String propUri, Number from, Number to)
void storeTopicProperty(long topicId, String propUri, Object propValue, boolean addToIndex)
void storeAssociationProperty(long assocId, String propUri, Object propValue, boolean addToIndex)
void removeTopicProperty(long topicId, String propUri)
void removeAssociationProperty(long assocId, String propUri)
DeepaMehtaTransaction beginTx()
boolean init()
true
if a clean install is detected, false
otherwise.void shutdown()
int fetchMigrationNr()
void storeMigrationNr(int migrationNr)
Object getDatabaseVendorObject()
Object getDatabaseVendorObject(long objectId)
Copyright © 2015. All Rights Reserved.