de.deepamehta.core.impl
Class AttachedDeepaMehtaObject

Show UML class diagram
java.lang.Object
  extended by de.deepamehta.core.impl.AttachedDeepaMehtaObject
All Implemented Interfaces:
DeepaMehtaObject, Identifiable, JSONEnabled
Direct Known Subclasses:
AttachedAssociation, AttachedTopic

abstract class AttachedDeepaMehtaObject
extends Object
implements DeepaMehtaObject

A DeepaMehta object model that is attached to the DB. Method name conventions and semantics: - getXX() Reads from memory (model). - setXX(arg) Writes to memory (model) and DB. Elementary operation. - updateXX(arg) Compares arg with current value (model) and calls setXX() method(s) if required. Can be called with arg=null which indicates no update is requested. Typically returns nothing. - fetchXX() Fetches value from DB. ### FIXDOC - storeXX() Stores current value (model) to DB. ### FIXDOC


Field Summary
private  AttachedCompositeValue childTopics
           
protected  EmbeddedService dms
           
private  Logger logger
           
private  DeepaMehtaObjectModel model
           
 
Constructor Summary
AttachedDeepaMehtaObject(DeepaMehtaObjectModel model, EmbeddedService dms)
           
 
Method Summary
(package private) abstract  void addUpdateDirective(Directives directives)
           
(package private) abstract  String className()
           
 void delete(Directives directives)
          Deletes all sub-topics of this DeepaMehta object (associated via "dm4.core.composition", recursively) and deletes all the remaining direct associations of this DeepaMehta object.
 boolean equals(Object o)
           
