Package systems.dmx.core.impl
Class CoreServiceImpl
- java.lang.Object
- 
- systems.dmx.core.impl.CoreServiceImpl
 
- 
- All Implemented Interfaces:
- CoreService
 
 public class CoreServiceImpl extends Object implements CoreService Implementation of the DMX core service. Embeddable into Java applications.
- 
- 
Constructor SummaryConstructors Constructor Description CoreServiceImpl(AccessLayer al, org.osgi.framework.BundleContext bundleContext)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAssocPropertyIndex(String propUri)voidaddTopicPropertyIndex(String propUri)DMXTransactionbeginTx()systems.dmx.core.impl.AssocImplcreateAssoc(AssocModel model)systems.dmx.core.impl.AssocTypeImplcreateAssocType(AssocTypeModel model)RoleTypecreateRoleType(RoleTypeModel model)systems.dmx.core.impl.TopicImplcreateTopic(TopicModel model)systems.dmx.core.impl.TopicTypeImplcreateTopicType(TopicTypeModel model)voiddeleteAssoc(long assocId)voiddeleteAssocType(String assocTypeUri)voiddeleteTopic(long topicId)voiddeleteTopicType(String topicTypeUri)voiddispatchEvent(String pluginUri, DMXEvent event, Object... params)voidfireEvent(DMXEvent event, Object... params)Iterable<Assoc>getAllAssocs()List<AssocType>getAllAssocTypes()List<RoleType>getAllRoleTypes()Iterable<Topic>getAllTopics()List<TopicType>getAllTopicTypes()AssocgetAssoc(long assocId)AssocgetAssocBetweenTopicAndAssoc(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri)AssocgetAssocBetweenTopicAndTopic(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2)Returns the association between two topics, qualified by association type and both role types.AssocgetAssocByValue(String typeUri, SimpleValue value)Retrieves a single association by type and exact value.List<Assoc>getAssocs(long topic1Id, long topic2Id)Returns all associations between two topics.List<Assoc>getAssocs(long topic1Id, long topic2Id, String assocTypeUri)Returns the associations between two topics.List<Assoc>getAssocsByProperty(String propUri, Object propValue)List<Assoc>getAssocsByPropertyRange(String propUri, Number from, Number to)List<Assoc>getAssocsByRoleType(String roleTypeUri)List<Assoc>getAssocsByType(String assocTypeUri)systems.dmx.core.impl.AssocTypeImplgetAssocType(String uri)systems.dmx.core.impl.AssocTypeImplgetAssocTypeImplicitly(long assocId)Acccesses an association type while enforcing the implicit READ permission.ObjectgetDatabaseVendorObject()ModelFactorygetModelFactory()DMXObjectgetObject(long id)List<PlayerModel>getPlayerModels(long assocId)PluginImplgetPlugin(String pluginUri)List<PluginInfo>getPluginInfo()PrivilegedAccessgetPrivilegedAccess()ObjectgetProperty(long id, String propUri)Returns a topic's or association's property value associated with the given property URI.RoleTypegetRoleType(String roleTypeUri)RoleTypegetRoleTypeImplicitly(long assocId, String roleTypeUri)TopicgetTopic(long topicId)Retrieves a topic by ID.TopicgetTopicByUri(String uri)Retrieves a topic by URI.TopicgetTopicByValue(String typeUri, SimpleValue value)Retrieves a single topic by type and 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 typeUri, SimpleValue value)Retrieves topics by type and exact value.systems.dmx.core.impl.TopicTypeImplgetTopicType(String uri)systems.dmx.core.impl.TopicTypeImplgetTopicTypeImplicitly(long topicId)Acccesses a topic type while enforcing the implicit READ permission.WebSocketServiceImplgetWebSocketService()booleanhasProperty(long id, String propUri)Checks whether for a given topic or association a property value is associated with a given property URI.voidindexTopicFulltext(long topicId, String text, String indexKey)QueryResultquery(String topicQuery, String topicTypeUri, boolean searchTopicChildren, String assocQuery, String assocTypeUri, boolean searchAssocChildren)List<Assoc>queryAssocs(String typeUri, String query)Retrieves associations by type and value.List<Topic>queryTopics(String typeUri, String query)Retrieves topics by type and value.TopicResultqueryTopicsFulltext(String query, String typeUri, boolean searchChildTopics)Performs a fulltext search in topic values and in entire topic trees.voidshutdown()voidupdateAssoc(AssocModel updateModel)voidupdateAssocType(AssocTypeModel updateModel)systems.dmx.core.impl.TopicImplupdateTopic(TopicModel updateModel)voidupdateTopicType(TopicTypeModel updateModel)
 
- 
- 
- 
Constructor Detail- 
CoreServiceImplpublic CoreServiceImpl(AccessLayer al, org.osgi.framework.BundleContext bundleContext) - Parameters:
- bundleContext- The context of the DMX Core bundle.
 
 
- 
 - 
Method Detail- 
getTopicpublic Topic getTopic(long topicId) Description copied from interface:CoreServiceRetrieves a topic by ID.- Specified by:
- getTopicin interface- CoreService
- Returns:
- the topic.
 
 - 
getTopicByUripublic Topic getTopicByUri(String uri) Description copied from interface:CoreServiceRetrieves a topic by URI.- Specified by:
- getTopicByUriin interface- CoreService
- Returns:
- the topic, or nullif no topic is found.
 
 - 
getTopicsByTypepublic List<Topic> getTopicsByType(String topicTypeUri) - Specified by:
- getTopicsByTypein interface- CoreService
 
 - 
getAllTopicspublic Iterable<Topic> getAllTopics() - Specified by:
- getAllTopicsin interface- CoreService
 
 - 
getTopicByValuepublic Topic getTopicByValue(String typeUri, SimpleValue value) Description copied from interface:CoreServiceRetrieves a single topic by type and exact value. Throws if more than one topic is found. Lucene query syntax (wildcards, phrase search, ...) is not supported. A text search is case-sensitive.- Specified by:
- getTopicByValuein interface- CoreService
- Parameters:
- typeUri- a topic type URI; only topics of this type are searched; mandatory
- value- the value to search for
- Returns:
- the found topic, or nullif no topic is found.
 
 - 
getTopicsByValuepublic List<Topic> getTopicsByValue(String typeUri, SimpleValue value) Description copied from interface:CoreServiceRetrieves topics by type and exact value. Lucene query syntax (wildcards, phrase search, ...) is not supported. A text search is case-sensitive.- Specified by:
- getTopicsByValuein interface- CoreService
- Parameters:
- typeUri- a topic type URI; only topics of this type are searched; mandatory
- value- the value to search for
- Returns:
- a list of found topics, may be empty.
 
 - 
