public final class PersistenceLayer extends StorageDecorator
Modifier and Type | Field and Description |
---|---|
(package private) EventManager |
em |
private Logger |
logger |
(package private) ModelFactoryImpl |
mf |
(package private) TypeStorage |
typeStorage |
private static String |
URI_PREFIX_ASSOCIATION_TYPE |
private static String |
URI_PREFIX_ROLE_TYPE |
private static String |
URI_PREFIX_TOPIC_TYPE |
Constructor and Description |
---|
PersistenceLayer(DMXStorage storage) |
Modifier and Type | Method and Description |
---|---|
(package private) TopicImpl |
_createTopic(TopicModelImpl model) |
private TopicImpl |
_createTopic(TopicModelImpl model,
String uriPrefix)
Creates a new topic in the DB.
|
(package private) Iterable<AssociationModelImpl> |
_getAssociations(String assocTypeUri,
long topic1Id,
long topic2Id,
String roleTypeUri1,
String roleTypeUri2)
Fetches from DB and filters READables.
|
(package private) AssociationTypeModelImpl |
_getAssociationType(String uri)
Type cache direct access.
|
(package private) TopicTypeModelImpl |
_getTopicType(String uri)
Type cache direct access.
|
private void |
bootstrapTypeCache() |
(package private) void |
checkAssociationReadAccess(long assocId) |
(package private) void |
checkAssociationWriteAccess(long assocId) |
(package private) <M extends DMXObjectModelImpl> |
checkReadAccess(M model) |
(package private) <O> O |
checkReadAccessAndInstantiate(DMXObjectModelImpl model) |
(package private) <O> List<O> |
checkReadAccessAndInstantiate(List<? extends DMXObjectModelImpl> models) |
(package private) void |
checkTopicReadAccess(long topicId) |
(package private) void |
checkTopicWriteAccess(long topicId) |
(package private) AssociationImpl |
createAssociation(AssociationModelImpl model)
Creates a new association in the DB.
|
(package private) AssociationImpl |
createAssociation(String typeUri,
RoleModel roleModel1,
RoleModel roleModel2)
Convenience.
|
(package private) void |
createAssociationInstantiation(long assocId,
String assocTypeUri) |
(package private) AssociationTypeImpl |
createAssociationType(AssociationTypeModelImpl model) |
(package private) Topic |
createRoleType(TopicModelImpl model) |
(package private) TopicImpl |
createTopic(TopicModelImpl model) |
(package private) void |
createTopicInstantiation(long topicId,
String topicTypeUri) |
(package private) TopicTypeImpl |
createTopicType(TopicTypeModelImpl model) |
private void |
createType(TypeModelImpl model,
String uriPrefix) |
(package private) void |
deleteAssociation(AssociationModelImpl assoc) |
(package private) void |
deleteAssociation(long assocId)
Convenience.
|
(package private) void |
deleteAssociationType(String assocTypeUri) |
(package private) void |
deleteTopic(long topicId)
Convenience.
|
(package private) void |
deleteTopic(TopicModelImpl topic) |
(package private) void |
deleteTopicType(String topicTypeUri) |
private <M extends DMXObjectModelImpl> |
filterReadables(List<M> models) |
(package private) Iterable<Association> |
getAllAssociations() |
(package private) List<AssociationType> |
getAllAssociationTypes() |
(package private) Iterable<Topic> |
getAllTopics() |
(package private) List<TopicType> |
getAllTopicTypes() |
(package private) Association |
getAssociation(long assocId) |
(package private) Association |
getAssociation(String assocTypeUri,
long topic1Id,
long topic2Id,
String roleTypeUri1,
String roleTypeUri2) |
(package private) List<AssociationModelImpl> |
getAssociationAssociations(long assocId) |
(package private) Association |
getAssociationBetweenTopicAndAssociation(String assocTypeUri,
long topicId,
long assocId,
String topicRoleTypeUri,
String assocRoleTypeUri) |
(package private) Association |
getAssociationByValue(String key,
SimpleValue value) |
(package private) RelatedAssociationModelImpl |
getAssociationRelatedAssociation(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
(package private) List<RelatedAssociationModelImpl> |
getAssociationRelatedAssociations(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
(package private) List<RelatedTopicModelImpl> |
getAssociationRelatedTopics(long assocId,
List<String> assocTypeUris,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
(package private) List<RelatedTopicModelImpl> |
getAssociationRelatedTopics(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
(package private) List<Association> |
getAssociations(long topic1Id,
long topic2Id) |
(package private) List<Association> |
getAssociations(String assocTypeUri,
long topic1Id,
long topic2Id) |
(package private) List<Association> |
getAssociations(String assocTypeUri,
long topic1Id,
long topic2Id,
String roleTypeUri1,
String roleTypeUri2) |
(package private) List<Association> |
getAssociationsByProperty(String propUri,
Object propValue) |
(package private) List<Association> |
getAssociationsByPropertyRange(String propUri,
Number from,
Number to) |
(package private) List<Association> |
getAssociationsByType(String assocTypeUri) |
(package private) List<Association> |
getAssociationsByValue(String key,
SimpleValue value) |
(package private) AssociationTypeImpl |
getAssociationType(String uri) |
(package private) AssociationTypeImpl |
getAssociationTypeImplicitly(long assocId) |
private List<String> |
getAssociationTypeUris() |
(package private) DMXObject |
getObject(long id) |
(package private) long[] |
getPlayerIds(long assocId) |
(package private) RelatedTopicModelImpl |
getRelatedTopic(long objectId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
(package private) List<RelatedTopicModelImpl> |
getRelatedTopics(long objectId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
(package private) Topic |
getTopic(long topicId) |
(package private) List<AssociationModelImpl> |
getTopicAssociations(long topicId) |
(package private) TopicImpl |
getTopicByUri(String uri) |
(package private) TopicImpl |
getTopicByValue(String key,
SimpleValue value) |
(package private) RelatedAssociationModelImpl |
getTopicRelatedAssociation(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
(package private) List<RelatedAssociationModelImpl> |
getTopicRelatedAssociations(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
(package private) List<RelatedTopicModelImpl> |
getTopicRelatedTopics(long topicId,
List<String> assocTypeUris,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
(package private) List<RelatedTopicModelImpl> |
getTopicRelatedTopics(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
(package private) List<Topic> |
getTopicsByProperty(String propUri,
Object propValue) |
(package private) List<Topic> |
getTopicsByPropertyRange(String propUri,
Number from,
Number to) |
(package private) List<Topic> |
getTopicsByType(String topicTypeUri) |
(package private) List<Topic> |
getTopicsByValue(String key,
SimpleValue value) |
(package private) TopicTypeImpl |
getTopicType(String uri) |
(package private) TopicTypeImpl |
getTopicTypeImplicitly(long topicId) |
private List<String> |
getTopicTypeUris() |
(package private) boolean |
hasReadAccess(DMXObjectModelImpl model) |
(package private) <O> List<O> |
instantiate(Iterable<? extends DMXObjectModelImpl> models) |
(package private) List<Topic> |
searchTopics(String searchTerm,
String fieldUri) |
private String |
typeUri(long objectId) |
(package private) void |
updateAssociation(AssociationModelImpl updateModel) |
(package private) void |
updateAssociation(AssociationModelImpl assoc,
AssociationModelImpl updateModel) |
(package private) void |
updateAssociationType(AssociationTypeModelImpl updateModel) |
(package private) void |
updateTopic(TopicModelImpl updateModel) |
(package private) void |
updateTopic(TopicModelImpl topic,
TopicModelImpl updateModel) |
(package private) void |
updateTopicType(TopicTypeModelImpl updateModel) |
private <M extends DMXObjectModelImpl> |
updateValues(M updateModel,
M targetObject) |
_deleteAssociation, _deleteTopic, beginTx, fetchAllAssociations, fetchAllTopics, fetchAssociation, fetchAssociation, fetchAssociation, fetchAssociationAssociations, fetchAssociationBetweenTopicAndAssociation, fetchAssociationRelatedAssociation, fetchAssociationRelatedAssociations, fetchAssociationRelatedTopic, fetchAssociationRelatedTopics, fetchAssociationRelatedTopics, fetchAssociations, fetchAssociations, fetchAssociationsBetweenTopicAndAssociation, fetchAssociationsByProperty, fetchAssociationsByPropertyRange, fetchMigrationNr, fetchObject, fetchPlayerIds, fetchProperty, fetchRelatedTopic, fetchRelatedTopics, fetchTopic, fetchTopic, fetchTopicAssociations, fetchTopicRelatedAssociation, fetchTopicRelatedAssociations, fetchTopicRelatedTopic, fetchTopicRelatedTopics, fetchTopicRelatedTopics, fetchTopics, fetchTopicsByProperty, fetchTopicsByPropertyRange, getDatabaseVendorObject, getDatabaseVendorObject, hasProperty, indexAssociationProperty, indexAssociationValue, indexTopicProperty, indexTopicValue, init, queryTopics, removeAssociationProperty, removeTopicProperty, shutdown, storeAssociation, storeAssociationProperty, storeAssociationTypeUri, storeAssociationUri, storeAssociationValue, storeAssociationValue, storeMigrationNr, storeRoleTypeUri, storeTopic, storeTopicProperty, storeTopicTypeUri, storeTopicUri, storeTopicValue, storeTopicValue
private static final String URI_PREFIX_TOPIC_TYPE
private static final String URI_PREFIX_ASSOCIATION_TYPE
private static final String URI_PREFIX_ROLE_TYPE
TypeStorage typeStorage
EventManager em
public PersistenceLayer(DMXStorage storage)
TopicImpl getTopicByUri(String uri)
TopicImpl getTopicByValue(String key, SimpleValue value)
List<Topic> getTopicsByValue(String key, SimpleValue value)
List<Topic> getTopicsByType(String topicTypeUri)
List<Topic> searchTopics(String searchTerm, String fieldUri)
Iterable<Topic> getAllTopics()
TopicImpl createTopic(TopicModelImpl model)
TopicImpl _createTopic(TopicModelImpl model)
private TopicImpl _createTopic(TopicModelImpl model, String uriPrefix)
void updateTopic(TopicModelImpl updateModel)
void updateTopic(TopicModelImpl topic, TopicModelImpl updateModel)
void deleteTopic(long topicId)
void deleteTopic(TopicModelImpl topic)
Association getAssociation(long assocId)
Association getAssociationByValue(String key, SimpleValue value)
List<Association> getAssociationsByValue(String key, SimpleValue value)
Association getAssociation(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2)
Association getAssociationBetweenTopicAndAssociation(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri)
List<Association> getAssociationsByType(String assocTypeUri)
List<Association> getAssociations(long topic1Id, long topic2Id)
List<Association> getAssociations(String assocTypeUri, long topic1Id, long topic2Id)
List<Association> getAssociations(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2)
Iterable<AssociationModelImpl> _getAssociations(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2)
Iterable<Association> getAllAssociations()
long[] getPlayerIds(long assocId)
AssociationImpl createAssociation(String typeUri, RoleModel roleModel1, RoleModel roleModel2)
AssociationImpl createAssociation(AssociationModelImpl model)
void updateAssociation(AssociationModelImpl updateModel)
void updateAssociation(AssociationModelImpl assoc, AssociationModelImpl updateModel)
void deleteAssociation(long assocId)
void deleteAssociation(AssociationModelImpl assoc)
void createTopicInstantiation(long topicId, String topicTypeUri)
void createAssociationInstantiation(long assocId, String assocTypeUri)
TopicTypeImpl getTopicType(String uri)
TopicTypeImpl getTopicTypeImplicitly(long topicId)
AssociationTypeImpl getAssociationType(String uri)
AssociationTypeImpl getAssociationTypeImplicitly(long assocId)
List<TopicType> getAllTopicTypes()
List<AssociationType> getAllAssociationTypes()
TopicTypeImpl createTopicType(TopicTypeModelImpl model)
AssociationTypeImpl createAssociationType(AssociationTypeModelImpl model)
void updateTopicType(TopicTypeModelImpl updateModel)
void updateAssociationType(AssociationTypeModelImpl updateModel)
void deleteTopicType(String topicTypeUri)
void deleteAssociationType(String assocTypeUri)
Topic createRoleType(TopicModelImpl model)
TopicTypeModelImpl _getTopicType(String uri)
AssociationTypeModelImpl _getAssociationType(String uri)
List<RelatedTopicModelImpl> getTopicRelatedTopics(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
List<RelatedTopicModelImpl> getTopicRelatedTopics(long topicId, List<String> assocTypeUris, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
RelatedAssociationModelImpl getTopicRelatedAssociation(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
List<RelatedAssociationModelImpl> getTopicRelatedAssociations(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
List<AssociationModelImpl> getTopicAssociations(long topicId)
List<RelatedTopicModelImpl> getAssociationRelatedTopics(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
List<RelatedTopicModelImpl> getAssociationRelatedTopics(long assocId, List<String> assocTypeUris, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
RelatedAssociationModelImpl getAssociationRelatedAssociation(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
List<RelatedAssociationModelImpl> getAssociationRelatedAssociations(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
List<AssociationModelImpl> getAssociationAssociations(long assocId)
RelatedTopicModelImpl getRelatedTopic(long objectId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
List<RelatedTopicModelImpl> getRelatedTopics(long objectId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
List<Topic> getTopicsByProperty(String propUri, Object propValue)
List<Topic> getTopicsByPropertyRange(String propUri, Number from, Number to)
List<Association> getAssociationsByProperty(String propUri, Object propValue)
List<Association> getAssociationsByPropertyRange(String propUri, Number from, Number to)
<O> O checkReadAccessAndInstantiate(DMXObjectModelImpl model)
<O> List<O> checkReadAccessAndInstantiate(List<? extends DMXObjectModelImpl> models)
private <M extends DMXObjectModelImpl> List<M> filterReadables(List<M> models)
boolean hasReadAccess(DMXObjectModelImpl model)
<M extends DMXObjectModelImpl> M checkReadAccess(M model)
void checkTopicReadAccess(long topicId)
AccessControlException
- if the current user has no permission.void checkAssociationReadAccess(long assocId)
AccessControlException
- if the current user has no permission.void checkTopicWriteAccess(long topicId)
AccessControlException
- if the current user has no permission.void checkAssociationWriteAccess(long assocId)
AccessControlException
- if the current user has no permission.<O> List<O> instantiate(Iterable<? extends DMXObjectModelImpl> models)
private List<String> getTopicTypeUris()
private List<String> getAssociationTypeUris()
private void createType(TypeModelImpl model, String uriPrefix)
private void bootstrapTypeCache()
private <M extends DMXObjectModelImpl> M updateValues(M updateModel, M targetObject)
Copyright © 2018. All Rights Reserved.