Package org.ehrbase.api.service
Interface FolderService
-
- All Superinterfaces:
BaseService,VersionedObjectService<com.nedap.archie.rm.directory.Folder,org.ehrbase.response.ehrscape.FolderDto>
public interface FolderService extends BaseService, VersionedObjectService<com.nedap.archie.rm.directory.Folder,org.ehrbase.response.ehrscape.FolderDto>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadminDeleteFolder(UUID folderId)Admin method to delete a Folder from the DB.Optional<org.ehrbase.response.ehrscape.FolderDto>get(com.nedap.archie.rm.support.identification.ObjectVersionId folderId, String path)Retrieves a folder from database identified by object_version_uid and extracts the given sub path of existing.Optional<org.ehrbase.response.ehrscape.FolderDto>getByTimeStamp(com.nedap.archie.rm.support.identification.ObjectVersionId folderId, Timestamp timestamp, String path)Fetches an folder entry from database identified by the root folder uid and the given timestamp.IntegergetLastVersionNumber(com.nedap.archie.rm.support.identification.ObjectVersionId folderId)Searches the last version number of a given folder entry from database.Optional<org.ehrbase.response.ehrscape.FolderDto>getLatest(com.nedap.archie.rm.support.identification.ObjectVersionId folderId, String path)Fetches the latest entry from database.IntegergetVersionNumberForTimestamp(com.nedap.archie.rm.support.identification.ObjectVersionId folderId, Timestamp timestamp)Searches for the folder version that was the current version at the given timestamp.org.ehrbase.response.ehrscape.StructuredStringserialize(com.nedap.archie.rm.directory.Folder folder, org.ehrbase.response.ehrscape.StructuredStringFormat format)Serializes folder content from request body into a structured string that can be used by database save mechanism to parse in into jsonb format that will be saved at the database.-
Methods inherited from interface org.ehrbase.api.service.BaseService
getServerConfig, getSystemUuid
-
-
-
-
Method Detail
-
get
Optional<org.ehrbase.response.ehrscape.FolderDto> get(com.nedap.archie.rm.support.identification.ObjectVersionId folderId, String path)
Retrieves a folder from database identified by object_version_uid and extracts the given sub path of existing. If the object_version_uid does not contain a version number the latest entry will be returned. A path with common unix like root notation '/' will be treated as if there is no path specified and the full tree will be returned.- Parameters:
folderId- - object_version_uid for target folderpath- - Optional path to sub folder to extract- Returns:
- FolderDTO for further usage in upper layers
-
getLatest
Optional<org.ehrbase.response.ehrscape.FolderDto> getLatest(com.nedap.archie.rm.support.identification.ObjectVersionId folderId, String path)
Fetches the latest entry from database. This will be- Parameters:
folderId- - object_version_uid for target folderpath- - Optional path to sub folder to extract- Returns:
- FolderDTO for further usage in other layers
-
getByTimeStamp
Optional<org.ehrbase.response.ehrscape.FolderDto> getByTimeStamp(com.nedap.archie.rm.support.identification.ObjectVersionId folderId, Timestamp timestamp, String path)
Fetches an folder entry from database identified by the root folder uid and the given timestamp. If the current version has ben modified after the given timestamp the folder will be searched inside the folder history table.- Parameters:
folderId- - object_version_uid for target foldertimestamp- - Timestamp of folder version to findpath- - Optional path to sub folder to extract- Returns:
- FolderDTO for further usage in other layers
-
serialize
org.ehrbase.response.ehrscape.StructuredString serialize(com.nedap.archie.rm.directory.Folder folder, org.ehrbase.response.ehrscape.StructuredStringFormat format)Serializes folder content from request body into a structured string that can be used by database save mechanism to parse in into jsonb format that will be saved at the database.- Parameters:
folder- - Folder to serializeformat- - Source format of the folder- Returns:
- Structured string that can be parsed into jsonb
-
getLastVersionNumber
Integer getLastVersionNumber(com.nedap.archie.rm.support.identification.ObjectVersionId folderId)
Searches the last version number of a given folder entry from database. This will be executed against the folder table which contains the latest entry of a folder. The version will be extracted from there.- Parameters:
folderId- - Id of the folder to search for the latest version- Returns:
- Version number of the latest folder entry
- Throws:
ObjectNotFoundException- - Folder entry does not exist
-
getVersionNumberForTimestamp
Integer getVersionNumberForTimestamp(com.nedap.archie.rm.support.identification.ObjectVersionId folderId, Timestamp timestamp)
Searches for the folder version that was the current version at the given timestamp. If the entry from folder table has a later timestamp the folder history will be queried to find the version at the timestamp- Parameters:
folderId- - Id of the folder to search the versiontimestamp- - Timestamp to look for the version number- Returns:
- - Version number that was actual at the timestamp
- Throws:
ObjectNotFoundException- - Folder entry does not exist at the time
-
adminDeleteFolder
void adminDeleteFolder(UUID folderId)
Admin method to delete a Folder from the DB. See EHRbase Admin API specification for details.- Parameters:
folderId- Folder to delete
-
-