class StorageDecorator extends Object
Modifier and Type | Field and Description |
---|---|
private Logger |
logger |
private DMXStorage |
storage |
Constructor and Description |
---|
StorageDecorator(DMXStorage storage) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
_deleteAssociation(long assocId) |
(package private) void |
_deleteTopic(long topicId)
Deletes the topic.
|
(package private) DMXTransaction |
beginTx() |
(package private) Iterator<AssociationModelImpl> |
fetchAllAssociations() |
(package private) Iterator<TopicModelImpl> |
fetchAllTopics() |
(package private) AssociationModelImpl |
fetchAssociation(long assocId) |
(package private) AssociationModelImpl |
fetchAssociation(String assocTypeUri,
long topicId1,
long topicId2,
String roleTypeUri1,
String roleTypeUri2)
Convenience method (checks singularity).
|
(package private) AssociationModelImpl |
fetchAssociation(String key,
SimpleValue value)
Looks up a single association by exact value.
|
(package private) List<AssociationModelImpl> |
fetchAssociationAssociations(long assocId) |
(package private) AssociationModelImpl |
fetchAssociationBetweenTopicAndAssociation(String assocTypeUri,
long topicId,
long assocId,
String topicRoleTypeUri,
String assocRoleTypeUri)
Convenience method (checks singularity).
|
(package private) RelatedAssociationModelImpl |
fetchAssociationRelatedAssociation(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri)
Convenience method (checks singularity).
|
(package private) List<RelatedAssociationModelImpl> |
fetchAssociationRelatedAssociations(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
(package private) RelatedTopicModelImpl |
fetchAssociationRelatedTopic(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
Convenience method (checks singularity).
|
(package private) List<RelatedTopicModelImpl> |
fetchAssociationRelatedTopics(long assocId,
List<String> assocTypeUris,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
Convenience method (receives *list* of association types).
|
(package private) List<RelatedTopicModelImpl> |
fetchAssociationRelatedTopics(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
(package private) List<AssociationModelImpl> |
fetchAssociations(String assocTypeUri,
long topicId1,
long topicId2,
String roleTypeUri1,
String roleTypeUri2)
Returns the associations between two topics.
|
(package private) List<AssociationModelImpl> |
fetchAssociations(String key,
SimpleValue value) |
(package private) List<AssociationModelImpl> |
fetchAssociationsBetweenTopicAndAssociation(String assocTypeUri,
long topicId,
long assocId,
String topicRoleTypeUri,
String assocRoleTypeUri) |
(package private) List<AssociationModelImpl> |
fetchAssociationsByProperty(String propUri,
Object propValue) |
(package private) List<AssociationModelImpl> |
fetchAssociationsByPropertyRange(String propUri,
Number from,
Number to) |
(package private) int |
fetchMigrationNr() |
(package private) DMXObjectModelImpl |
fetchObject(long id) |
(package private) long[] |
fetchPlayerIds(long assocId) |
(package private) Object |
fetchProperty(long id,
String propUri) |
(package private) RelatedTopicModelImpl |
fetchRelatedTopic(long objectId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
Convenience method (checks singularity).
|
(package private) List<RelatedTopicModelImpl> |
fetchRelatedTopics(long objectId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
(package private) TopicModelImpl |
fetchTopic(long topicId) |
(package private) TopicModelImpl |
fetchTopic(String key,
SimpleValue value)
Looks up a single topic by exact value.
|
(package private) List<AssociationModelImpl> |
fetchTopicAssociations(long topicId) |
(package private) RelatedAssociationModelImpl |
fetchTopicRelatedAssociation(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri)
Convenience method (checks singularity).
|
(package private) List<RelatedAssociationModelImpl> |
fetchTopicRelatedAssociations(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
(package private) RelatedTopicModelImpl |
fetchTopicRelatedTopic(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
Convenience method (checks singularity).
|
(package private) List<RelatedTopicModelImpl> |
fetchTopicRelatedTopics(long topicId,
List<String> assocTypeUris,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
Convenience method (receives *list* of association types).
|
(package private) List<RelatedTopicModelImpl> |
fetchTopicRelatedTopics(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
(package private) List<TopicModelImpl> |
fetchTopics(String key,
SimpleValue value) |
(package private) List<TopicModelImpl> |
fetchTopicsByProperty(String propUri,
Object propValue) |
(package private) List<TopicModelImpl> |
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 |
indexAssociationProperty(long assocId,
String propUri,
Object propValue) |
(package private) void |
indexAssociationValue(long assocId,
IndexMode indexMode,
String indexKey,
SimpleValue indexValue) |
(package private) void |
indexTopicProperty(long topicId,
String propUri,
Object propValue) |
(package private) void |
indexTopicValue(long topicId,
IndexMode indexMode,
String indexKey,
SimpleValue indexValue) |
(package private) boolean |
init()
Initializes the database.
|
(package private) List<TopicModelImpl> |
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 final DMXStorage storage
StorageDecorator(DMXStorage storage)
final TopicModelImpl fetchTopic(long topicId)
final TopicModelImpl fetchTopic(String key, SimpleValue value)
IMPORTANT: Looking up a topic this way requires the corresponding type to be indexed with indexing mode
dmx.core.key
.
null
if no such topic exists.
Note: its child topics are not fetched.RuntimeException
- if more than one topic is found.final List<TopicModelImpl> fetchTopics(String key, SimpleValue value)
final List<TopicModelImpl> queryTopics(String key, SimpleValue value)
final Iterator<TopicModelImpl> fetchAllTopics()
final void storeTopic(TopicModel model)
Actually only the topic URI and type URI are stored and indexed. The topic value is not stored.
final void storeTopicUri(long topicId, String uri)
final void storeTopicTypeUri(long topicId, String topicTypeUri)
final void storeTopicValue(long topicId, SimpleValue value)
final void storeTopicValue(long topicId, SimpleValue value, List<IndexMode> indexModes, String indexKey, SimpleValue indexValue)
final void indexTopicValue(long topicId, IndexMode indexMode, String indexKey, SimpleValue indexValue)
final void _deleteTopic(long topicId)
Prerequisite: the topic has no relations.
final AssociationModelImpl fetchAssociation(long assocId)
final AssociationModelImpl 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
dmx.core.key
.
final List<AssociationModelImpl> fetchAssociations(String key, SimpleValue value)
final AssociationModelImpl 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 mandatoryfinal List<AssociationModelImpl> fetchAssociations(String assocTypeUri, long topicId1, long topicId2, String roleTypeUri1, String roleTypeUri2)
assocTypeUri
- Association type filter. Pass null
to switch filter off.final AssociationModelImpl fetchAssociationBetweenTopicAndAssociation(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri)
final List<AssociationModelImpl> fetchAssociationsBetweenTopicAndAssociation(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri)
final Iterator<AssociationModelImpl> fetchAllAssociations()
final long[] fetchPlayerIds(long assocId)
final void storeAssociationUri(long assocId, String uri)
final void storeAssociationTypeUri(long assocId, String assocTypeUri)
final void storeRoleTypeUri(long assocId, long playerId, String roleTypeUri)
final void storeAssociationValue(long assocId, SimpleValue value)
final void storeAssociationValue(long assocId, SimpleValue value, List<IndexMode> indexModes, String indexKey, SimpleValue indexValue)
final void indexAssociationValue(long assocId, IndexMode indexMode, String indexKey, SimpleValue indexValue)
final void storeAssociation(AssociationModel model)
final void _deleteAssociation(long assocId)
final DMXObjectModelImpl fetchObject(long id)
final RelatedTopicModelImpl fetchTopicRelatedTopic(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullfinal List<RelatedTopicModelImpl> fetchTopicRelatedTopics(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullfinal List<RelatedTopicModelImpl> fetchTopicRelatedTopics(long topicId, List<String> assocTypeUris, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
assocTypeUris
- may *not* be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullfinal RelatedAssociationModelImpl fetchTopicRelatedAssociation(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
final List<RelatedAssociationModelImpl> fetchTopicRelatedAssociations(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersAssocTypeUri
- may be nullfinal List<AssociationModelImpl> fetchTopicAssociations(long topicId)
final RelatedTopicModelImpl fetchAssociationRelatedTopic(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
final List<RelatedTopicModelImpl> fetchAssociationRelatedTopics(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
final List<RelatedTopicModelImpl> fetchAssociationRelatedTopics(long assocId, List<String> assocTypeUris, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
assocTypeUris
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullfinal RelatedAssociationModelImpl fetchAssociationRelatedAssociation(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
final List<RelatedAssociationModelImpl> fetchAssociationRelatedAssociations(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersAssocTypeUri
- may be nullfinal List<AssociationModelImpl> fetchAssociationAssociations(long assocId)
final RelatedTopicModelImpl 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 nullfinal List<RelatedTopicModelImpl> 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 nullfinal Object fetchProperty(long id, String propUri)
final boolean hasProperty(long id, String propUri)
final List<TopicModelImpl> fetchTopicsByProperty(String propUri, Object propValue)
final List<TopicModelImpl> fetchTopicsByPropertyRange(String propUri, Number from, Number to)
final List<AssociationModelImpl> fetchAssociationsByProperty(String propUri, Object propValue)
final List<AssociationModelImpl> fetchAssociationsByPropertyRange(String propUri, Number from, Number to)
final void storeTopicProperty(long topicId, String propUri, Object propValue, boolean addToIndex)
final void storeAssociationProperty(long assocId, String propUri, Object propValue, boolean addToIndex)
final void indexTopicProperty(long topicId, String propUri, Object propValue)
final void indexAssociationProperty(long assocId, String propUri, Object propValue)
final void removeTopicProperty(long topicId, String propUri)
final void removeAssociationProperty(long assocId, String propUri)
final DMXTransaction beginTx()
final boolean init()
true
if a clean install is detected, false
otherwise.final void shutdown()
final int fetchMigrationNr()
final void storeMigrationNr(int migrationNr)
final Object getDatabaseVendorObject()
final Object getDatabaseVendorObject(long objectId)
Copyright © 2018. All Rights Reserved.