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 |
(package private) WebSocketsServiceImpl |
wsService |
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) |
DMXTransaction |
beginTx() |
AssociationImpl |
createAssociation(AssociationModel model) |
(package private) Association |
createAssociation(String typeUri,
RoleModel roleModel1,
RoleModel roleModel2)
Convenience method.
|
AssociationTypeImpl |
createAssociationType(AssociationTypeModel model) |
Topic |
createRoleType(TopicModel model) |
TopicImpl |
createTopic(TopicModel model) |
TopicTypeImpl |
createTopicType(TopicTypeModel model) |
void |
deleteAssociation(long assocId) |
void |
deleteAssociationType(String assocTypeUri) |
void |
deleteTopic(long topicId) |
void |
deleteTopicType(String topicTypeUri) |
void |
dispatchEvent(String pluginUri,
DMXEvent event,
Object... params) |
void |
fireEvent(DMXEvent 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.
|
AssociationTypeImpl |
getAssociationType(String uri) |
AssociationTypeImpl |
getAssociationTypeImplicitly(long assocId)
Acccesses an association type while enforcing the implicit READ permission.
|
Object |
getDatabaseVendorObject() |
ModelFactory |
getModelFactory() |
DMXObject |
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.
|
TopicTypeImpl |
getTopicType(String uri) |
TopicTypeImpl |
getTopicTypeImplicitly(long topicId)
Acccesses a topic type while enforcing the implicit READ permission.
|
WebSocketsServiceImpl |
getWebSocketsService() |
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 |
shutdown() |
void |
updateAssociation(AssociationModel updateModel) |
void |
updateAssociationType(AssociationTypeModel updateModel) |
void |
updateTopic(TopicModel updateModel) |
void |
updateTopicType(TopicTypeModel updateModel) |
org.osgi.framework.BundleContext bundleContext
EventManager em
ModelFactory mf
MigrationManager migrationManager
PluginManager pluginManager
AccessControl accessControl
WebSocketsServiceImpl wsService
WebPublishingService wpService
public CoreServiceImpl(PersistenceLayer pl, org.osgi.framework.BundleContext bundleContext)
bundleContext
- The context of the DMX Core bundle.public Topic getTopic(long topicId)
CoreService
getTopic
in interface CoreService
public TopicImpl getTopicByUri(String uri)
CoreService
getTopicByUri
in interface CoreService
null
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
dmx.core.key
.
getTopicByValue
in interface CoreService
null
if no such topic exists.public List<Topic> getTopicsByValue(String key, SimpleValue value)
CoreService
Wildcards like "*" in String values are interpreted.
IMPORTANT: Looking up topics this way requires the corresponding type to be indexed with indexing mode
dmx.core.key
.
getTopicsByValue
in interface CoreService
public List<Topic> getTopicsByType(String topicTypeUri)
getTopicsByType
in interface CoreService
public List<Topic> searchTopics(String searchTerm, String fieldUri)
CoreService
IMPORTANT: Searching topics this way requires the corresponding type to be indexed with indexing mode
dmx.core.fulltext
or dmx.core.fulltext_key
. ### FIXDOC
searchTopics
in interface CoreService
fieldUri
- The URI of the data field to search. If null is provided all fields are searched. ### FIXDOC
### TODO: rename parameter to "key"/"typeUri"?public Iterable<Topic> getAllTopics()
getAllTopics
in interface CoreService
public TopicImpl createTopic(TopicModel model)
createTopic
in interface CoreService
public void updateTopic(TopicModel updateModel)
updateTopic
in interface CoreService
public void deleteTopic(long topicId)
deleteTopic
in interface CoreService
public Association getAssociation(long assocId)
getAssociation
in interface CoreService
public 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
dmx.core.key
.
getAssociationByValue
in interface CoreService
null
if no such association exists.public List<Association> getAssociationsByValue(String key, SimpleValue value)
CoreService
Wildcards like "*" in String values are interpreted.
IMPORTANT: Looking up associations this way requires the corresponding type to be indexed with indexing mode
dmx.core.key
.
getAssociationsByValue
in interface CoreService
public Association getAssociation(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2)
CoreService
null
is returned.
If more than one association exist, a runtime exception is thrown.getAssociation
in interface CoreService
assocTypeUri
- 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 CoreService
public List<Association> getAssociationsByType(String assocTypeUri)
getAssociationsByType
in interface CoreService
public List<Association> getAssociations(long topic1Id, long topic2Id)
CoreService
getAssociations
in interface CoreService
public List<Association> getAssociations(long topic1Id, long topic2Id, String assocTypeUri)
CoreService
getAssociations
in interface CoreService
assocTypeUri
- Association type filter. Pass null
to switch filter off.public Iterable<Association> getAllAssociations()
getAllAssociations
in interface CoreService
public long[] getPlayerIds(long assocId)
getPlayerIds
in interface CoreService
public AssociationImpl createAssociation(AssociationModel model)
createAssociation
in interface CoreService
public void updateAssociation(AssociationModel updateModel)
updateAssociation
in interface CoreService
public void deleteAssociation(long assocId)
deleteAssociation
in interface CoreService
public TopicTypeImpl getTopicType(String uri)
getTopicType
in interface CoreService
public TopicTypeImpl getTopicTypeImplicitly(long topicId)
CoreService
getTopicTypeImplicitly
in interface CoreService
public List<TopicType> getAllTopicTypes()
getAllTopicTypes
in interface CoreService
public TopicTypeImpl createTopicType(TopicTypeModel model)
createTopicType
in interface CoreService
public void updateTopicType(TopicTypeModel updateModel)
updateTopicType
in interface CoreService
public void deleteTopicType(String topicTypeUri)
deleteTopicType
in interface CoreService
public AssociationTypeImpl getAssociationType(String uri)
getAssociationType
in interface CoreService
public AssociationTypeImpl getAssociationTypeImplicitly(long assocId)
CoreService
getAssociationTypeImplicitly
in interface CoreService
public List<AssociationType> getAllAssociationTypes()
getAllAssociationTypes
in interface CoreService
public AssociationTypeImpl createAssociationType(AssociationTypeModel model)
createAssociationType
in interface CoreService
public void updateAssociationType(AssociationTypeModel updateModel)
updateAssociationType
in interface CoreService
public void deleteAssociationType(String assocTypeUri)
deleteAssociationType
in interface CoreService
public Topic createRoleType(TopicModel model)
createRoleType
in interface CoreService
public DMXObject getObject(long id)
getObject
in interface CoreService
public PluginImpl getPlugin(String pluginUri)
getPlugin
in interface CoreService
public List<PluginInfo> getPluginInfo()
getPluginInfo
in interface CoreService
public void fireEvent(DMXEvent event, Object... params)
fireEvent
in interface CoreService
public void dispatchEvent(String pluginUri, DMXEvent event, Object... params)
dispatchEvent
in interface CoreService
public Object getProperty(long id, String propUri)
CoreService
getProperty
in interface CoreService
id
- a topic ID, or an association IDpublic boolean hasProperty(long id, String propUri)
CoreService
hasProperty
in interface CoreService
id
- a topic ID, or an association IDpublic List<Topic> getTopicsByProperty(String propUri, Object propValue)
getTopicsByProperty
in interface CoreService
public List<Topic> getTopicsByPropertyRange(String propUri, Number from, Number to)
getTopicsByPropertyRange
in interface CoreService
public List<Association> getAssociationsByProperty(String propUri, Object propValue)
getAssociationsByProperty
in interface CoreService
public List<Association> getAssociationsByPropertyRange(String propUri, Number from, Number to)
getAssociationsByPropertyRange
in interface CoreService
public void addTopicPropertyIndex(String propUri)
addTopicPropertyIndex
in interface CoreService
public void addAssociationPropertyIndex(String propUri)
addAssociationPropertyIndex
in interface CoreService
public DMXTransaction beginTx()
beginTx
in interface CoreService
public ModelFactory getModelFactory()
getModelFactory
in interface CoreService
public AccessControl getAccessControl()
getAccessControl
in interface CoreService
public WebSocketsServiceImpl getWebSocketsService()
getWebSocketsService
in interface CoreService
public Object getDatabaseVendorObject()
getDatabaseVendorObject
in interface CoreService
public void shutdown()
Association 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 © 2018. All Rights Reserved.