public class RelationshipManager extends Object implements IRelationshipManager
Constructor and Description |
---|
RelationshipManager() |
Modifier and Type | Method and Description |
---|---|
String |
addNode(String type,
String objectId)
Adds a new relatable node.
|
String |
addRelationship(IRelatable source,
IRelatable target,
IRelationshipType relationshipType)
Adds a new relationship between the source and target nodes.
|
String |
addRelationshipType(String id,
String name,
String reverseName,
Set<String> sourceTypes,
Set<String> targetTypes,
boolean bidirectional)
Adds a new type of relationship.
|
void |
deleteNode(String id)
Removes a node.
|
void |
deleteRelationship(String id)
Removes a relationship.
|
void |
deleteRelationshipType(String id)
Removes a type of relationship.
|
IRelatable |
getNode(String id)
Gets the relatable node.
|
IRelatable |
getNode(String type,
String objectId,
boolean createNode)
Gets the relatable node or creates a new node with the values in type and objectId params if the param createNode is equal to true.
|
IRelationship |
getRelationship(String id)
Gets the relationship.
|
IRelationshipType |
getRelationshipType(String id)
Gets the type of relationship.
|
Set<IRelatable> |
listRelationships(IRelatable source,
IRelatable target,
IRelationshipType relationshipType)
Lists all relatable nodes that contains a relationship with firstObject and secondObject.
|
Set<IRelationship> |
listRelationships(IRelatable source,
IRelationshipType relationshipType)
Lists all relationships where the param source is the source and where the param source is the target if the relationship is bidirectional.
|
void |
updateRelationshipType(IRelationshipType relationshipType)
Updates a type of relationship.
|
public String addNode(String type, String objectId) throws PortalObjectAlreadyExistsException
IRelationshipManager
addNode
in interface IRelationshipManager
type
- of node.objectId
- identify some kind of object.PortalObjectAlreadyExistsException
- if exist some node with the same type and objectId.public String addRelationship(IRelatable source, IRelatable target, IRelationshipType relationshipType)
IRelationshipManager
addRelationship
in interface IRelationshipManager
source
- relatable source.target
- relatable target.relationshipType
- a kind of relationship.public String addRelationshipType(String id, String name, String reverseName, Set<String> sourceTypes, Set<String> targetTypes, boolean bidirectional)
IRelationshipManager
addRelationshipType
in interface IRelationshipManager
id
- identifies the type of relationship.name
- display name to source.reverseName
- display name to target.sourceTypes
- set that contains names to type of source.targetTypes
- set that contains names to type of target.bidirectional
- true or false if the relationship is bidirectional.public void deleteNode(String id) throws PortalObjectNotFoundException
IRelationshipManager
deleteNode
in interface IRelationshipManager
id
- identifies the node.PortalObjectNotFoundException
- if the node was not found.public void deleteRelationship(String id) throws PortalObjectNotFoundException
IRelationshipManager
deleteRelationship
in interface IRelationshipManager
id
- identifies the relationship.PortalObjectNotFoundException
- if the relationship was not found.public void deleteRelationshipType(String id) throws PortalObjectNotFoundException
IRelationshipManager
deleteRelationshipType
in interface IRelationshipManager
id
- identifies the type of relationship.PortalObjectNotFoundException
- if the type of relationship was not found.public IRelatable getNode(String id)
IRelationshipManager
getNode
in interface IRelationshipManager
id
- identifies the node.public IRelatable getNode(String type, String objectId, boolean createNode)
IRelationshipManager
getNode
in interface IRelationshipManager
type
- of node.objectId
- identify some kind of object.createNode
- true or false.public IRelationship getRelationship(String id)
IRelationshipManager
getRelationship
in interface IRelationshipManager
id
- identifies the relationship.public IRelationshipType getRelationshipType(String id) throws PortalObjectNotFoundException
IRelationshipManager
getRelationshipType
in interface IRelationshipManager
id
- identifies the type of relationship.PortalObjectNotFoundException
- if the type of relationship was not found.public Set<IRelationship> listRelationships(IRelatable source, IRelationshipType relationshipType)
IRelationshipManager
listRelationships
in interface IRelationshipManager
source
- IRelatable source.relationshipType
- IRelationship.public Set<IRelatable> listRelationships(IRelatable source, IRelatable target, IRelationshipType relationshipType)
IRelationshipManager
listRelationships
in interface IRelationshipManager
source
- IRelatable source.target
- IRelatable source.relationshipType
- a kind of relationship.public void updateRelationshipType(IRelationshipType relationshipType) throws PortalObjectNotFoundException
IRelationshipManager
updateRelationshipType
in interface IRelationshipManager
relationshipType
- new relationship object with the values updated.PortalObjectNotFoundException
- if the type of relationship was not found.LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.