|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.deepamehta.core.impl.EmbeddedService
public class EmbeddedService
Implementation of the DeepaMehta core service. Embeddable into Java applications.
Field Summary | |
---|---|
(package private) BundleContext |
bundleContext
|
private static String |
DEFAULT_ASSOCIATION_TYPE_URI
|
private static String |
DEFAULT_TOPIC_TYPE_URI
|
(package private) EventManager |
eventManager
|
private Logger |
logger
|
(package private) MigrationManager |
migrationManager
|
(package private) PluginManager |
pluginManager
|
(package private) StorageDecorator |
storageDecorator
|
(package private) TypeCache |
typeCache
|
(package private) TypeStorageImpl |
typeStorage
|
(package private) ValueStorage |
valueStorage
|
Constructor Summary | |
---|---|
EmbeddedService(StorageDecorator storageDecorator,
BundleContext bundleContext)
|
Method Summary | |
---|---|
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. |
private Association |
associationFactory(AssociationModel model,
ClientState clientState,
Directives directives)
Factory method: creates a new association in the DB according to the given association model and returns an association instance. |
private AssociationType |
associationTypeFactory(AssociationTypeModel model)
Factory method: creates a new association type in the DB according to the given association type model and returns a topic type instance. |
DeepaMehtaTransaction |
beginTx()
|
private void |
bootstrapTypeCache()
|
Association |
createAssociation(AssociationModel model,
ClientState clientState)
|
(package private) Association |
createAssociation(String typeUri,
RoleModel roleModel1,
RoleModel roleModel2)
Convenience method. |
(package private) Association |
createAssociation(String typeUri,
RoleModel roleModel1,
RoleModel roleModel2,
ClientState clientState)
Convenience method. |
(package private) void |
createAssociationInstantiation(long assocId,
String assocTypeUri)
|
AssociationType |
createAssociationType(AssociationTypeModel model,
ClientState clientState)
|
Topic |
createTopic(TopicModel model,
ClientState clientState)
|
(package private) void |
createTopicInstantiation(long topicId,
String topicTypeUri)
|
TopicType |
createTopicType(TopicTypeModel model,
ClientState clientState)
|
private void |
createTypeTopic(TopicModel model,
String defaultUriPrefix)
|
Directives |
deleteAssociation(long assocId)
|
Directives |
deleteAssociationType(String assocTypeUri)
|
Directives |
deleteTopic(long topicId)
|
Directives |
deleteTopicType(String topicTypeUri)
|
void |
deliverEvent(String pluginUri,
DeepaMehtaEvent event,
Object... params)
|
private void |
fetchCompositeValue(DeepaMehtaObjectModel model,
boolean fetchComposite)
|
private void |
fetchCompositeValue(RelatedTopicModel model,
boolean fetchComposite,
boolean fetchRelatingComposite)
|
void |
fireEvent(DeepaMehtaEvent event,
Object... params)
|
Iterable<Association> |
getAllAssociations()
|
List<AssociationType> |
getAllAssociationTypes()
|
Iterable<Topic> |
getAllTopics()
|
List<TopicType> |
getAllTopicTypes()
|
Association |
getAssociation(long assocId,
boolean fetchComposite)
|
Association |
getAssociation(String assocTypeUri,
long topic1Id,
long topic2Id,
String roleTypeUri1,
String roleTypeUri2,
boolean fetchComposite)
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,
boolean fetchComposite)
|
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<RelatedAssociation> |
getAssociations(String assocTypeUri)
|
List<Association> |
getAssociationsByProperty(String propUri,
Object propValue)
|
List<Association> |
getAssociationsByPropertyRange(String propUri,
Number from,
Number to)
|
AssociationType |
getAssociationType(String uri)
|
List<String> |
getAssociationTypeUris()
|
Plugin |
getPlugin(String pluginUri)
|
List<PluginInfo> |
getPluginInfo()
|
Topic |
getTopic(long topicId,
boolean fetchComposite)
|
Topic |
getTopic(String key,
SimpleValue value,
boolean fetchComposite)
Looks up a single topic by exact value. |
ResultList<RelatedTopic> |
getTopics(String topicTypeUri,
boolean fetchComposite,
int maxResultSize)
|
List<Topic> |
getTopics(String key,
SimpleValue value,
boolean fetchComposite)
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 uri)
|
List<String> |
getTopicTypeUris()
|
TypeStorage |
getTypeStorage()
|
(package private) Association |
instantiateAssociation(AssociationModel model,
boolean fetchComposite)
Attaches this core service to an association fetched from storage layer. |
(package private) List<Association> |
instantiateAssociations(List<AssociationModel> models,
boolean fetchComposite)
|
(package private) RelatedAssociation |
instantiateRelatedAssociation(RelatedAssociationModel model,
boolean fetchComposite,
boolean fetchRelatingComposite)
|
(package private) List<RelatedAssociation> |
instantiateRelatedAssociations(Iterable<RelatedAssociationModel> models,
boolean fetchComposite,
boolean fetchRelatingComposite)
|
(package private) RelatedTopic |
instantiateRelatedTopic(RelatedTopicModel model,
boolean fetchComposite,
boolean fetchRelatingComposite)
|
(package private) ResultList<RelatedTopic> |
instantiateRelatedTopics(ResultList<RelatedTopicModel> models,
boolean fetchComposite,
boolean fetchRelatingComposite)
|
(package private) Topic |
instantiateTopic(TopicModel model,
boolean fetchComposite)
Attaches this core service to a topic model fetched from storage layer. |
private List<Topic> |
instantiateTopics(List<TopicModel> models,
boolean fetchComposite)
|
List<Topic> |
searchTopics(String searchTerm,
String fieldUri)
Performs a fulltext search. |
private void |
setupBootstrapContent()
|
private void |
setupDB()
Setups the database: 1) initializes the database. |
private Topic |
topicFactory(TopicModel model,
ClientState clientState,
Directives directives)
Factory method: creates a new topic in the DB according to the given topic model and returns a topic instance. |
private TopicType |
topicTypeFactory(TopicTypeModel model)
Factory method: creates a new topic type in the DB according to the given topic type model and returns a topic type instance. |
Directives |
updateAssociation(AssociationModel model,
ClientState clientState)
|
Directives |
updateAssociationType(AssociationTypeModel model,
ClientState clientState)
|
Directives |
updateTopic(TopicModel model,
ClientState clientState)
|
Directives |
updateTopicType(TopicTypeModel model,
ClientState clientState)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String DEFAULT_TOPIC_TYPE_URI
private static final String DEFAULT_ASSOCIATION_TYPE_URI
StorageDecorator storageDecorator
BundleContext bundleContext
MigrationManager migrationManager
PluginManager pluginManager
EventManager eventManager
TypeCache typeCache
TypeStorageImpl typeStorage
ValueStorage valueStorage
private Logger logger
Constructor Detail |
---|
public EmbeddedService(StorageDecorator storageDecorator, BundleContext bundleContext)
bundleContext
- The context of the DeepaMehta 4 Core bundle.Method Detail |
---|
public Topic getTopic(long topicId, boolean fetchComposite)
getTopic
in interface DeepaMehtaService
public Topic getTopic(String key, SimpleValue value, boolean fetchComposite)
DeepaMehtaService
null
is returned.
If more than one topic is found a runtime exception is thrown.
IMPORTANT: Looking up a topic this way requires the corresponding type to be indexed with indexing mode
dm4.core.key
.
getTopic
in interface DeepaMehtaService
public List<Topic> getTopics(String key, SimpleValue value, boolean fetchComposite)
DeepaMehtaService
IMPORTANT: Looking up topics this way requires the corresponding type to be indexed with indexing mode
dm4.core.key
.
getTopics
in interface DeepaMehtaService
public ResultList<RelatedTopic> getTopics(String topicTypeUri, boolean fetchComposite, int maxResultSize)
getTopics
in interface DeepaMehtaService
public List<Topic> searchTopics(String searchTerm, String fieldUri)
DeepaMehtaService
IMPORTANT: Searching topics this way requires the corresponding type to be indexed with indexing mode
dm4.core.fulltext
or dm4.core.fulltext_key
.
searchTopics
in interface DeepaMehtaService
fieldUri
- The URI of the data field to search. If null is provided all fields are searched. ### FIXDOCpublic Iterable<Topic> getAllTopics()
getAllTopics
in interface DeepaMehtaService
public Topic createTopic(TopicModel model, ClientState clientState)
createTopic
in interface DeepaMehtaService
public Directives updateTopic(TopicModel model, ClientState clientState)
updateTopic
in interface DeepaMehtaService
public Directives deleteTopic(long topicId)
deleteTopic
in interface DeepaMehtaService
public Association getAssociation(long assocId, boolean fetchComposite)
getAssociation
in interface DeepaMehtaService
public Association getAssociation(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2, boolean fetchComposite)
DeepaMehtaService
null
is returned.
If more than one association exist, a runtime exception is thrown.
getAssociation
in interface DeepaMehtaService
assocTypeUri
- Association type filter. Pass null
to switch filter off.public Association getAssociationBetweenTopicAndAssociation(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri, boolean fetchComposite)
getAssociationBetweenTopicAndAssociation
in interface DeepaMehtaService
public List<RelatedAssociation> getAssociations(String assocTypeUri)
getAssociations
in interface DeepaMehtaService
public List<Association> getAssociations(long topic1Id, long topic2Id)
DeepaMehtaService
getAssociations
in interface DeepaMehtaService
public List<Association> getAssociations(long topic1Id, long topic2Id, String assocTypeUri)
DeepaMehtaService
getAssociations
in interface DeepaMehtaService
assocTypeUri
- Association type filter. Pass null
to switch filter off.public Iterable<Association> getAllAssociations()
getAllAssociations
in interface DeepaMehtaService
public Association createAssociation(AssociationModel model, ClientState clientState)
createAssociation
in interface DeepaMehtaService
public Directives updateAssociation(AssociationModel model, ClientState clientState)
updateAssociation
in interface DeepaMehtaService
public Directives deleteAssociation(long assocId)
deleteAssociation
in interface DeepaMehtaService
public List<String> getTopicTypeUris()
getTopicTypeUris
in interface DeepaMehtaService
public TopicType getTopicType(String uri)
getTopicType
in interface DeepaMehtaService
public List<TopicType> getAllTopicTypes()
getAllTopicTypes
in interface DeepaMehtaService
public TopicType createTopicType(TopicTypeModel model, ClientState clientState)
createTopicType
in interface DeepaMehtaService
public Directives updateTopicType(TopicTypeModel model, ClientState clientState)
updateTopicType
in interface DeepaMehtaService
public Directives deleteTopicType(String topicTypeUri)
deleteTopicType
in interface DeepaMehtaService
public List<String> getAssociationTypeUris()
getAssociationTypeUris
in interface DeepaMehtaService
public AssociationType getAssociationType(String uri)
getAssociationType
in interface DeepaMehtaService
public List<AssociationType> getAllAssociationTypes()
getAllAssociationTypes
in interface DeepaMehtaService
public AssociationType createAssociationType(AssociationTypeModel model, ClientState clientState)
createAssociationType
in interface DeepaMehtaService
public Directives updateAssociationType(AssociationTypeModel model, ClientState clientState)
updateAssociationType
in interface DeepaMehtaService
public Directives deleteAssociationType(String assocTypeUri)
deleteAssociationType
in interface DeepaMehtaService
public Plugin getPlugin(String pluginUri)
getPlugin
in interface DeepaMehtaService
public List<PluginInfo> getPluginInfo()
getPluginInfo
in interface DeepaMehtaService
public void fireEvent(DeepaMehtaEvent event, Object... params)
fireEvent
in interface DeepaMehtaService
public void deliverEvent(String pluginUri, DeepaMehtaEvent event, Object... params)
deliverEvent
in interface DeepaMehtaService
public List<Topic> getTopicsByProperty(String propUri, Object propValue)
getTopicsByProperty
in interface DeepaMehtaService
public List<Topic> getTopicsByPropertyRange(String propUri, Number from, Number to)
getTopicsByPropertyRange
in interface DeepaMehtaService
public List<Association> getAssociationsByProperty(String propUri, Object propValue)
getAssociationsByProperty
in interface DeepaMehtaService
public List<Association> getAssociationsByPropertyRange(String propUri, Number from, Number to)
getAssociationsByPropertyRange
in interface DeepaMehtaService
public DeepaMehtaTransaction beginTx()
beginTx
in interface DeepaMehtaService
public TypeStorage getTypeStorage()
getTypeStorage
in interface DeepaMehtaService
void createTopicInstantiation(long topicId, String topicTypeUri)
void createAssociationInstantiation(long assocId, String assocTypeUri)
Association createAssociation(String typeUri, RoleModel roleModel1, RoleModel roleModel2)
Association createAssociation(String typeUri, RoleModel roleModel1, RoleModel roleModel2, ClientState clientState)
Topic instantiateTopic(TopicModel model, boolean fetchComposite)
private List<Topic> instantiateTopics(List<TopicModel> models, boolean fetchComposite)
RelatedTopic instantiateRelatedTopic(RelatedTopicModel model, boolean fetchComposite, boolean fetchRelatingComposite)
ResultList<RelatedTopic> instantiateRelatedTopics(ResultList<RelatedTopicModel> models, boolean fetchComposite, boolean fetchRelatingComposite)
Association instantiateAssociation(AssociationModel model, boolean fetchComposite)
List<Association> instantiateAssociations(List<AssociationModel> models, boolean fetchComposite)
RelatedAssociation instantiateRelatedAssociation(RelatedAssociationModel model, boolean fetchComposite, boolean fetchRelatingComposite)
List<RelatedAssociation> instantiateRelatedAssociations(Iterable<RelatedAssociationModel> models, boolean fetchComposite, boolean fetchRelatingComposite)
private void fetchCompositeValue(DeepaMehtaObjectModel model, boolean fetchComposite)
private void fetchCompositeValue(RelatedTopicModel model, boolean fetchComposite, boolean fetchRelatingComposite)
private Topic topicFactory(TopicModel model, ClientState clientState, Directives directives)
private Association associationFactory(AssociationModel model, ClientState clientState, Directives directives)
private TopicType topicTypeFactory(TopicTypeModel model)
private AssociationType associationTypeFactory(AssociationTypeModel model)
private void createTypeTopic(TopicModel model, String defaultUriPrefix)
private void setupDB()
Called from CoreActivator#start
.
private void setupBootstrapContent()
private void _createTopic(TopicModel model)
private void _associateDataType(String typeUri, String dataTypeUri)
private void bootstrapTypeCache()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |