Package systems.dmx.core
Interface DMXObject
-
- All Superinterfaces:
Identifiable
,JSONEnabled
- All Known Subinterfaces:
Assoc
,AssocType
,CompDef
,DMXType
,RelatedAssoc
,RelatedObject
,RelatedTopic
,RoleType
,Topic
,TopicType
public interface DMXObject extends Identifiable, JSONEnabled
The (abstract) base class of both,Topic
andAssoc
.A
DMXObject
has 5 parts: an ID, an URI, a type URI, aSimpleValue
, and, in case of a composite DMXObject, a (recursive) collection ofChildTopics
objects.DMXObject
provides methods for updating, deleting, and traversal alongside associations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
checkWriteAccess()
Checks if current user has write access to this object.void
delete()
Deletes the DMX object in its entirety, that is - the object itself (the parent) - all child topics associated via "dmx.core.composition", recusively - all the remaining direct associations, e.g.Assoc
getAssoc(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, long othersTopicId)
List<Assoc>
getAssocs()
Fetches all associations this object is a player in.ChildTopics
getChildTopics()
Object
getDatabaseVendorObject()
long
getId()
DMXObjectModel
getModel()
Object
getProperty(String propUri)
Returns this object's property value associated with the given property URI.RelatedAssoc
getRelatedAssoc(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
List<RelatedAssoc>
getRelatedAssocs()
List<RelatedAssoc>
getRelatedAssocs(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
RelatedTopic
getRelatedTopic(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
Fetches and returns a related topic ornull
if no such topic extists.List<RelatedTopic>
getRelatedTopics()
List<RelatedTopic>
getRelatedTopics(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
SimpleValue
getSimpleValue()
DMXType
getType()
Returns the type of this object.String
getTypeUri()
String
getUri()
boolean
hasProperty(String propUri)
Checks whether for this object a property value is associated with a given property URI.<O extends DMXObject>
OloadChildTopics()
<O extends DMXObject>
OloadChildTopics(String compDefUri)
void
removeProperty(String propUri)
Removes this object's property associated with the given property URI.void
setProperty(String propUri, Object propValue, boolean addToIndex)
void
setSimpleValue(boolean value)
void
setSimpleValue(int value)
void
setSimpleValue(long value)
void
setSimpleValue(String value)
void
setSimpleValue(SimpleValue value)
void
setTypeUri(String typeUri)
void
setUri(String uri)
<M extends DMXObjectModel>
voidupdate(M updateModel)
void
update(ChildTopicsModel updateModel)
Convenience that constructs a DMXObjectModel from a ChildTopicsModel and calls canonic update() with it.void
updateChildTopics(ChildTopicsModel updateModel, CompDef compDef)
Note: this method is meant only for facet updates.-
Methods inherited from interface systems.dmx.core.JSONEnabled
dump, toJSON
-
-
-
-
Method Detail
-
getId
long getId()
- Specified by:
getId
in interfaceIdentifiable
-
getUri
String getUri()
-
setUri
void setUri(String uri)
-
getTypeUri
String getTypeUri()
-
setTypeUri
void setTypeUri(String typeUri)
-
getSimpleValue
SimpleValue getSimpleValue()
-
setSimpleValue
void setSimpleValue(String value)
-
setSimpleValue
void setSimpleValue(int value)
-
setSimpleValue
void setSimpleValue(long value)
-
setSimpleValue
void setSimpleValue(boolean value)
-
setSimpleValue
void setSimpleValue(SimpleValue value)
-
getChildTopics
ChildTopics getChildTopics()
-
loadChildTopics
<O extends DMXObject> O loadChildTopics()
-
getType
DMXType getType()
Returns the type of this object.No access control is performed as Implicit READ permission applies: if a user has READ access to an object she has READ access to its type as well.
Note: if the user would have no READ access to this object the DMX Core would not instantiate it in the first place, but throw an
AccessControlException
.
-
getModel
DMXObjectModel getModel()
-
update
<M extends DMXObjectModel> void update(M updateModel)
-
update
void update(ChildTopicsModel updateModel)
Convenience that constructs a DMXObjectModel from a ChildTopicsModel and calls canonic update() with it.
-
updateChildTopics
void updateChildTopics(ChildTopicsModel updateModel, CompDef compDef)
Note: this method is meant only for facet updates.
-
delete
void delete()
Deletes the DMX object in its entirety, that is - the object itself (the parent) - all child topics associated via "dmx.core.composition", recusively - all the remaining direct associations, e.g. "dmx.core.instantiation"
-
getRelatedTopic
RelatedTopic getRelatedTopic(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
Fetches and returns a related topic ornull
if no such topic extists.- Parameters:
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be null
-
getRelatedTopics
List<RelatedTopic> getRelatedTopics()
-
getRelatedTopics
List<RelatedTopic> getRelatedTopics(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
- Parameters:
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be null
-
getRelatedAssoc
RelatedAssoc getRelatedAssoc(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
- Parameters:
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersAssocTypeUri
- may be null
-
getRelatedAssocs
List<RelatedAssoc> getRelatedAssocs()
-
getRelatedAssocs
List<RelatedAssoc> getRelatedAssocs(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
- Parameters:
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersAssocTypeUri
- may be null
-
getAssoc
Assoc getAssoc(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, long othersTopicId)
-
getProperty
Object getProperty(String propUri)
Returns this object's property value associated with the given property URI. If there's no property value associated with the property URI an exception is thrown.
-
hasProperty
boolean hasProperty(String propUri)
Checks whether for this object a property value is associated with a given property URI.
-
removeProperty
void removeProperty(String propUri)
Removes this object's property associated with the given property URI. If there's no property value associated with the property URI nothing is performed.
-
checkWriteAccess
void checkWriteAccess()
Checks if current user has write access to this object.- Throws:
AccessControlException
-
getDatabaseVendorObject
Object getDatabaseVendorObject()
-
-