Package com.hp.ucmdb.api.folders
Interface FoldersManagementSubService<FolderType,ResourceType>
public interface FoldersManagementSubService<FolderType,ResourceType>
The folders management interface.
This sub-service is used by other services.
________________
IMPORTANT NOTE:
methods which contain "folderPathFromRoot" parameter refers to the path from
root which does not contain the root itself, in other words - exclusively.
for example: a path to folder which is located in: Root/folder_a/folder_b will be represented as:
folder_a/folder_b.
-------------------------
- Since:
- UCMDB 9.0
-
Method Summary
Modifier and TypeMethodDescriptionboolean
attachFolderToFolder
(List<String> folderToAttachPathFromRoot, List<String> targetFolderPathFromRoot) Moves an existing folder to be attached to specified target folder.boolean
attachToFolder
(String resourceName, List<String> folderPathFromRoot) Attaches the resource matching the given name to the folder path, creating the path if needed.boolean
createFolder
(List<String> folderPathFromRoot) Creates folders according to the given path from the root.createFolder
(List<String> folderPathFromRoot, boolean isDetailed) Creates folders according to the given path from the root.createFolders
(List<String> folderPathFromRoot) Creates folders according to the given path from the root.boolean
deleteFolder
(List<String> folderPathFromRoot) Deletes the folder at the end of the given path, along with its subfolders and the resources in the folder or any of its subfolders.Returns the folder tree of the resources created by the service that created this object.boolean
renameFolder
(List<String> folderPath, String newName) Renames a folder.renameFolder
(List<String> folderPath, String newName, boolean isDetailed) boolean
saveInFolder
(ResourceType resource, List<String> folderPathFromRoot) Saves the resource to the server, updates an existing resource by the same name if such resource exists or creates the resource in the given path.
-
Method Details
-
createFolder
Creates folders according to the given path from the root. Skips any folder that already exists.- Parameters:
folderPathFromRoot
- The path. Can not be null.- Returns:
- true if any folder was created.
-
createFolder
Creates folders according to the given path from the root. Skips any folder that already exists.- Parameters:
folderPathFromRoot
- The path. Can not be null.isDetailed
- whether there is demand for detailed result such as the new folder's id.- Returns:
- FolderManagementResultsHolder
- See Also:
-
createFolders
Creates folders according to the given path from the root. Skips any folder that already exists.- Parameters:
folderPathFromRoot
- The path. Can not be null.- Returns:
- a map between folder path to its unique hashed id value.
-
deleteFolder
Deletes the folder at the end of the given path, along with its subfolders and the resources in the folder or any of its subfolders.- Parameters:
folderPathFromRoot
- The path. Can not be null.- Returns:
- true if any folder was deleted.
-
attachToFolder
Attaches the resource matching the given name to the folder path, creating the path if needed.- Parameters:
resourceName
- the name of the resource to attach. There must be a valid resource created by the service that created this object.folderPathFromRoot
- The path. Can not be null.- Returns:
- true if the resource was moved.
-
saveInFolder
Saves the resource to the server, updates an existing resource by the same name if such resource exists or creates the resource in the given path.- Parameters:
resource
- the resource to save.folderPathFromRoot
- The path from root where the resource will be created if the resource does not exist.- Returns:
- true if the resource was created or updated successfully.
-
attachFolderToFolder
boolean attachFolderToFolder(List<String> folderToAttachPathFromRoot, List<String> targetFolderPathFromRoot) Moves an existing folder to be attached to specified target folder. The folderToAttachPathFromRoot cannot be the root folder (empty list). If a folder with the same name (last element of folderToAttachPathFromRoot) already exists under targetFolderPathFromRoot, the request fails with an exception.- Parameters:
folderToAttachPathFromRoot
- the folder to move.targetFolderPathFromRoot
- the target folder to attach the folder to move under.- Returns:
- true if the folder was successfully moved.
-
renameFolder
Renames a folder. The folderPath cannot be the root folder (empty list). If a folder with the same name already exists under the parent folder of folderPath (sublist(0, folderPath.size() - 2)), the request fails with an exception.- Parameters:
folderPath
- the full path of the folder to rename.newName
- the new name for the folder.- Returns:
- true if the folder was renamed. false if it already had the specified name.
-
renameFolder
FolderManagementResultsHolder renameFolder(List<String> folderPath, String newName, boolean isDetailed) -
getFoldersTreeRoot
FolderType getFoldersTreeRoot()Returns the folder tree of the resources created by the service that created this object.- Returns:
- the folder tree of the resources created by the service that created this object.
-