de.deepamehta.core.service
Interface DeepaMehtaService

Show UML class diagram
All Known Implementing Classes:
EmbeddedService

public interface DeepaMehtaService

Specification of the DeepaMehta core service -- the heart of DeepaMehta.

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 deliver 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 dms object.


Method Summary
 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 deliverEvent(String pluginUri, DeepaMehtaEvent event, Object... params)
           
 void fireEvent(DeepaMehtaEvent event, Object... params)
           
 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)
           
 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.
 ResultList<RelatedAssociation> getAssociations(String assocTypeUri)
           
 List<Association> getAssociationsByProperty(String propUri, Object propValue)
           
 List<Association> getAssociationsByPropertyRange(String propUri, Number from, Number to)
           
 AssociationType getAssociationType(String assocTypeUri)
           
 List<String> getAssociationTypeUris()
           
 Object getDatabaseVendorObject()
           
 Plugin getPlugin(String pluginUri)
           
 List<PluginInfo> getPluginInfo()
           
 Topic getTopic(long topicId)
           
 Topic getTopic(String key, SimpleValue value)
          Looks up a single topic by exact value.
 ResultList<RelatedTopic> getTopics(String topicTypeUri, int maxResultSize)
           
 List<Topic> getTopics(String key, SimpleValue value)
          Looks up topics by key and value.
 List<Topic> getTopicsByProperty(String propUri, Object propValue)
           
 List<Topic> getTopicsByPropertyRange(String propUri, Number from, Number to)
           
 TopicType getTopicType(String topicTypeUri)
           
 List<String> getTopicTypeUris()
           
 TypeStorage getTypeStorage()
           
 List<Topic> searchTopics(String searchTerm, String fieldUri)
          Performs a fulltext search.
 void updateAssociation(AssociationModel model)
           
 void updateAssociationType(AssociationTypeModel model)
           
 void updateTopic(TopicModel model)
           
 void updateTopicType(TopicTypeModel model)
           
 

Method Detail

getTopic

Topic getTopic(long topicId)

getTopic

Topic getTopic(String key,
               SimpleValue value)
Looks up a single topic by exact value. If no such topic exists null is returned. If more than one topic is found a runtime exception is thrown.

Note: wildcards like "*" in String values are treated literally. They are not interpreted. Compare to #getTopics(String,SimpleValue,boolean)

IMPORTANT: Looking up a topic this way requires the corresponding type to be indexed with indexing mode dm4.core.key.


getTopics

List<Topic> getTopics(String key,
                      SimpleValue value)
Looks up topics by key and 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.


getTopics

ResultList<RelatedTopic> getTopics(String topicTypeUri,
                                   int maxResultSize)

searchTopics

List<Topic> searchTopics(String searchTerm,
                         String fieldUri)
Performs a fulltext search.

IMPORTANT: Searching topics this way requires the corresponding type to be indexed with indexing mode dm4.core.fulltext or dm4.core.fulltext_key. ### FIXDOC

Parameters:
fieldUri - The URI of the data field to search. If null is provided all fields are searched. ### FIXDOC ### TODO: rename parameter to "key"?

getAllTopics

Iterable<Topic> getAllTopics()

createTopic

Topic createTopic(TopicModel model)

updateTopic

void updateTopic(TopicModel model)

deleteTopic

void deleteTopic(long topicId)

getAssociation

Association getAssociation(long assocId)

getAssociation

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. If no such association exists null is returned. If more than one association exist, a runtime exception is thrown.

Parameters:
assocTypeUri - Association type filter. Pass null to switch filter off.

getAssociationBetweenTopicAndAssociation

Association getAssociationBetweenTopicAndAssociation(String assocTypeUri,
                                                     long topicId,
                                                     long assocId,
                                                     String topicRoleTypeUri,
                                                     String assocRoleTypeUri)

getAssociations

ResultList<RelatedAssociation> getAssociations(String assocTypeUri)

getAssociations

List<Association> getAssociations(long topic1Id,
                                  long topic2Id)
Returns all associations between two topics. If no such association exists an empty set is returned.


getAssociations

List<Association> getAssociations(long topic1Id,
                                  long topic2Id,
                                  String assocTypeUri)
Returns the associations between two topics. If no such association exists an empty set is returned.

Parameters:
assocTypeUri - Association type filter. Pass null to switch filter off.

getAllAssociations

Iterable<Association> getAllAssociations()

createAssociation

Association createAssociation(AssociationModel model)

updateAssociation

void updateAssociation(AssociationModel model)

deleteAssociation

void deleteAssociation(long assocId)

getTopicTypeUris

List<String> getTopicTypeUris()

getTopicType

TopicType getTopicType(String topicTypeUri)

getAllTopicTypes

List<TopicType> getAllTopicTypes()

createTopicType

TopicType createTopicType(TopicTypeModel model)

updateTopicType

void updateTopicType(TopicTypeModel model)

deleteTopicType

void deleteTopicType(String topicTypeUri)

getAssociationTypeUris

List<String> getAssociationTypeUris()

getAssociationType

AssociationType getAssociationType(String assocTypeUri)

getAllAssociationTypes

List<AssociationType> getAllAssociationTypes()

createAssociationType

AssociationType createAssociationType(AssociationTypeModel model)

updateAssociationType

void updateAssociationType(AssociationTypeModel model)

deleteAssociationType

void deleteAssociationType(String assocTypeUri)

createRoleType

Topic createRoleType(TopicModel model)

getPlugin

Plugin getPlugin(String pluginUri)

getPluginInfo

List<PluginInfo> getPluginInfo()

fireEvent

void fireEvent(DeepaMehtaEvent event,
               Object... params)

deliverEvent

void deliverEvent(String pluginUri,
                  DeepaMehtaEvent event,
                  Object... params)

getTopicsByProperty

List<Topic> getTopicsByProperty(String propUri,
                                Object propValue)

getTopicsByPropertyRange

List<Topic> getTopicsByPropertyRange(String propUri,
                                     Number from,
                                     Number to)

getAssociationsByProperty

List<Association> getAssociationsByProperty(String propUri,
                                            Object propValue)

getAssociationsByPropertyRange

List<Association> getAssociationsByPropertyRange(String propUri,
                                                 Number from,
                                                 Number to)

beginTx

DeepaMehtaTransaction beginTx()

getTypeStorage

TypeStorage getTypeStorage()

getDatabaseVendorObject

Object getDatabaseVendorObject()


Copyright © 2014. All Rights Reserved.