Class UriService
- java.lang.Object
-
- com.netgrif.application.engine.petrinet.service.UriService
-
- All Implemented Interfaces:
IUriService
@Service public class UriService extends java.lang.Object implements IUriService
Service for managing UriNode objects
-
-
Constructor Summary
Constructors Constructor Description UriService(UriNodeRepository uriNodeRepository, UriProperties uriProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UriNode
createDefault()
Creates default UriNodejava.util.List<UriNode>
findAllByParent(java.lang.String parentId)
Retrieves all UriNode based on parent IDUriNode
findById(java.lang.String id)
Retrieves UriNode based on IDjava.util.List<UriNode>
findByLevel(int level)
Retrieves all UriNode based on levelUriNode
findByUri(java.lang.String uri)
Retrieves UriNode based on uriUriNode
getOrCreate(java.lang.String uri, UriContentType contentType)
Creates new UriNode from URI path, or retrieves existing oneUriNode
getRoot()
Retrieves all UriNode that are root nodesjava.lang.String
getUriSeparator()
Returns configured uri separatorUriNode
move(UriNode node, java.lang.String destUri)
Moves UriNode to other destinationUriNode
move(java.lang.String uri, java.lang.String destUri)
Moves UriNode to other destinationUriNode
populateDirectRelatives(UriNode uriNode)
Collects direct relatives (parent and children) of input UriNode and returns filled objectUriNode
save(UriNode uriNode)
Saves UriNode object to database
-
-
-
Constructor Detail
-
UriService
public UriService(UriNodeRepository uriNodeRepository, UriProperties uriProperties)
-
-
Method Detail
-
save
public UriNode save(UriNode uriNode)
Saves UriNode object to database- Specified by:
save
in interfaceIUriService
- 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 interfaceIUriService
- 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 interfaceIUriService
- Returns:
- list of UriNode
-
findByLevel
public java.util.List<UriNode> findByLevel(int level)
Retrieves all UriNode based on level- Specified by:
findByLevel
in interfaceIUriService
- 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 interfaceIUriService
- Parameters:
id
- ID of UriNode- Returns:
- UriNode
-
findByUri
public UriNode findByUri(java.lang.String uri)
Retrieves UriNode based on uri- Specified by:
findByUri
in interfaceIUriService
- 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 interfaceIUriService
- 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 interfaceIUriService
- Parameters:
uri
- to be moveddestUri
- 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 interfaceIUriService
- Parameters:
node
- to be moveddestUri
- the destination URI- Returns:
- result UriNode object
-
getOrCreate
public UriNode getOrCreate(java.lang.String uri, UriContentType contentType)
Creates new UriNode from URI path, or retrieves existing one- Specified by:
getOrCreate
in interfaceIUriService
- Parameters:
uri
- to be used for creating UriNodecontentType
- 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 interfaceIUriService
- Returns:
- the UriNode that was created or modified
-
getUriSeparator
public java.lang.String getUriSeparator()
Description copied from interface:IUriService
Returns configured uri separator- Specified by:
getUriSeparator
in interfaceIUriService
-
-