class AssociationImpl extends DMXObjectImpl implements Association
| Modifier and Type | Field and Description |
|---|---|
private Logger |
logger |
mf, model, pl| Constructor and Description |
|---|
AssociationImpl(AssociationModelImpl model,
PersistenceLayer pl) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
private TopicRole |
filterRole(Role role,
TopicRoleModel roleModel) |
Association |
getAssociation(String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
long othersTopicId) |
List<Association> |
getAssociations()
Fetches all associations this object is a player in.
|
AssociationModelImpl |
getModel() |
long |
getOtherPlayerId(long id) |
RelatedObject |
getPlayer(String roleTypeUri) |
DMXObject |
getPlayer1() |
DMXObject |
getPlayer2() |
RelatedAssociation |
getRelatedAssociation(String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
List<RelatedAssociation> |
getRelatedAssociations(String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
List<RelatedTopic> |
getRelatedTopics(List assocTypeUris,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
Role |
getRole(RoleModel roleModel)
### TODO: rethink this method
Returns this association's role which refers to the same object as the given role model.
|
Role |
getRole(String roleTypeUri) |
Role |
getRole1() |
Role |
getRole2() |
Topic |
getTopicByType(String topicTypeUri)
### TODO: make it work for assoc players as well or drop it
|
boolean |
hasSameRoleTypeUris() |
boolean |
isPlayer(TopicRoleModel roleModel)
### TODO: drop it
|
Association |
loadChildTopics() |
Association |
loadChildTopics(String assocDefUri) |
boolean |
matches(String roleTypeUri1,
long playerId1,
String roleTypeUri2,
long playerId2)
Checks if the given players match this association.
|
void |
update(AssociationModel updateModel) |
className, equals, getChildTopics, getDatabaseVendorObject, getId, getProperty, getRelatedTopic, getRelatedTopics, getRelatedTopics, getSimpleValue, getType, getTypeUri, getUri, hashCode, hasProperty, removeProperty, setChildTopics, setProperty, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri, toJSON, toString, updateChildTopicsclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetChildTopics, getDatabaseVendorObject, getId, getProperty, getRelatedTopic, getRelatedTopics, getRelatedTopics, getSimpleValue, getType, getTypeUri, getUri, hasProperty, removeProperty, setChildTopics, setProperty, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri, updateChildTopicstoJSONAssociationImpl(AssociationModelImpl model, PersistenceLayer pl)
public final Role getRole1()
getRole1 in interface Associationpublic final Role getRole2()
getRole2 in interface Associationpublic final DMXObject getPlayer1()
getPlayer1 in interface Associationpublic final DMXObject getPlayer2()
getPlayer2 in interface Associationpublic final Role getRole(String roleTypeUri)
getRole in interface Associationpublic final boolean hasSameRoleTypeUris()
hasSameRoleTypeUris in interface Associationpublic final boolean matches(String roleTypeUri1, long playerId1, String roleTypeUri2, long playerId2)
Associationmatches in interface Associationpublic final long getOtherPlayerId(long id)
getOtherPlayerId in interface Associationpublic final RelatedObject getPlayer(String roleTypeUri)
getPlayer in interface AssociationIf there are 2 such players an exception is thrown.
public final Topic getTopicByType(String topicTypeUri)
AssociationgetTopicByType in interface AssociationIf there are 2 such topics an exception is thrown.
public final Role getRole(RoleModel roleModel)
AssociationIf the object refered by the given role model is not a player in this association an exception is thrown.
getRole in interface Associationpublic final boolean isPlayer(TopicRoleModel roleModel)
AssociationisPlayer in interface Associationpublic final void update(AssociationModel updateModel)
update in interface Associationpublic final void delete()
DMXObjectpublic final Association loadChildTopics()
loadChildTopics in interface AssociationloadChildTopics in interface DMXObjectloadChildTopics in class DMXObjectImplpublic final Association loadChildTopics(String assocDefUri)
loadChildTopics in interface AssociationloadChildTopics in interface DMXObjectloadChildTopics in class DMXObjectImplpublic AssociationModelImpl getModel()
getModel in interface AssociationgetModel in interface DMXObjectgetModel in class DMXObjectImplpublic final List<RelatedTopic> getRelatedTopics(List assocTypeUris, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
getRelatedTopics in interface DMXObjectassocTypeUris - may *not* be nullmyRoleTypeUri - may be nullothersRoleTypeUri - may be nullothersTopicTypeUri - may be nullpublic final RelatedAssociation getRelatedAssociation(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
getRelatedAssociation in interface DMXObjectassocTypeUri - may be nullmyRoleTypeUri - may be nullothersRoleTypeUri - may be nullothersAssocTypeUri - may be nullpublic final List<RelatedAssociation> getRelatedAssociations(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
getRelatedAssociations in interface DMXObjectassocTypeUri - may be nullmyRoleTypeUri - may be nullothersRoleTypeUri - may be nullothersAssocTypeUri - may be nullpublic final Association getAssociation(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, long othersTopicId)
getAssociation in interface DMXObjectpublic final List<Association> getAssociations()
DMXObjectgetAssociations in interface DMXObjectprivate final TopicRole filterRole(Role role, TopicRoleModel roleModel)
Copyright © 2018. All Rights Reserved.