queryTopicspublic List<Topic> queryTopics(String typeUri, String query) Description copied from interface:CoreServiceRetrieves topics by type and value. Lucene query syntax is supported. A topic is regarded a hit if the search term matches the topic's entire value (in contrast to a fulltext search). Spaces must be escaped though. Search is case-sensitive.- Specified by:
- queryTopicsin interface- CoreService
- Parameters:
- typeUri- a topic type URI; only topics of this type are searched; mandatory
- query- The query. Must be non-empty. Lucene query syntax is supported:- "*" matches arbitrary characters
- "?" matches a single character
- phrases enclosed in double quotes (")
- escape special character by preceding with back slash (\)
- combining search terms by "AND"/"OR" (uppercase required). Default is "OR". "&&" and "||" are respective synonyms.
 
- Returns:
- a list of found topics, may be empty.
 
 - 
queryTopicsFulltextpublic TopicResult queryTopicsFulltext(String query, String typeUri, boolean searchChildTopics) Description copied from interface:CoreServicePerforms a fulltext search in topic values and in entire topic trees. Single words are found in entire text-value. Lucene query syntax is supported. Search is case-insensitive.- Specified by:
- queryTopicsFulltextin interface- CoreService
- Parameters:
- query- The search query. Must be non-empty. Lucene query syntax is supported:- "*" matches arbitrary characters
- "?" matches a single character
- phrases enclosed in double quotes (")
- escape special character by preceding with back slash (\)
- combining search terms by "AND"/"OR" (uppercase required). Default is "OR". "&&" and "||" are respective synonyms.
 
- typeUri- Optional: a topic type URI; only topics of this type are searched. If null all topics are searched.
 If given, all returned topics are of this type (regardless of the "searchChildTopics" setting).
- searchChildTopics- Applicable only if "topicTypeUri" is given (ignored otherwise): if true the topic's child topics are searched as well.
 Example: to search for Persons where "Berlin" appears in *any* child topic pass "dmx.contacts.person" for "topicTypeUri", and set "searchChildTopics" to true.
- Returns:
- a TopicResult object that wraps both the original query parameters and the resulting topic list (may be empty).
 
 - 
indexTopicFulltextpublic void indexTopicFulltext(long topicId, String text, String indexKey)- Specified by:
- indexTopicFulltextin interface- CoreService
 
 - 
createTopicpublic systems.dmx.core.impl.TopicImpl createTopic(TopicModel model) - Specified by:
- createTopicin interface- CoreService
 
 - 
updateTopicpublic systems.dmx.core.impl.TopicImpl updateTopic(TopicModel updateModel) - Specified by:
- updateTopicin interface- CoreService
 
 - 
deleteTopicpublic void deleteTopic(long topicId) - Specified by:
- deleteTopicin interface- CoreService
 
 - 
getAssocpublic Assoc getAssoc(long assocId) - Specified by:
- getAssocin interface- CoreService
 
 - 
getPlayerModelspublic List<PlayerModel> getPlayerModels(long assocId) - Specified by:
- getPlayerModelsin interface- CoreService
 
 - 
getAssocsByTypepublic List<Assoc> getAssocsByType(String assocTypeUri) - Specified by:
- getAssocsByTypein interface- CoreService
 
 - 
getAssocsByRoleTypepublic List<Assoc> getAssocsByRoleType(String roleTypeUri) - Specified by:
- getAssocsByRoleTypein interface- CoreService
 
 - 
getAssocspublic List<Assoc> getAssocs(long topic1Id, long topic2Id) Description copied from interface:CoreServiceReturns all associations between two topics. If no such association exists an empty list is returned.- Specified by:
- getAssocsin interface- CoreService
 
 - 
getAssocspublic List<Assoc> getAssocs(long topic1Id, long topic2Id, String assocTypeUri) Description copied from interface:CoreServiceReturns the associations between two topics. If no such association exists an empty list is returned.- Specified by:
- getAssocsin interface- CoreService
- assocTypeUri- Assoc type filter. Pass- nullto switch filter off.
 
 - 
getAssocBetweenTopicAndTopicpublic Assoc getAssocBetweenTopicAndTopic(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2) Description copied from interface:CoreServiceReturns the association between two topics, qualified by association type and both role types. If no such association existsnullis returned. If more than one association exist, a runtime exception is thrown.- Specified by:
- getAssocBetweenTopicAndTopicin interface- CoreService
- Parameters:
- assocTypeUri- Assoc type filter. Pass- nullto switch filter off.
 
 - 
getAssocBetweenTopicAndAssocpublic Assoc getAssocBetweenTopicAndAssoc(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri) - Specified by:
- getAssocBetweenTopicAndAssocin interface- CoreService
 
 - 
getAllAssocspublic Iterable<Assoc> getAllAssocs() - Specified by:
- getAllAssocsin interface- CoreService
 
 - 
getAssocByValuepublic Assoc getAssocByValue(String typeUri, SimpleValue value) Description copied from interface:CoreServiceRetrieves a single association by type and exact value. Throws if more than one association is found. Lucene query syntax (wildcards, phrase search, ...) is not supported. A text search is case-sensitive.- Specified by:
- getAssocByValuein interface- CoreService
- Parameters:
- typeUri- an association type URI; only associations of this type are searched; mandatory
- value- the value to search for
- Returns:
- the found association, or nullif no association is found.
 
 - 
queryAssocspublic List<Assoc> queryAssocs(String typeUri, String query) Description copied from interface:CoreServiceRetrieves associations by type and value. Lucene query syntax is supported. An association is regarded a hit if the search term matches the association's entire value (in contrast to a fulltext search). Spaces must be escaped though. Search is case-sensitive.- Specified by:
- queryAssocsin interface- CoreService
- Parameters:
- typeUri- an association type URI; only associations of this type are searched; mandatory
- query- The query. Must be non-empty. Lucene query syntax is supported:- "*" matches arbitrary characters
- "?" matches a single character
- phrases enclosed in double quotes (")
- escape special character by preceding with back slash (\)
- combining search terms by "AND"/"OR" (uppercase required). Default is "OR". "&&" and "||" are respective synonyms.
 
- Returns:
- a list of found associations, may be empty.
 
 - 
createAssocpublic systems.dmx.core.impl.AssocImpl createAssoc(AssocModel model) - Specified by:
- createAssocin interface- CoreService
 
 - 
updateAssocpublic void updateAssoc(AssocModel updateModel) - Specified by:
- updateAssocin interface- CoreService
 
 - 
deleteAssocpublic void deleteAssoc(long assocId) - Specified by:
- deleteAssocin interface- CoreService
 
 - 
getTopicTypepublic systems.dmx.core.impl.TopicTypeImpl getTopicType(String uri) - Specified by:
- getTopicTypein interface- CoreService
 
 - 
getTopicTypeImplicitlypublic systems.dmx.core.impl.TopicTypeImpl getTopicTypeImplicitly(long topicId) Description copied from interface:CoreServiceAcccesses a topic type while enforcing the implicit READ permission. A user has implicit READ permission for the topic type if she has READ permission for the given topic.- Specified by:
- getTopicTypeImplicitlyin interface- CoreService
 
 - 
getAllTopicTypespublic List<TopicType> getAllTopicTypes() - Specified by:
- getAllTopicTypesin interface- CoreService
 
 - 
createTopicTypepublic systems.dmx.core.impl.TopicTypeImpl createTopicType(TopicTypeModel model) - Specified by:
- createTopicTypein interface- CoreService
 
 - 
updateTopicTypepublic void updateTopicType(TopicTypeModel updateModel) - Specified by:
- updateTopicTypein interface- CoreService
 
 - 
deleteTopicTypepublic void deleteTopicType(String topicTypeUri) - Specified by:
- deleteTopicTypein interface- CoreService
 
 - 
getAssocTypepublic systems.dmx.core.impl.AssocTypeImpl getAssocType(String uri) - Specified by:
- getAssocTypein interface- CoreService
 
 - 
getAssocTypeImplicitlypublic systems.dmx.core.impl.AssocTypeImpl getAssocTypeImplicitly(long assocId) Description copied from interface:CoreServiceAcccesses an association type while enforcing the implicit READ permission. A user has implicit READ permission for the association type if she has READ permission for the given association.- Specified by:
- getAssocTypeImplicitlyin interface- CoreService
 
 - 
getAllAssocTypespublic List<AssocType> getAllAssocTypes() - Specified by:
- getAllAssocTypesin interface- CoreService
 
 - 
createAssocTypepublic systems.dmx.core.impl.AssocTypeImpl createAssocType(AssocTypeModel model) - Specified by:
- createAssocTypein interface- CoreService
 
 - 
updateAssocTypepublic void updateAssocType(AssocTypeModel updateModel) - Specified by:
- updateAssocTypein interface- CoreService
 
 - 
deleteAssocTypepublic void deleteAssocType(String assocTypeUri) - Specified by:
- deleteAssocTypein interface- CoreService
 
 - 
getRoleTypepublic RoleType getRoleType(String roleTypeUri) - Specified by:
- getRoleTypein interface- CoreService
 
 - 
getRoleTypeImplicitlypublic RoleType getRoleTypeImplicitly(long assocId, String roleTypeUri) - Specified by:
- getRoleTypeImplicitlyin interface- CoreService
 
 - 
getAllRoleTypespublic List<RoleType> getAllRoleTypes() - Specified by:
- getAllRoleTypesin interface- CoreService
 
 - 
createRoleTypepublic RoleType createRoleType(RoleTypeModel model) - Specified by:
- createRoleTypein interface- CoreService
 
 - 
getObjectpublic DMXObject getObject(long id) - Specified by:
- getObjectin interface- CoreService
 
 - 
querypublic QueryResult query(String topicQuery, String topicTypeUri, boolean searchTopicChildren, String assocQuery, String assocTypeUri, boolean searchAssocChildren) - Specified by:
- queryin interface- CoreService
 
 - 
getPluginpublic PluginImpl getPlugin(String pluginUri) - Specified by:
- getPluginin interface- CoreService
 
 - 
getPluginInfopublic List<PluginInfo> getPluginInfo() - Specified by:
- getPluginInfoin interface- CoreService
 
 - 
fireEventpublic void fireEvent(DMXEvent event, Object... params) - Specified by:
- fireEventin interface- CoreService
 
 - 
dispatchEventpublic void dispatchEvent(String pluginUri, DMXEvent event, Object... params) - Specified by:
- dispatchEventin interface- CoreService
 
 - 
getPropertypublic Object getProperty(long id, String propUri) Description copied from interface:CoreServiceReturns a topic's or association's property value associated with the given property URI. If there's no property value associated with the property URI an exception is thrown.- Specified by:
- getPropertyin interface- CoreService
- Parameters:
- id- a topic ID, or an association ID
 
 - 
hasPropertypublic boolean hasProperty(long id, String propUri)Description copied from interface:CoreServiceChecks whether for a given topic or association a property value is associated with a given property URI.- Specified by:
- hasPropertyin interface- CoreService
- Parameters:
- id- a topic ID, or an association ID
 
 - 
getTopicsByPropertypublic List<Topic> getTopicsByProperty(String propUri, Object propValue) - Specified by:
- getTopicsByPropertyin interface- CoreService
 
 - 
getTopicsByPropertyRangepublic List<Topic> getTopicsByPropertyRange(String propUri, Number from, Number to) - Specified by:
- getTopicsByPropertyRangein interface- CoreService
 
 - 
getAssocsByPropertypublic List<Assoc> getAssocsByProperty(String propUri, Object propValue) - Specified by:
- getAssocsByPropertyin interface- CoreService
 
 - 
getAssocsByPropertyRangepublic List<Assoc> getAssocsByPropertyRange(String propUri, Number from, Number to) - Specified by:
- getAssocsByPropertyRangein interface- CoreService
 
 - 
addTopicPropertyIndexpublic void addTopicPropertyIndex(String propUri) - Specified by:
- addTopicPropertyIndexin interface- CoreService
 
 - 
addAssocPropertyIndexpublic void addAssocPropertyIndex(String propUri) - Specified by:
- addAssocPropertyIndexin interface- CoreService
 
 - 
beginTxpublic DMXTransaction beginTx() - Specified by:
- beginTxin interface- CoreService
 
 - 
getModelFactorypublic ModelFactory getModelFactory() - Specified by:
- getModelFactoryin interface- CoreService
 
 - 
getPrivilegedAccesspublic PrivilegedAccess getPrivilegedAccess() - Specified by:
- getPrivilegedAccessin interface- CoreService
 
 - 
getWebSocketServicepublic WebSocketServiceImpl getWebSocketService() - Specified by:
- getWebSocketServicein interface- CoreService
 
 - 
getDatabaseVendorObjectpublic Object getDatabaseVendorObject() - Specified by:
- getDatabaseVendorObjectin interface- CoreService
 
 - 
shutdownpublic void shutdown() 
 
- 
 
-