|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.deepamehta.core.impl.StorageDecorator
public class StorageDecorator
Field Summary | |
---|---|
private Logger |
logger
|
private DeepaMehtaStorage |
storage
|
Constructor Summary | |
---|---|
StorageDecorator(DeepaMehtaStorage storage)
|
Method Summary | |
---|---|
(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) 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) Object |
fetchAssociationProperty(long assocId,
String propUri)
|
(package private) RelatedAssociationModel |
fetchAssociationRelatedAssociation(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri)
Convenience method (checks singularity). |
(package private) List<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> |
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) RelatedTopicModel |
fetchRelatedTopic(long id,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
Convenience method (checks singularity). |
(package private) ResultList<RelatedTopicModel> |
fetchRelatedTopics(long id,
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 property value. |
(package private) List<AssociationModel> |
fetchTopicAssociations(long topicId)
|
(package private) Object |
fetchTopicProperty(long topicId,
String propUri)
|
(package private) RelatedAssociationModel |
fetchTopicRelatedAssociation(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri)
Convenience method (checks singularity). |
(package private) List<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) boolean |
hasAssociationProperty(long assocId,
String propUri)
|
(package private) boolean |
hasTopicProperty(long topicId,
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 searchTerm,
String fieldUri)
|
(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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private DeepaMehtaStorage storage
private final Logger logger
Constructor Detail |
---|
public StorageDecorator(DeepaMehtaStorage storage)
Method Detail |
---|
TopicModel fetchTopic(long topicId)
TopicModel fetchTopic(String key, SimpleValue value)
null
is returned.
If more than one topic were found a runtime exception is thrown.
IMPORTANT: Looking up a topic this way requires the property to be indexed with indexing mode KEY
.
This is achieved by declaring the respective data field with indexing_mode: "KEY"
(for statically declared data field, typically in types.json
) or
by calling DataField's DataField#setIndexingMode
method with "KEY"
as argument
(for dynamically created data fields, typically in migration classes).
List<TopicModel> fetchTopics(String key, SimpleValue value)
List<TopicModel> queryTopics(String searchTerm, String fieldUri)
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 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()
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)
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 null
ResultList<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 null
ResultList<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 null
RelatedAssociationModel fetchTopicRelatedAssociation(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
List<RelatedAssociationModel> fetchTopicRelatedAssociations(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersAssocTypeUri
- may be null
RelatedTopicModel 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 null
RelatedAssociationModel fetchAssociationRelatedAssociation(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
List<RelatedAssociationModel> fetchAssociationRelatedAssociations(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersAssocTypeUri
- may be null
RelatedTopicModel fetchRelatedTopic(long id, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
id
- id of a topic or an associationassocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be null
ResultList<RelatedTopicModel> fetchRelatedTopics(long id, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
id
- id of a topic or an associationassocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be null
Object fetchTopicProperty(long topicId, String propUri)
Object fetchAssociationProperty(long assocId, 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)
boolean hasTopicProperty(long topicId, String propUri)
boolean hasAssociationProperty(long assocId, String propUri)
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |