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 UriNodecreateDefault()Creates default UriNodejava.util.List<UriNode>findAllByParent(java.lang.String parentId)Retrieves all UriNode based on parent IDUriNodefindById(java.lang.String id)Retrieves UriNode based on IDjava.util.List<UriNode>findByLevel(int level)Retrieves all UriNode based on levelUriNodefindByUri(java.lang.String uri)Retrieves UriNode based on uriUriNodegetOrCreate(java.lang.String uri, UriContentType contentType)Creates new UriNode from URI path, or retrieves existing oneUriNodegetRoot()Retrieves all UriNode that are root nodesjava.lang.StringgetUriSeparator()Returns configured uri separatorUriNodemove(UriNode node, java.lang.String destUri)Moves UriNode to other destinationUriNodemove(java.lang.String uri, java.lang.String destUri)Moves UriNode to other destinationUriNodepopulateDirectRelatives(UriNode uriNode)Collects direct relatives (parent and children) of input UriNode and returns filled objectUriNodesave(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:
savein 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:
findAllByParentin interfaceIUriService- Parameters:
parentId- ID of parent UriNode- Returns:
- list of UriNode
-
getRoot
public UriNode getRoot()
Retrieves all UriNode that are root nodes- Specified by:
getRootin interfaceIUriService- Returns:
- list of UriNode
-
findByLevel
public java.util.List<UriNode> findByLevel(int level)
Retrieves all UriNode based on level- Specified by:
findByLevelin interfaceIUriService- Parameters:
level- of UriNodes- Returns:
- list of UriNodes
-
findById
public UriNode findById(java.lang.String id)
Retrieves UriNode based on ID- Specified by:
findByIdin interfaceIUriService- Parameters:
id- ID of UriNode- Returns:
- UriNode
-
findByUri
public UriNode findByUri(java.lang.String uri)
Retrieves UriNode based on uri- Specified by:
findByUriin 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:
populateDirectRelativesin 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:
movein 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:
movein 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:
getOrCreatein 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:
createDefaultin interfaceIUriService- Returns:
- the UriNode that was created or modified
-
getUriSeparator
public java.lang.String getUriSeparator()
Description copied from interface:IUriServiceReturns configured uri separator- Specified by:
getUriSeparatorin interfaceIUriService
-
-