Package org.ehrbase.dao.access.jooq
Class FolderHistoryAccess
java.lang.Object
org.ehrbase.dao.access.support.DataAccess
org.ehrbase.dao.access.jooq.FolderHistoryAccess
- All Implemented Interfaces:
Comparable<FolderHistoryAccess>,I_Compensatable,I_DomainAccess,I_FolderAccess,I_VersionedCRUD
public class FolderHistoryAccess
extends DataAccess
implements I_FolderAccess, Comparable<FolderHistoryAccess>
Persistence operations on Folder history.
- Since:
- 1.0.0
- Author:
- Luis Marco-Ruiz
-
Field Summary
Fields inherited from interface org.ehrbase.dao.access.interfaces.I_DomainAccess
DBCP2_POOL, KEY_AUTO_RECONNECT, KEY_CONNECTION_MODE, KEY_DATABASE, KEY_DIALECT, KEY_HOST, KEY_INITIAL_CONNECTIONS, KEY_INTROSPECT_CACHE, KEY_KNOWLEDGE, KEY_LOG_ABANDONNED, KEY_LOGIN, KEY_MAX_ACTIVE, KEY_MAX_CONNECTION, KEY_MAX_IDLE, KEY_PASSWORD, KEY_PORT, KEY_REMOVE_ABANDONNED, KEY_REMOVE_ABANDONNED_TIMEOUT, KEY_SCHEMA, KEY_SET_MAX_PREPARED_STATEMENTS, KEY_SET_POOL_PREPARED_STATEMENTS, KEY_TEST_ON_BORROW, KEY_URL, KEY_WAIT_MS, PG_POOL -
Constructor Summary
ConstructorsConstructorDescriptionFolderHistoryAccess(I_DomainAccess domainAccess, String tenantIdentifier) FolderHistoryAccess(I_DomainAccess domainAccess, UUID ehrId, I_ContributionAccess contributionAccess, String tenantIdentifier) -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoke physical deletion.commit(LocalDateTime timestamp, UUID contribution) Commit the object with the necessary metadata, which will be derived from the contribution.commit(LocalDateTime timestamp, UUID committerId, UUID systemId, String description) Data Access and modification methodsintintdelete(LocalDateTime timestamp, UUID contribution) Delete the object with the necessary metadata, which will be derived from the contribution.intdelete(LocalDateTime timestamp, UUID committerId, UUID systemId, String description) Delete the object with the necessary metadata.static booleandeleteFlatBy(I_DomainAccess domainAccess, UUID folderId, UUID contributionId) getAudit()getEhrId()Getters and Setters for the FolderRecord to storecom.nedap.archie.rm.datastructures.ItemStructuregetId()static I_FolderAccessgetInstanceForExistingFolder(I_DomainAccess domainAccess, com.nedap.archie.rm.support.identification.ObjectVersionId folderId, Timestamp timestamp) List<com.nedap.archie.rm.support.identification.ObjectRef<? extends com.nedap.archie.rm.support.identification.ObjectId>>getItems()Get the items references stored as a part of the givenFolderstatic IntegergetLastVersionNumber(I_DomainAccess domainAccess, UUID folderId) Returns the last version number of a given folder by counting all previous versions of a given folder id.Get the list of subfolders for theFolderthat corresponds to thisI_FolderAccessstatic intgetVersionFromTimeStamp(I_DomainAccess domainAccess, UUID vFolderUid, Timestamp timeCommitted) static booleanhasPreviousVersion(I_DomainAccess domainAccess, UUID folderId) Checks if there are existing entries for given folder uuid at the folder history table.booleanstatic I_FolderAccessretrieveInstanceForExistingFolder(I_DomainAccess domainAccess, UUID folderId, Timestamp timestamp) voidvoidsetContributionAccess(I_ContributionAccess contributionAccess) voidvoidsetFolderDetails(com.nedap.archie.rm.datastructures.ItemStructure folderDetails) voidsetFolderId(UUID folderId) voidsetFolderName(String folderName) voidsetFolderNArchetypeNodeId(String folderArchetypeNodeId) voidsetFolderSysPeriod(AbstractMap.SimpleEntry<OffsetDateTime, OffsetDateTime> folderSysPeriod) voidsetFolderSysTransaction(Timestamp folderSysTransaction) voidsetInContribution(UUID inContribution) voidsetIsFolderActive(boolean folderActive) voidsetSubfoldersList(Map<UUID, I_FolderAccess> subfolders) booleanupdate(LocalDateTime timestamp, UUID contribution) Update the object with the necessary metadata, which will be derived from the contribution.booleanupdate(LocalDateTime timestamp, UUID committerId, UUID systemId, String description, I_ConceptAccess.ContributionChangeType changeType) Update the object with the necessary metadata.Methods inherited from class org.ehrbase.dao.access.support.DataAccess
getConnection, getContext, getDialect, getIntrospectService, getKnowledgeManager, getServerConfig, releaseConnection
-
Constructor Details
-
FolderHistoryAccess
-
FolderHistoryAccess
public FolderHistoryAccess(I_DomainAccess domainAccess, UUID ehrId, I_ContributionAccess contributionAccess, String tenantIdentifier)
-
-
Method Details
-
deleteFlatBy
-
commit
Data Access and modification methods- Specified by:
commitin interfaceI_VersionedCRUD- Parameters:
timestamp- Time of operationcommitterId- Audit committersystemId- Audit systemdescription- (Optional) Audit description- Returns:
- ID of object
-
commit
Description copied from interface:I_VersionedCRUDCommit the object with the necessary metadata, which will be derived from the contribution.- Specified by:
commitin interfaceI_VersionedCRUD- Parameters:
timestamp- Time of operationcontribution- Given contribution to use and derive audit data from- Returns:
- ID of object
-
update
public boolean update(LocalDateTime timestamp, UUID committerId, UUID systemId, String description, I_ConceptAccess.ContributionChangeType changeType) Description copied from interface:I_VersionedCRUDUpdate the object with the necessary metadata.- Specified by:
updatein interfaceI_VersionedCRUD- Parameters:
timestamp- Time of operationcommitterId- Audit committersystemId- Audit systemdescription- (Optional) Audit descriptionchangeType- Specific change type, because there are more than DELETED.- Returns:
- Boolean representing success of update
-
update
Description copied from interface:I_VersionedCRUDUpdate the object with the necessary metadata, which will be derived from the contribution.- Specified by:
updatein interfaceI_VersionedCRUD- Parameters:
timestamp- Time of operationcontribution- Given contribution to use and derive audit data from- Returns:
- Boolean representing success of update
-
delete
Description copied from interface:I_VersionedCRUDDelete the object with the necessary metadata.- Specified by:
deletein interfaceI_VersionedCRUD- Parameters:
timestamp- Time of operationcommitterId- Audit committersystemId- Audit systemdescription- (Optional) Audit description- Returns:
- Number of deleted objects
-
delete
Description copied from interface:I_VersionedCRUDDelete the object with the necessary metadata, which will be derived from the contribution.- Specified by:
deletein interfaceI_VersionedCRUD- Parameters:
timestamp- Time of operationcontribution- Given contribution to use and derive audit data from- Returns:
- Number of deleted objects
-
getLastVersionNumber
Returns the last version number of a given folder by counting all previous versions of a given folder id. If there are no previous versions in the history table the version number will be 1. Otherwise the current version equals the count of entries in the folder history table plus 1.- Parameters:
domainAccess- - Database connection access contextfolderId- - UUID of the folder to check for the last version- Returns:
- Latest version number for the folder
-
hasPreviousVersion
Checks if there are existing entries for given folder uuid at the folder history table. If there are entries existing, the folder has been modified during previous actions and there are older versions existing.- Parameters:
domainAccess- - Database connection access contextfolderId- - UUID of folder to check- Returns:
- Folder has previous versions or not
-
getEhrId
Getters and Setters for the FolderRecord to store- Specified by:
getEhrIdin interfaceI_FolderAccess
-
setEhrId
-
getContributionAccess
-
setContributionAccess
-
setSubfoldersList
-
getSubfoldersList
Description copied from interface:I_FolderAccessGet the list of subfolders for theFolderthat corresponds to thisI_FolderAccess- Specified by:
getSubfoldersListin interfaceI_FolderAccess- Returns:
- Map<UUID, I_FolderAccess> whose key is the UUID of the child
Folder, and whose value is the I_FolderAccess for the childFolder.
-
getItems
public List<com.nedap.archie.rm.support.identification.ObjectRef<? extends com.nedap.archie.rm.support.identification.ObjectId>> getItems()Description copied from interface:I_FolderAccessGet the items references stored as a part of the givenFolder- Specified by:
getItemsin interfaceI_FolderAccess- Returns:
- items of the
Folderthat corresponds to thisI_FolderAccess
-
getFolderId
- Specified by:
getFolderIdin interfaceI_FolderAccess
-
setFolderId
- Specified by:
setFolderIdin interfaceI_FolderAccess
-
getInContribution
- Specified by:
getInContributionin interfaceI_FolderAccess
-
setInContribution
- Specified by:
setInContributionin interfaceI_FolderAccess
-
getFolderName
- Specified by:
getFolderNamein interfaceI_FolderAccess
-
setFolderName
- Specified by:
setFolderNamein interfaceI_FolderAccess
-
getFolderArchetypeNodeId
- Specified by:
getFolderArchetypeNodeIdin interfaceI_FolderAccess
-
setFolderNArchetypeNodeId
- Specified by:
setFolderNArchetypeNodeIdin interfaceI_FolderAccess
-
isFolderActive
public boolean isFolderActive()- Specified by:
isFolderActivein interfaceI_FolderAccess
-
setIsFolderActive
public void setIsFolderActive(boolean folderActive) - Specified by:
setIsFolderActivein interfaceI_FolderAccess
-
getFolderDetails
public com.nedap.archie.rm.datastructures.ItemStructure getFolderDetails()- Specified by:
getFolderDetailsin interfaceI_FolderAccess
-
setFolderDetails
public void setFolderDetails(com.nedap.archie.rm.datastructures.ItemStructure folderDetails) - Specified by:
setFolderDetailsin interfaceI_FolderAccess
-
setFolderSysTransaction
- Specified by:
setFolderSysTransactionin interfaceI_FolderAccess
-
getFolderSysTransaction
- Specified by:
getFolderSysTransactionin interfaceI_FolderAccess
-
getFolderSysPeriod
- Specified by:
getFolderSysPeriodin interfaceI_FolderAccess
-
setFolderSysPeriod
public void setFolderSysPeriod(AbstractMap.SimpleEntry<OffsetDateTime, OffsetDateTime> folderSysPeriod) - Specified by:
setFolderSysPeriodin interfaceI_FolderAccess
-
getAudit
- Specified by:
getAuditin interfaceI_FolderAccess
-
setAudit
- Specified by:
setAuditin interfaceI_FolderAccess
-
getDataAccess
- Specified by:
getDataAccessin interfaceI_DomainAccess
-
compareTo
- Specified by:
compareToin interfaceComparable<FolderHistoryAccess>
-
getVersionFromTimeStamp
public static int getVersionFromTimeStamp(I_DomainAccess domainAccess, UUID vFolderUid, Timestamp timeCommitted) throws InternalServerException - Throws:
IllegalArgumentException- when no version in compliance with timestamp is availableInternalServerException- on problem with SQL statement or input
-
getInstanceForExistingFolder
public static I_FolderAccess getInstanceForExistingFolder(I_DomainAccess domainAccess, com.nedap.archie.rm.support.identification.ObjectVersionId folderId, Timestamp timestamp) -
retrieveInstanceForExistingFolder
public static I_FolderAccess retrieveInstanceForExistingFolder(I_DomainAccess domainAccess, UUID folderId, Timestamp timestamp) -
adminDeleteFolder
public void adminDeleteFolder()Description copied from interface:I_FolderAccessInvoke physical deletion.- Specified by:
adminDeleteFolderin interfaceI_FolderAccess
-
getSysTransaction
- Specified by:
getSysTransactionin interfaceI_Compensatable
-
getContributionId
- Specified by:
getContributionIdin interfaceI_Compensatable
-
getId
- Specified by:
getIdin interfaceI_Compensatable
-