Class UriService

  • All Implemented Interfaces:
    IUriService

    @Service
    public class UriService
    extends java.lang.Object
    implements IUriService
    Service for managing UriNode objects
    • Method Detail

      • save

        public UriNode save​(UriNode uriNode)
        Saves UriNode object to database
        Specified by:
        save in interface IUriService
        Parameters:
        uriNode - to be saved
      • findAllByParent

        public java.util.List<UriNode> findAllByParent​(java.lang.String parentId)
        Retrieves all UriNode based on parent ID
        Specified by:
        findAllByParent in interface IUriService
        Parameters:
        parentId - ID of parent UriNode
        Returns:
        list of UriNode
      • getRoot

        public UriNode getRoot()
        Retrieves all UriNode that are root nodes
        Specified by:
        getRoot in interface IUriService
        Returns:
        list of UriNode
      • findByLevel

        public java.util.List<UriNode> findByLevel​(int level)
        Retrieves all UriNode based on level
        Specified by:
        findByLevel in interface IUriService
        Parameters:
        level - of UriNodes
        Returns:
        list of UriNodes
      • findById

        public UriNode findById​(java.lang.String id)
        Retrieves UriNode based on ID
        Specified by:
        findById in interface IUriService
        Parameters:
        id - ID of UriNode
        Returns:
        UriNode
      • findByUri

        public UriNode findByUri​(java.lang.String uri)
        Retrieves UriNode based on uri
        Specified by:
        findByUri in interface IUriService
        Parameters:
        uri - ID of UriNode
        Returns:
        UriNode
      • populateDirectRelatives

        public UriNode populateDirectRelatives​(UriNode uriNode)
        Collects direct relatives (parent and children) of input UriNode and returns filled object
        Specified by:
        populateDirectRelatives in interface IUriService
        Parameters:
        uriNode - to be filled with relatives
        Returns:
        filled UriNode
      • move

        public UriNode move​(java.lang.String uri,
                            java.lang.String destUri)
        Moves UriNode to other destination
        Specified by:
        move in interface IUriService
        Parameters:
        uri - to be moved
        destUri - the destination URI
        Returns:
        result UriNode object
      • move

        public UriNode move​(UriNode node,
                            java.lang.String destUri)
        Moves UriNode to other destination
        Specified by:
        move in interface IUriService
        Parameters:
        node - to be moved
        destUri - the destination URI
        Returns:
        result UriNode object
      • getOrCreate

        public UriNode getOrCreate​(PetriNet petriNet,
                                   UriContentType contentType)
        Creates new UriNode from PetriNet identifier, or retrieves existing one
        Specified by:
        getOrCreate in interface IUriService
        Parameters:
        petriNet - to be used for creating UriNode
        contentType - to decide the content type of UriNode
        Returns:
        the UriNode that was created or modified
      • getOrCreate

        public UriNode getOrCreate​(java.lang.String uri,
                                   UriContentType contentType)
        Creates new UriNode from URI path, or retrieves existing one
        Specified by:
        getOrCreate in interface IUriService
        Parameters:
        uri - to be used for creating UriNode
        contentType - to decide the content type of UriNode
        Returns:
        the UriNode that was created or modified netgrif/process/test/all_data, netgrif/process
      • createDefault

        public UriNode createDefault()
        Creates default UriNode
        Specified by:
        createDefault in interface IUriService
        Returns:
        the UriNode that was created or modified