(package private) abstract  RelatedTopicModel fetchRelatedTopic(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
           
(package private) abstract  ResultList<RelatedTopicModel> fetchRelatedTopics(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri, int maxResultSize)
           
 AttachedCompositeValue getCompositeValue()
           
 long getId()
           
 DeepaMehtaObjectModel getModel()
           
 RelatedTopic getRelatedTopic(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri, boolean fetchComposite, boolean fetchRelatingComposite)
          Fetches and returns a related topic or null if no such topic extists.
 ResultList<RelatedTopic> getRelatedTopics(String assocTypeUri, int maxResultSize)
           
 ResultList<RelatedTopic> getRelatedTopics(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri, boolean fetchComposite, boolean fetchRelatingComposite, int maxResultSize)
           
 SimpleValue getSimpleValue()
           
(package private)  Type getType()
           
 String getTypeUri()
           
 String getUri()
           
 int hashCode()
           
 void loadChildTopics()
           
 void loadChildTopics(String childTypeUri)
           
 void setCompositeValue(CompositeValueModel comp, ClientState clientState, Directives directives)
           
 void setSimpleValue(boolean value)
           
 void setSimpleValue(int value)
           
 void setSimpleValue(long value)
           
 void setSimpleValue(SimpleValue value)
           
 void setSimpleValue(String value)
           
 void setTypeUri(String typeUri)
           
 void setUri(String uri)
           
(package private) abstract  void storeTypeUri()
           
(package private) abstract  void storeUri()
           
 JSONObject toJSON()
           
 String toString()
           
 void update(DeepaMehtaObjectModel newModel, ClientState clientState, Directives directives)
           
 void updateChildTopic(TopicModel newChildTopic, AssociationDefinition assocDef, ClientState clientState, Directives directives)
           
 void updateChildTopics(List<TopicModel> newChildTopics, AssociationDefinition assocDef, ClientState clientState, Directives directives)
           
private  void updateSimpleValue(SimpleValue newValue)
           
private  void updateTypeUri(String newTypeUri)
           
private  void updateUri(String newUri)
           
private  void updateValue(DeepaMehtaObjectModel newModel, ClientState clientState, Directives directives)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.deepamehta.core.DeepaMehtaObject
getAssociation, getAssociations, getProperty, getRelatedTopics, hasProperty, removeProperty, setProperty
 

Field Detail

model

private DeepaMehtaObjectModel model

childTopics

private AttachedCompositeValue childTopics

dms

protected final EmbeddedService dms

logger

private Logger logger
Constructor Detail

AttachedDeepaMehtaObject

AttachedDeepaMehtaObject(DeepaMehtaObjectModel model,
                         EmbeddedService dms)
Method Detail

getId

public long getId()
Specified by:
getId in interface DeepaMehtaObject
Specified by:
getId in interface Identifiable

getUri

public String getUri()
Specified by:
getUri in interface DeepaMehtaObject

setUri

public void setUri(String uri)
Specified by:
setUri in interface DeepaMehtaObject

getTypeUri

public String getTypeUri()
Specified by:
getTypeUri in interface DeepaMehtaObject

setTypeUri

public void setTypeUri(String typeUri)
Specified by:
setTypeUri in interface DeepaMehtaObject

getSimpleValue

public SimpleValue getSimpleValue()
Specified by:
getSimpleValue in interface DeepaMehtaObject

setSimpleValue

public void setSimpleValue(String value)
Specified by:
setSimpleValue in interface DeepaMehtaObject

setSimpleValue

public void setSimpleValue(int value)
Specified by:
setSimpleValue in interface DeepaMehtaObject

setSimpleValue

public void setSimpleValue(long value)
Specified by:
setSimpleValue in interface DeepaMehtaObject

setSimpleValue

public void setSimpleValue(boolean value)
Specified by:
setSimpleValue in interface DeepaMehtaObject

setSimpleValue

public void setSimpleValue(SimpleValue value)
Specified by:
setSimpleValue in interface DeepaMehtaObject

getCompositeValue

public AttachedCompositeValue getCompositeValue()
Specified by:
getCompositeValue in interface DeepaMehtaObject

setCompositeValue

public void setCompositeValue(CompositeValueModel comp,
                              ClientState clientState,
                              Directives directives)
Specified by:
setCompositeValue in interface DeepaMehtaObject

loadChildTopics

public void loadChildTopics()
Specified by:
loadChildTopics in interface DeepaMehtaObject

loadChildTopics

public void loadChildTopics(String childTypeUri)
Specified by:
loadChildTopics in interface DeepaMehtaObject

getModel

public DeepaMehtaObjectModel getModel()
Specified by:
getModel in interface DeepaMehtaObject

update

public void update(DeepaMehtaObjectModel newModel,
                   ClientState clientState,
                   Directives directives)
Specified by:
update in interface DeepaMehtaObject

updateChildTopic

public void updateChildTopic(TopicModel newChildTopic,
                             AssociationDefinition assocDef,
                             ClientState clientState,
                             Directives directives)
Specified by:
updateChildTopic in interface DeepaMehtaObject

updateChildTopics

public void updateChildTopics(List<TopicModel> newChildTopics,
                              AssociationDefinition assocDef,
                              ClientState clientState,
                              Directives directives)
Specified by:
updateChildTopics in interface DeepaMehtaObject

delete

public void delete(Directives directives)
Deletes all sub-topics of this DeepaMehta object (associated via "dm4.core.composition", recursively) and deletes all the remaining direct associations of this DeepaMehta object.

Note: deletion of the object itself is up to the subclasses.

Specified by:
delete in interface DeepaMehtaObject

getRelatedTopic

public RelatedTopic getRelatedTopic(String assocTypeUri,
                                    String myRoleTypeUri,
                                    String othersRoleTypeUri,
                                    String othersTopicTypeUri,
                                    boolean fetchComposite,
                                    boolean fetchRelatingComposite)
Description copied from interface: DeepaMehtaObject
Fetches and returns a related topic or null if no such topic extists.

Specified by:
getRelatedTopic in interface DeepaMehtaObject
Parameters:
assocTypeUri - may be null
myRoleTypeUri - may be null
othersRoleTypeUri - may be null
othersTopicTypeUri - may be null

getRelatedTopics

public ResultList<RelatedTopic> getRelatedTopics(String assocTypeUri,
                                                 int maxResultSize)
Specified by:
getRelatedTopics in interface DeepaMehtaObject

getRelatedTopics

public ResultList<RelatedTopic> getRelatedTopics(String assocTypeUri,
                                                 String myRoleTypeUri,
                                                 String othersRoleTypeUri,
                                                 String othersTopicTypeUri,
                                                 boolean fetchComposite,
                                                 boolean fetchRelatingComposite,
                                                 int maxResultSize)
Specified by:
getRelatedTopics in interface DeepaMehtaObject
Parameters:
assocTypeUri - may be null
myRoleTypeUri - may be null
othersRoleTypeUri - may be null
othersTopicTypeUri - may be null
maxResultSize - Result size limit. Pass 0 for no limit.

toJSON

public JSONObject toJSON()
Specified by:
toJSON in interface JSONEnabled

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

className

abstract String className()

addUpdateDirective

abstract void addUpdateDirective(Directives directives)

storeUri

abstract void storeUri()

storeTypeUri

abstract void storeTypeUri()

fetchRelatedTopic

abstract RelatedTopicModel fetchRelatedTopic(String assocTypeUri,
                                             String myRoleTypeUri,
                                             String othersRoleTypeUri,
                                             String othersTopicTypeUri)

fetchRelatedTopics

abstract ResultList<RelatedTopicModel> fetchRelatedTopics(String assocTypeUri,
                                                          String myRoleTypeUri,
                                                          String othersRoleTypeUri,
                                                          String othersTopicTypeUri,
                                                          int maxResultSize)

getType

Type getType()

updateUri

private void updateUri(String newUri)

updateTypeUri

private void updateTypeUri(String newTypeUri)

updateValue

private void updateValue(DeepaMehtaObjectModel newModel,
                         ClientState clientState,
                         Directives directives)

updateSimpleValue

private void updateSimpleValue(SimpleValue newValue)


Copyright © 2014. All Rights Reserved.