Interface IRelationshipManager

  • All Known Implementing Classes:
    RelationshipManager

    public interface IRelationshipManager
    Provides operations on the relationship framework.
    Since:
    7.0.0
    Version:
    $Revision: 15056 $ $Date: 2012-11-29 18:51:41 -0200 (Thu, 29 Nov 2012) $
    • Method Detail

      • addNode

        java.lang.String addNode​(java.lang.String type,
                                 java.lang.String objectId)
                          throws PortalObjectAlreadyExistsException
        Adds a new relatable node.
        Parameters:
        type - of node.
        objectId - identify some kind of object.
        Returns:
        the identify of node created.
        Throws:
        PortalObjectAlreadyExistsException - if exist some node with the same type and objectId.
        Since:
        7.0.0
      • addRelationship

        java.lang.String addRelationship​(IRelatable source,
                                         IRelatable target,
                                         IRelationshipType relationshipType)
                                  throws PortalException
        Adds a new relationship between the source and target nodes.
        Parameters:
        source - relatable source.
        target - relatable target.
        relationshipType - a kind of relationship.
        Returns:
        the identify of relationship created.
        Throws:
        PortalException
        Since:
        7.0.0
      • addRelationshipType

        java.lang.String addRelationshipType​(java.lang.String id,
                                             java.lang.String name,
                                             java.lang.String reverseName,
                                             java.util.Set<java.lang.String> sourceTypes,
                                             java.util.Set<java.lang.String> targetTypes,
                                             boolean bidirectional)
                                      throws PortalException
        Adds a new type of relationship.
        Parameters:
        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.
        Returns:
        the identify of relationshipType created.
        Throws:
        PortalException
        Since:
        7.0.0
      • deleteRelationshipType

        void deleteRelationshipType​(java.lang.String id)
                             throws PortalObjectNotFoundException
        Removes a type of relationship.
        Parameters:
        id - identifies the type of relationship.
        Throws:
        PortalObjectNotFoundException - if the type of relationship was not found.
        Since:
        7.0.0
      • getNode

        IRelatable getNode​(java.lang.String id)
                    throws PortalException
        Gets the relatable node.
        Parameters:
        id - identifies the node.
        Returns:
        a IRelatable that contains the identity equals the value passed in id param.
        Throws:
        PortalException
        Since:
        7.0.0
      • getNode

        IRelatable getNode​(java.lang.String type,
                           java.lang.String objectId,
                           boolean createNode)
                    throws PortalException
        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.
        Parameters:
        type - of node.
        objectId - identify some kind of object.
        createNode - true or false.
        Returns:
        a new node or a node existing.
        Throws:
        PortalException
        Since:
        7.0.0
      • getRelationship

        IRelationship getRelationship​(java.lang.String id)
                               throws PortalException
        Gets the relationship.
        Parameters:
        id - identifies the relationship.
        Returns:
        a IRelationship that contains the identity equals the value passed in id param.
        Throws:
        PortalException
        Since:
        7.0.0
      • getRelationshipType

        IRelationshipType getRelationshipType​(java.lang.String id)
                                       throws PortalObjectNotFoundException
        Gets the type of relationship.
        Parameters:
        id - identifies the type of relationship.
        Returns:
        a IRelationshipType that contains the identity equals the value passed in id param.
        Throws:
        PortalObjectNotFoundException - if the type of relationship was not found.
        Since:
        7.0.0
      • listRelationships

        java.util.Set<IRelationship> listRelationships​(IRelatable source,
                                                       IRelationshipType relationshipType)
                                                throws PortalException
        Lists all relationships where the param source is the source and where the param source is the target if the relationship is bidirectional.
        Parameters:
        source - IRelatable source.
        relationshipType - IRelationship.
        Returns:
        a Set.
        Throws:
        PortalException
        Since:
        7.0.0
      • listRelationships

        java.util.Set<IRelatable> listRelationships​(IRelatable firstObject,
                                                    IRelatable secondObject,
                                                    IRelationshipType relationshipType)
                                             throws PortalException
        Lists all relatable nodes that contains a relationship with firstObject and secondObject.
        Parameters:
        firstObject - IRelatable source.
        secondObject - IRelatable source.
        relationshipType - a kind of relationship.
        Returns:
        a list that contains relatable nodes.
        Throws:
        PortalException
        Since:
        7.0.0