Interface DependencyService
- All Known Implementing Classes:
DependencyServiceImpl
public interface DependencyService
Dependency Service is the sole custodian of the dependency database
and provide the interface to add, sync, delete and retrieve dependencies
across the system.
- Author:
- Sumer Jabri
-
Method Summary
Modifier and TypeMethodDescriptioncalculateDependencies
(String site, List<String> paths) Calculate dependencies for publishingcalculateDependenciesPaths
(String site, List<String> paths) Calculate dependencies paths for publishingvoid
deleteItemDependencies
(String site, String path) Delete an item dependencies from the database.void
deleteSiteDependencies
(String site) Delete all dependencies from the database for a given site.getDeleteDependencies
(String site, String path) getDeleteDependencies
(String site, List<String> paths) getItemDependencies
(String site, String path, int depth) Get all item dependencies of an item.getItemsDependingOn
(String site, String path, int depth) Get all items that depend on this item.getItemSpecificDependencies
(String site, String path, int depth) Get item-specific dependencies of an item.getPublishingDependencies
(String site, String path) Get a all publishing dependencies of a list of items.getPublishingDependencies
(String site, List<String> paths) Get a all publishing dependencies of a list of items.moveDependencies
(String site, String oldPath, String newPath) Move an item and make sure dependency paths remain correct.upsertDependencies
(String site, String path) Scan item for direct dependencies and synchronize those to the depenencies database adding the new deps, updating existing, and removing what was removed from the item.upsertDependencies
(String site, List<String> paths) Scan a list of items for direct dependencies and synchroniz those to the depenencies database adding the new deps, updating existing, and removing what was removed from the item.
-
Method Details
-
upsertDependencies
Set<String> upsertDependencies(String site, String path) throws SiteNotFoundException, ContentNotFoundException, ServiceLayerException Scan item for direct dependencies and synchronize those to the depenencies database adding the new deps, updating existing, and removing what was removed from the item.- Parameters:
site
- Site to operate onpath
- Path to item to scan- Returns:
- set of upserted dependencies
- Throws:
SiteNotFoundException
- Site doesn't existContentNotFoundException
- Path doesn't existServiceLayerException
- Internal error, see exception details
-
upsertDependencies
Set<String> upsertDependencies(String site, List<String> paths) throws SiteNotFoundException, ContentNotFoundException, ServiceLayerException Scan a list of items for direct dependencies and synchroniz those to the depenencies database adding the new deps, updating existing, and removing what was removed from the item.- Parameters:
site
- Site to operate onpaths
- List of paths to items to scan- Returns:
- set of upserted dependencies
- Throws:
SiteNotFoundException
- Site doesn't existContentNotFoundException
- One or more paths doesn't exist (database won't be updated for any of the items)ServiceLayerException
- Internal error, see exception details
-
getPublishingDependencies
List<String> getPublishingDependencies(String site, String path) throws SiteNotFoundException, ContentNotFoundException, ServiceLayerException Get a all publishing dependencies of a list of items. A publishing dependency is: * Never-published item that this item depends on * Item-specific dependency that has been modified but not published- Parameters:
site
- Site to operate onpath
- Paths to item to retrieve deps for- Returns:
- list of mandatory dependencies paths for publishing
- Throws:
SiteNotFoundException
- Site doesn't existContentNotFoundException
- Path doesn't existServiceLayerException
- Internal error, see exception details
-
getPublishingDependencies
List<String> getPublishingDependencies(String site, List<String> paths) throws SiteNotFoundException, ContentNotFoundException, ServiceLayerException Get a all publishing dependencies of a list of items. A publishing dependency is: * Never-published item that this item depends on * Item-specific dependency that has been modified but not published- Parameters:
site
- Site to operate onpaths
- List of paths to items to retrieve deps for- Returns:
- list of mandatory dependencies paths for publishing
- Throws:
SiteNotFoundException
- Site doesn't existContentNotFoundException
- One or more paths doesn't existServiceLayerException
- Internal error, see exception details
-
getItemSpecificDependencies
Set<String> getItemSpecificDependencies(String site, String path, int depth) throws SiteNotFoundException, ContentNotFoundException, ServiceLayerException Get item-specific dependencies of an item. An item-specific dependency is: * Only referenced by the parent item * Sits in a special path pattern defined during content modeling- Parameters:
site
- Site to operate onpath
- Path to items to retrieve deps fordepth
- Depth of tree to traverse. Depth of -1 disables depth limits- Returns:
- set of hard dependencies
- Throws:
SiteNotFoundException
- Site doesn't existContentNotFoundException
- Path doesn't existServiceLayerException
- Internal error, see exception details
-
getItemDependencies
Set<String> getItemDependencies(String site, String path, int depth) throws SiteNotFoundException, ContentNotFoundException, ServiceLayerException Get all item dependencies of an item.- Parameters:
site
- Site to operate onpath
- Path to items to retrieve deps fordepth
- Depth of tree to traverse. Depth of -1 disables depth limits- Returns:
- set of items that given item depends on
- Throws:
SiteNotFoundException
- Site doesn't existContentNotFoundException
- Path doesn't existServiceLayerException
- Internal error, see exception details
-
getItemsDependingOn
Set<String> getItemsDependingOn(String site, String path, int depth) throws SiteNotFoundException, ContentNotFoundException, ServiceLayerException Get all items that depend on this item.- Parameters:
site
- Site to operate onpath
- Path to items to retrieve deps fordepth
- Depth of tree to traverse. Depth of -1 disables depth limits- Returns:
- set of items depending on given item path
- Throws:
SiteNotFoundException
- Site doesn't existContentNotFoundException
- Path doesn't existServiceLayerException
- Internal error, see exception details
-
moveDependencies
Set<String> moveDependencies(String site, String oldPath, String newPath) throws SiteNotFoundException, ContentNotFoundException, ServiceLayerException Move an item and make sure dependency paths remain correct.- Parameters:
site
- Site to operate onoldPath
- Path to item to movenewPath
- Path the item moves to- Returns:
- set of updated dependencies
- Throws:
SiteNotFoundException
- Site doesn't existContentNotFoundException
- Path doesn't existServiceLayerException
- Internal error, see exception details
-
deleteItemDependencies
void deleteItemDependencies(String site, String path) throws SiteNotFoundException, ContentNotFoundException, ServiceLayerException Delete an item dependencies from the database.- Parameters:
site
- Site to operate onpath
- Path to items to retrieve deps for- Throws:
SiteNotFoundException
- Site doesn't existContentNotFoundException
- Path doesn't existServiceLayerException
- Internal error, see exception details
-
deleteSiteDependencies
Delete all dependencies from the database for a given site.- Parameters:
site
- Site to operate on- Throws:
ServiceLayerException
- Internal error, see exception details
-
getDeleteDependencies
Set<String> getDeleteDependencies(String site, String path) throws SiteNotFoundException, ContentNotFoundException, ServiceLayerException - Parameters:
site
- Site to operate onpath
- Path to item to retrieve delete dependencies for- Returns:
- Set of paths included as delete dependencies
- Throws:
SiteNotFoundException
- Site doesn't existContentNotFoundException
- Content doesn't existServiceLayerException
- Internal error
-
getDeleteDependencies
Set<String> getDeleteDependencies(String site, List<String> paths) throws SiteNotFoundException, ContentNotFoundException, ServiceLayerException - Parameters:
site
- Site to operate onpaths
- Paths to items to retrieve delete dependencies for- Returns:
- Set of paths included as delete dependencies
- Throws:
SiteNotFoundException
- Site doesn't existContentNotFoundException
- Content doesn't existServiceLayerException
- Internal error
-
calculateDependencies
Map<String,List<CalculateDependenciesEntityTO>> calculateDependencies(String site, List<String> paths) throws ServiceLayerException Calculate dependencies for publishing- Parameters:
site
- Site to operate onpaths
- List of items to calculate dependencies for- Returns:
- Formatted result set
- Throws:
ServiceLayerException
- general service error
-
calculateDependenciesPaths
Set<String> calculateDependenciesPaths(String site, List<String> paths) throws ServiceLayerException Calculate dependencies paths for publishing- Parameters:
site
- site to usepaths
- list of items to calculate dependencies for- Returns:
- dependencies paths
- Throws:
ServiceLayerException
- general service error
-