public interface CoreService
The responsibility of the DeepaMehta core service is to orchestrate the control flow and allow plugins to hook in. The main duties of the DeepaMehta core service are to provide access to the storage layer and to dispatch events to the installed plugins. ### FIXDOC
The DeepaMehta core service is a realization of the Inversion of Control pattern.
The DeepaMehta core service provides methods to deal with topics, associations, types, and plugins.
Plugin developer notes: Inside the PluginActivator
and Migration
classes an instance of the
DeepaMehta core service is available through the dm4
object.
Modifier and Type | Method and Description |
---|---|
void |
addAssociationPropertyIndex(String propUri) |
void |
addTopicPropertyIndex(String propUri) |
DeepaMehtaTransaction |
beginTx() |
Association |
createAssociation(AssociationModel model) |
AssociationType |
createAssociationType(AssociationTypeModel model) |
Topic |
createRoleType(TopicModel model) |
Topic |
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 assocTypeUri) |
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) |
Plugin |
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.
|
Topic |
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 topicTypeUri) |
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.
|
void |
updateAssociation(AssociationModel newModel) |
void |
updateAssociationType(AssociationTypeModel newModel) |
void |
updateTopic(TopicModel newModel) |
void |
updateTopicType(TopicTypeModel newModel) |
Topic getTopic(long topicId)
RuntimeException
- if no such topic exists.Topic getTopicByUri(String uri)
null
if no such topic exists.Topic getTopicByValue(String key, SimpleValue value)
Note: wildcards like "*" in String values are not interpreted. They are treated literally.
Compare to getTopicsByValue(String,SimpleValue)
IMPORTANT: Looking up a topic this way requires the corresponding type to be indexed with indexing mode
dm4.core.key
.
null
if no such topic exists.RuntimeException
- If more than one topic is found.List<Topic> getTopicsByValue(String key, SimpleValue value)
Wildcards 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
.
List<Topic> getTopicsByType(String topicTypeUri)
List<Topic> searchTopics(String searchTerm, String fieldUri)
IMPORTANT: Searching topics this way requires the corresponding type to be indexed with indexing mode
dm4.core.fulltext
or dm4.core.fulltext_key
. ### FIXDOC
fieldUri
- The URI of the data field to search. If null is provided all fields are searched. ### FIXDOC
### TODO: rename parameter to "key"?Iterable<Topic> getAllTopics()
Topic createTopic(TopicModel model)
void updateTopic(TopicModel newModel)
void deleteTopic(long topicId)
Association getAssociation(long assocId)
Association getAssociationByValue(String key, SimpleValue value)
Note: wildcards like "*" in String values are not interpreted. They are treated literally.
Compare to getAssociationsByValue(String,SimpleValue)
IMPORTANT: Looking up an association this way requires the corresponding type to be indexed with indexing mode
dm4.core.key
.
null
if no such association exists.RuntimeException
- If more than one association is found.List<Association> getAssociationsByValue(String key, SimpleValue value)
Wildcards 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
.
Association getAssociation(String assocTypeUri, long topic1Id, long topic2Id, 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.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(long topic1Id, long topic2Id, String assocTypeUri)
assocTypeUri
- Association type filter. Pass null
to switch filter off.Iterable<Association> getAllAssociations()
long[] getPlayerIds(long assocId)
Association createAssociation(AssociationModel model)
void updateAssociation(AssociationModel newModel)
void deleteAssociation(long assocId)
TopicType getTopicType(String topicTypeUri)
TopicType getTopicTypeImplicitly(long topicId)
List<TopicType> getAllTopicTypes()
TopicType createTopicType(TopicTypeModel model)
void updateTopicType(TopicTypeModel newModel)
void deleteTopicType(String topicTypeUri)
AssociationType getAssociationType(String assocTypeUri)
AssociationType getAssociationTypeImplicitly(long assocId)
List<AssociationType> getAllAssociationTypes()
AssociationType createAssociationType(AssociationTypeModel model)
void updateAssociationType(AssociationTypeModel newModel)
void deleteAssociationType(String assocTypeUri)
Topic createRoleType(TopicModel model)
DeepaMehtaObject getObject(long id)
List<PluginInfo> getPluginInfo()
void fireEvent(DeepaMehtaEvent event, Object... params)
void dispatchEvent(String pluginUri, DeepaMehtaEvent event, Object... params)
Object getProperty(long id, String propUri)
id
- a topic ID, or an association IDboolean hasProperty(long id, String propUri)
id
- a topic ID, or an association IDList<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)
void addTopicPropertyIndex(String propUri)
void addAssociationPropertyIndex(String propUri)
DeepaMehtaTransaction beginTx()
ModelFactory getModelFactory()
AccessControl getAccessControl()
Object getDatabaseVendorObject()
Copyright © 2016. All Rights Reserved.