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, updateChildTopics
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getChildTopics, getDatabaseVendorObject, getId, getProperty, getRelatedTopic, getRelatedTopics, getRelatedTopics, getSimpleValue, getType, getTypeUri, getUri, hasProperty, removeProperty, setChildTopics, setProperty, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri, updateChildTopics
toJSON
AssociationImpl(AssociationModelImpl model, PersistenceLayer pl)
public final Role getRole1()
getRole1
in interface Association
public final Role getRole2()
getRole2
in interface Association
public final DMXObject getPlayer1()
getPlayer1
in interface Association
public final DMXObject getPlayer2()
getPlayer2
in interface Association
public final Role getRole(String roleTypeUri)
getRole
in interface Association
public final boolean hasSameRoleTypeUris()
hasSameRoleTypeUris
in interface Association
public final boolean matches(String roleTypeUri1, long playerId1, String roleTypeUri2, long playerId2)
Association
matches
in interface Association
public final long getOtherPlayerId(long id)
getOtherPlayerId
in interface Association
public final RelatedObject getPlayer(String roleTypeUri)
getPlayer
in interface Association
If there are 2 such players an exception is thrown.
public final Topic getTopicByType(String topicTypeUri)
Association
getTopicByType
in interface Association
If there are 2 such topics an exception is thrown.
public final Role getRole(RoleModel roleModel)
Association
If the object refered by the given role model is not a player in this association an exception is thrown.
getRole
in interface Association
public final boolean isPlayer(TopicRoleModel roleModel)
Association
isPlayer
in interface Association
public final void update(AssociationModel updateModel)
update
in interface Association
public final void delete()
DMXObject
public final Association loadChildTopics()
loadChildTopics
in interface Association
loadChildTopics
in interface DMXObject
loadChildTopics
in class DMXObjectImpl
public final Association loadChildTopics(String assocDefUri)
loadChildTopics
in interface Association
loadChildTopics
in interface DMXObject
loadChildTopics
in class DMXObjectImpl
public AssociationModelImpl getModel()
getModel
in interface Association
getModel
in interface DMXObject
getModel
in class DMXObjectImpl
public final List<RelatedTopic> getRelatedTopics(List assocTypeUris, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
getRelatedTopics
in interface DMXObject
assocTypeUris
- 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 DMXObject
assocTypeUri
- 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 DMXObject
assocTypeUri
- 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 DMXObject
public final List<Association> getAssociations()
DMXObject
getAssociations
in interface DMXObject
private final TopicRole filterRole(Role role, TopicRoleModel roleModel)
Copyright © 2018. All Rights Reserved.