public class CoreServiceImpl extends Object implements CoreService
| Modifier and Type | Field and Description |
|---|---|
(package private) AccessControl |
accessControl |
(package private) org.osgi.framework.BundleContext |
bundleContext |
(package private) EventManager |
em |
private Logger |
logger |
(package private) ModelFactory |
mf |
(package private) MigrationManager |
migrationManager |
(package private) PersistenceLayer |
pl |
(package private) PluginManager |
pluginManager |
(package private) WebPublishingService |
wpService |
| Constructor and Description |
|---|
CoreServiceImpl(PersistenceLayer pl,
org.osgi.framework.BundleContext bundleContext) |
| Modifier and Type | Method and Description |
|---|---|
private void |
_associateDataType(String typeUri,
String dataTypeUri)
Low-level method that stores an (data type) association without its "Instantiation" association.
|
private void |
_createTopic(TopicModel model)
Low-level method that stores a topic without its "Instantiation" association.
|
void |
addAssociationPropertyIndex(String propUri) |
void |
addTopicPropertyIndex(String propUri) |
DeepaMehtaTransaction |
beginTx() |
AssociationImpl |
createAssociation(AssociationModel model) |
(package private) Association |
createAssociation(String typeUri,
RoleModel roleModel1,
RoleModel roleModel2)
Convenience method.
|
AssociationType |
createAssociationType(AssociationTypeModel model) |
Topic |
createRoleType(TopicModel model) |
TopicImpl |
createTopic(TopicModel model) |
TopicType |
createTopicType(TopicTypeModel model) |
void |
deleteAssociation(long assocId) |
void |
deleteAssociationType(String assocTypeUri) |
void |
deleteTopic(long topicId) |
void |
deleteTopicType(String topicTypeUri) |
void |
dispatchEvent(String pluginUri,
DeepaMehtaEvent event,
Object... params) |
void |
fireEvent(DeepaMehtaEvent event,
Object... params) |
AccessControl |
getAccessControl() |
Iterable<Association> |
getAllAssociations() |
List<AssociationType> |
getAllAssociationTypes() |
Iterable<Topic> |
getAllTopics() |
List<TopicType> |
getAllTopicTypes() |
Association |
getAssociation(long assocId) |
Association |
getAssociation(String assocTypeUri,
long topic1Id,
long topic2Id,
String roleTypeUri1,
String roleTypeUri2)
Returns the association between two topics, qualified by association type and both role types.
|
Association |
getAssociationBetweenTopicAndAssociation(String assocTypeUri,
long topicId,
long assocId,
String topicRoleTypeUri,
String assocRoleTypeUri) |
Association |
getAssociationByValue(String key,
SimpleValue value)
Looks up a single association by exact value.
|
List<Association> |
getAssociations(long topic1Id,
long topic2Id)
Returns all associations between two topics.
|
List<Association> |
getAssociations(long topic1Id,
long topic2Id,
String assocTypeUri)
Returns the associations between two topics.
|
List<Association> |
getAssociationsByProperty(String propUri,
Object propValue) |
List<Association> |
getAssociationsByPropertyRange(String propUri,
Number from,
Number to) |
List<Association> |
getAssociationsByType(String assocTypeUri) |
List<Association> |
getAssociationsByValue(String key,
SimpleValue value)
Looks up associations by key and value.
|
AssociationType |
getAssociationType(String uri) |
AssociationType |
getAssociationTypeImplicitly(long assocId)
Acccesses an association type while enforcing the implicit READ permission.
|
Object |
getDatabaseVendorObject() |
ModelFactory |
getModelFactory() |
DeepaMehtaObject |
getObject(long id) |
long[] |
getPlayerIds(long assocId) |
PluginImpl |
getPlugin(String pluginUri) |
List<PluginInfo> |
getPluginInfo() |
Object |
getProperty(long id,
String propUri)
Returns a topic's or association's property value associated with the given property URI.
|
Topic |
getTopic(long topicId)
Accesses a topic by ID.
|
TopicImpl |
getTopicByUri(String uri)
Accesses a topic by URI.
|
Topic |
getTopicByValue(String key,
SimpleValue value)
Looks up a single topic by exact value.
|
List<Topic> |
getTopicsByProperty(String propUri,
Object propValue) |
List<Topic> |
getTopicsByPropertyRange(String propUri,
Number from,
Number to) |
List<Topic> |
getTopicsByType(String topicTypeUri) |
List<Topic> |
getTopicsByValue(String key,
SimpleValue value)
Looks up topics by key and value.
|
TopicType |
getTopicType(String uri) |
TopicType |
getTopicTypeImplicitly(long topicId)
Acccesses a topic type while enforcing the implicit READ permission.
|
boolean |
hasProperty(long id,
String propUri)
Checks whether for a given topic or association a property value is associated with a given property URI.
|
List<Topic> |
searchTopics(String searchTerm,
String fieldUri)
Performs a fulltext search.
|
private void |
setupBootstrapContent() |
private void |
setupDB()
Setups the database:
1) initializes the database.
|
void |
updateAssociation(AssociationModel newModel) |
void |
updateAssociationType(AssociationTypeModel newModel) |
void |
updateTopic(TopicModel newModel) |
void |
updateTopicType(TopicTypeModel newModel) |
org.osgi.framework.BundleContext bundleContext
EventManager em
ModelFactory mf
MigrationManager migrationManager
PluginManager pluginManager
AccessControl accessControl
WebPublishingService wpService
public CoreServiceImpl(PersistenceLayer pl, org.osgi.framework.BundleContext bundleContext)
bundleContext - The context of the DeepaMehta 4 Core bundle.public Topic getTopic(long topicId)
CoreServicegetTopic in interface CoreServicepublic TopicImpl getTopicByUri(String uri)
CoreServicegetTopicByUri in interface CoreServicenull if no such topic exists.public Topic getTopicByValue(String key, SimpleValue value)
CoreService
Note: wildcards like "*" in String values are not interpreted. They are treated literally.
Compare to CoreService.getTopicsByValue(String,SimpleValue)
IMPORTANT: Looking up a topic this way requires the corresponding type to be indexed with indexing mode
dm4.core.key.
getTopicByValue in interface CoreServicenull if no such topic exists.public List<Topic> getTopicsByValue(String key, SimpleValue value)
CoreServiceWildcards like "*" in String values are interpreted.
IMPORTANT: Looking up topics this way requires the corresponding type to be indexed with indexing mode
dm4.core.key.
getTopicsByValue in interface CoreServicepublic List<Topic> getTopicsByType(String topicTypeUri)
getTopicsByType in interface CoreServicepublic List<Topic> searchTopics(String searchTerm, String fieldUri)
CoreService
IMPORTANT: Searching topics this way requires the corresponding type to be indexed with indexing mode
dm4.core.fulltext or dm4.core.fulltext_key. ### FIXDOC
searchTopics in interface CoreServicefieldUri - The URI of the data field to search. If null is provided all fields are searched. ### FIXDOC
### TODO: rename parameter to "key"?public Iterable<Topic> getAllTopics()
getAllTopics in interface CoreServicepublic TopicImpl createTopic(TopicModel model)
createTopic in interface CoreServicepublic void updateTopic(TopicModel newModel)
updateTopic in interface CoreServicepublic void deleteTopic(long topicId)
deleteTopic in interface CoreServicepublic Association getAssociation(long assocId)
getAssociation in interface CoreServicepublic Association getAssociationByValue(String key, SimpleValue value)
CoreService
Note: wildcards like "*" in String values are not interpreted. They are treated literally.
Compare to CoreService.getAssociationsByValue(String,SimpleValue)
IMPORTANT: Looking up an association this way requires the corresponding type to be indexed with indexing mode
dm4.core.key.
getAssociationByValue in interface CoreServicenull if no such association exists.public List<Association> getAssociationsByValue(String key, SimpleValue value)
CoreServiceWildcards like "*" in String values are interpreted.
IMPORTANT: Looking up associations this way requires the corresponding type to be indexed with indexing mode
dm4.core.key.
getAssociationsByValue in interface CoreServicepublic Association getAssociation(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2)
CoreServicenull is returned.
If more than one association exist, a runtime exception is thrown.getAssociation in interface CoreServiceassocTypeUri - Association type filter. Pass null to switch filter off.public Association getAssociationBetweenTopicAndAssociation(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri)
getAssociationBetweenTopicAndAssociation in interface CoreServicepublic List<Association> getAssociationsByType(String assocTypeUri)
getAssociationsByType in interface CoreServicepublic List<Association> getAssociations(long topic1Id, long topic2Id)
CoreServicegetAssociations in interface CoreServicepublic List<Association> getAssociations(long topic1Id, long topic2Id, String assocTypeUri)
CoreServicegetAssociations in interface CoreServiceassocTypeUri - Association type filter. Pass null to switch filter off.public Iterable<Association> getAllAssociations()
getAllAssociations in interface CoreServicepublic long[] getPlayerIds(long assocId)
getPlayerIds in interface CoreServicepublic AssociationImpl createAssociation(AssociationModel model)
createAssociation in interface CoreServicepublic void updateAssociation(AssociationModel newModel)
updateAssociation in interface CoreServicepublic void deleteAssociation(long assocId)
deleteAssociation in interface CoreServicepublic TopicType getTopicType(String uri)
getTopicType in interface CoreServicepublic TopicType getTopicTypeImplicitly(long topicId)
CoreServicegetTopicTypeImplicitly in interface CoreServicepublic List<TopicType> getAllTopicTypes()
getAllTopicTypes in interface CoreServicepublic TopicType createTopicType(TopicTypeModel model)
createTopicType in interface CoreServicepublic void updateTopicType(TopicTypeModel newModel)
updateTopicType in interface CoreServicepublic void deleteTopicType(String topicTypeUri)
deleteTopicType in interface CoreServicepublic AssociationType getAssociationType(String uri)
getAssociationType in interface CoreServicepublic AssociationType getAssociationTypeImplicitly(long assocId)
CoreServicegetAssociationTypeImplicitly in interface CoreServicepublic List<AssociationType> getAllAssociationTypes()
getAllAssociationTypes in interface CoreServicepublic AssociationType createAssociationType(AssociationTypeModel model)
createAssociationType in interface CoreServicepublic void updateAssociationType(AssociationTypeModel newModel)
updateAssociationType in interface CoreServicepublic void deleteAssociationType(String assocTypeUri)
deleteAssociationType in interface CoreServicepublic Topic createRoleType(TopicModel model)
createRoleType in interface CoreServicepublic DeepaMehtaObject getObject(long id)
getObject in interface CoreServicepublic PluginImpl getPlugin(String pluginUri)
getPlugin in interface CoreServicepublic List<PluginInfo> getPluginInfo()
getPluginInfo in interface CoreServicepublic void fireEvent(DeepaMehtaEvent event, Object... params)
fireEvent in interface CoreServicepublic void dispatchEvent(String pluginUri, DeepaMehtaEvent event, Object... params)
dispatchEvent in interface CoreServicepublic Object getProperty(long id, String propUri)
CoreServicegetProperty in interface CoreServiceid - a topic ID, or an association IDpublic boolean hasProperty(long id, String propUri)
CoreServicehasProperty in interface CoreServiceid - a topic ID, or an association IDpublic List<Topic> getTopicsByProperty(String propUri, Object propValue)
getTopicsByProperty in interface CoreServicepublic List<Topic> getTopicsByPropertyRange(String propUri, Number from, Number to)
getTopicsByPropertyRange in interface CoreServicepublic List<Association> getAssociationsByProperty(String propUri, Object propValue)
getAssociationsByProperty in interface CoreServicepublic List<Association> getAssociationsByPropertyRange(String propUri, Number from, Number to)
getAssociationsByPropertyRange in interface CoreServicepublic void addTopicPropertyIndex(String propUri)
addTopicPropertyIndex in interface CoreServicepublic void addAssociationPropertyIndex(String propUri)
addAssociationPropertyIndex in interface CoreServicepublic DeepaMehtaTransaction beginTx()
beginTx in interface CoreServicepublic ModelFactory getModelFactory()
getModelFactory in interface CoreServicepublic AccessControl getAccessControl()
getAccessControl in interface CoreServicepublic Object getDatabaseVendorObject()
getDatabaseVendorObject in interface CoreServiceAssociation createAssociation(String typeUri, RoleModel roleModel1, RoleModel roleModel2)
private void setupDB()
private void setupBootstrapContent()
private void _createTopic(TopicModel model)
private void _associateDataType(String typeUri, String dataTypeUri)
Copyright © 2016. All Rights Reserved.