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.
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)
List<String> getTopicTypeUris()
TopicType getTopicType(String topicTypeUri)
List<TopicType> getAllTopicTypes()
TopicType createTopicType(TopicTypeModel model)
void updateTopicType(TopicTypeModel newModel)
void deleteTopicType(String topicTypeUri)
List<String> getAssociationTypeUris()
AssociationType getAssociationType(String assocTypeUri)
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.