Class PrimaryDataDirectoryImplementation
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.file.PrimaryDataEntity
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.file.PrimaryDataDirectory
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.file.implementation.PrimaryDataDirectoryImplementation
-
- All Implemented Interfaces:
java.lang.Comparable<PrimaryDataEntity>
@Entity public class PrimaryDataDirectoryImplementation extends PrimaryDataDirectory
Implementation ofPrimaryDataDirectory
.
-
-
Field Summary
-
Fields inherited from class de.ipk_gatersleben.bit.bi.edal.primary_data.file.PrimaryDataDirectory
PATH_SEPARATOR
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PrimaryDataDirectoryImplementation()
Default constructor forPrimaryDataDirectoryImplementation
is necessary for PojoInstantiator of HIBERNATE.PrimaryDataDirectoryImplementation(PrimaryDataDirectory path, java.lang.String name)
Constructor for PrimaryDataDirectoryImplementation.
-
Method Summary
Modifier and Type Method Description boolean
existImpl(java.lang.String path)
Abstract function for implementation ofPrimaryDataDirectory.exist(String)
java.lang.String
getID()
Getter for the ID of thisPrimaryDataEntity
.PrimaryDataDirectoryImplementation
getParentDirectory()
Getter for the parentPrimaryDataDirectory
of thisPrimaryDataEntity
.protected java.util.Map<java.security.Principal,java.util.List<EdalPermission>>
getPermissionsImpl()
Abstract function for implementation ofPrimaryDataEntity.getPermissions()
.protected PrimaryDataEntity
getPrimaryDataEntityImpl(java.lang.String name)
Abstract function for the implementation ofPrimaryDataDirectory.getPrimaryDataEntity(String)
.protected java.util.SortedSet<PrimaryDataEntityVersionImplementation>
getVersionList()
Getter for the fieldversionList
.protected java.util.SortedSet<PrimaryDataEntityVersion>
getVersionsImpl()
Abstract function for implementation ofPrimaryDataEntity.getVersions()
.protected java.util.List<PrimaryDataEntity>
listPrimaryDataEntitiesImpl(java.util.Calendar currentVersionDate, java.util.Calendar nextVersionDate)
Abstract function for the implementation ofPrimaryDataDirectory.listPrimaryDataEntities()
.protected void
moveImpl(PrimaryDataDirectory destinationDirectory)
Abstract function for implementation ofPrimaryDataEntity.move(PrimaryDataDirectory)
.protected java.util.List<PrimaryDataEntity>
searchByDublinCoreElementImpl(EnumDublinCoreElements element, UntypedData data, boolean fuzzy, boolean recursiveIntoSubdirectories)
Abstract function for implementation ofPrimaryDataDirectory.searchByDublinCoreElement(EnumDublinCoreElements, UntypedData, boolean, boolean)
.protected java.util.List<? extends PrimaryDataEntity>
searchByKeywordImpl(java.lang.String keyword, boolean fuzzy, boolean recursiveIntoSubdirectories)
Abstract function for the implementation ofPrimaryDataDirectory.searchByKeyword(String, boolean, boolean)
protected java.util.List<PrimaryDataEntity>
searchByMetaDataImpl(MetaData query, boolean fuzzy, boolean recursiveIntoSubdirectories)
Abstract function for implementation ofPrimaryDataDirectory.searchByMetaData(MetaData, boolean, boolean)
.protected java.util.List<? extends PrimaryDataEntity>
searchByPublicationStatusImpl(PublicationStatus publicationStatus)
Abstract function for the implementation ofPrimaryDataDirectory.searchByPublicationStatus(PublicationStatus)
.protected void
setVersionList(java.util.SortedSet<PrimaryDataEntityVersionImplementation> versionList)
Setter for the fieldversionList
.protected void
storeVersion(PrimaryDataEntityVersion publicVersion)
Abstract function for storing a newPrimaryDataEntityVersion
for anPrimaryDataEntity
object.-
Methods inherited from class de.ipk_gatersleben.bit.bi.edal.primary_data.file.PrimaryDataDirectory
createPrimaryDataDirectory, createPrimaryDataFile, exist, getAllPublishedEntities, getPrimaryDataEntity, getRootDirectory, listPrimaryDataEntities, searchByDublinCoreElement, searchByKeyword, searchByMetaData, searchByPublicationStatus, setMetaData
-
Methods inherited from class de.ipk_gatersleben.bit.bi.edal.primary_data.file.PrimaryDataEntity
addPublicReference, commitVersion, compareTo, delete, equals, getCurrentVersion, getImplementationProvider, getMetaData, getName, getPath, getPermissions, getPublicReferences, getSubject, getVersionByDate, getVersionByRevisionNumber, getVersions, grantPermission, hashCode, isDirectory, move, reloadOldDataType, rename, revokePermission, setCurrentVersion, setDefaultPermissions, setID, setParentDirectory, switchCurrentVersion, toString
-
-
-
-
Constructor Detail
-
PrimaryDataDirectoryImplementation
protected PrimaryDataDirectoryImplementation()
Default constructor forPrimaryDataDirectoryImplementation
is necessary for PojoInstantiator of HIBERNATE.
-
PrimaryDataDirectoryImplementation
public PrimaryDataDirectoryImplementation(PrimaryDataDirectory path, java.lang.String name) throws PrimaryDataEntityVersionException, PrimaryDataDirectoryException, MetaDataException
Constructor for PrimaryDataDirectoryImplementation.- Parameters:
path
- aPrimaryDataDirectory
object.name
- aString
object.- Throws:
PrimaryDataEntityVersionException
- if can not set currentPrimaryDataEntityVersion
.PrimaryDataDirectoryException
- if no parentPrimaryDataDirectory
is found.MetaDataException
- if theMetaData
object of the parentPrimaryDataDirectory
is not clone-able
-
-
Method Detail
-
existImpl
public boolean existImpl(java.lang.String path) throws PrimaryDataDirectoryException
Abstract function for implementation ofPrimaryDataDirectory.exist(String)
- Specified by:
existImpl
in classPrimaryDataDirectory
- Parameters:
path
- the name of thePrimaryDataEntity
to check.- Returns:
true
if there is already a PrimartyDataEntity with the same path;
false
otherwise- Throws:
PrimaryDataDirectoryException
- if unable to load allPrimaryDataEntity
objects in thisPrimaryDataDirectory
to check if the name already exists.
-
getID
public java.lang.String getID()
Getter for the ID of thisPrimaryDataEntity
.HIBERNATE : constant length cause it is an
UUID
- Overrides:
getID
in classPrimaryDataEntity
- Returns:
- the ID of this
PrimaryDataEntity
- See Also:
UUID
-
getParentDirectory
public PrimaryDataDirectoryImplementation getParentDirectory()
Getter for the parentPrimaryDataDirectory
of thisPrimaryDataEntity
.NOTE: It is not allowed to access the parent
PrimaryDataDirectory
of the rootPrimaryDataDirectory
!HIBERNATE : FetchType.EAGER for getPath()
- Overrides:
getParentDirectory
in classPrimaryDataEntity
- Returns:
- the parent
PrimaryDataDirectory
of thisPrimaryDataEntity
.
-
getPermissionsImpl
protected java.util.Map<java.security.Principal,java.util.List<EdalPermission>> getPermissionsImpl() throws PrimaryDataEntityException
Abstract function for implementation ofPrimaryDataEntity.getPermissions()
.- Specified by:
getPermissionsImpl
in classPrimaryDataEntity
- Returns:
- an unmodifiable
List
containing allEdalPermission
- Throws:
PrimaryDataEntityException
- if unable to load all permissions.
-
getPrimaryDataEntityImpl
protected PrimaryDataEntity getPrimaryDataEntityImpl(java.lang.String name) throws PrimaryDataDirectoryException
Abstract function for the implementation ofPrimaryDataDirectory.getPrimaryDataEntity(String)
.- Specified by:
getPrimaryDataEntityImpl
in classPrimaryDataDirectory
- Parameters:
name
- name of thePrimaryDataEntity
in thisPrimaryDataDirectory
.- Returns:
- the found
PrimaryDataEntity
object. - Throws:
PrimaryDataDirectoryException
- if no suchPrimaryDataEntity
exists.
-
getVersionList
protected java.util.SortedSet<PrimaryDataEntityVersionImplementation> getVersionList()
Getter for the fieldversionList
.- Returns:
- a
SortedSet
object.
-
getVersionsImpl
protected java.util.SortedSet<PrimaryDataEntityVersion> getVersionsImpl()
Abstract function for implementation ofPrimaryDataEntity.getVersions()
.- Specified by:
getVersionsImpl
in classPrimaryDataEntity
- Returns:
- an unmodifiable
SortedSet
containing allPrimaryDataEntity
.
-
listPrimaryDataEntitiesImpl
protected java.util.List<PrimaryDataEntity> listPrimaryDataEntitiesImpl(java.util.Calendar currentVersionDate, java.util.Calendar nextVersionDate) throws PrimaryDataDirectoryException
Abstract function for the implementation ofPrimaryDataDirectory.listPrimaryDataEntities()
.- Specified by:
listPrimaryDataEntitiesImpl
in classPrimaryDataDirectory
- Parameters:
currentVersionDate
- the date of the currentPrimaryDataEntityVersion
nextVersionDate
- the date of the nextPrimaryDataEntityVersion
- Returns:
- a
List
containing allPrimaryDataEntity
- Throws:
PrimaryDataDirectoryException
- if unable to load allPrimaryDataEntity
objects in thisPrimaryDataDirectory
.
-
moveImpl
protected void moveImpl(PrimaryDataDirectory destinationDirectory)
Abstract function for implementation ofPrimaryDataEntity.move(PrimaryDataDirectory)
.- Specified by:
moveImpl
in classPrimaryDataEntity
- Parameters:
destinationDirectory
- the newPrimaryDataDirectory
for thisPrimaryDataEntity
.
-
searchByDublinCoreElementImpl
protected java.util.List<PrimaryDataEntity> searchByDublinCoreElementImpl(EnumDublinCoreElements element, UntypedData data, boolean fuzzy, boolean recursiveIntoSubdirectories) throws PrimaryDataDirectoryException
Abstract function for implementation ofPrimaryDataDirectory.searchByDublinCoreElement(EnumDublinCoreElements, UntypedData, boolean, boolean)
.- Specified by:
searchByDublinCoreElementImpl
in classPrimaryDataDirectory
- Parameters:
element
- theEnumDublinCoreElements
for querydata
-UntypedData
parameter for searchfuzzy
-true
: exact search;false
: fuzzy searchrecursiveIntoSubdirectories
-true
: include also all sub directories recursively;false
: search only in the currentPrimaryDataDirectory
object- Returns:
- an unmodifiable
List
ofPrimaryDataEntity
that match the parameter - Throws:
PrimaryDataDirectoryException
- if unable to findPrimaryDataEntity
object or if there are too much results.
-
searchByKeywordImpl
protected java.util.List<? extends PrimaryDataEntity> searchByKeywordImpl(java.lang.String keyword, boolean fuzzy, boolean recursiveIntoSubdirectories) throws PrimaryDataDirectoryException
Description copied from class:PrimaryDataDirectory
Abstract function for the implementation ofPrimaryDataDirectory.searchByKeyword(String, boolean, boolean)
- Specified by:
searchByKeywordImpl
in classPrimaryDataDirectory
- Parameters:
keyword
- the term to search over all elements.fuzzy
-true
: fuzzy search;false
: exact searchrecursiveIntoSubdirectories
-true
: include also all subPrimaryDataDirectory
recursively;false
search only in the currentPrimaryDataDirectory
object- Returns:
- a unmodifiable
List
ofPrimaryDataEntity
that match the keyword. - Throws:
PrimaryDataDirectoryException
- if unable to search for the keyword.
-
searchByMetaDataImpl
protected java.util.List<PrimaryDataEntity> searchByMetaDataImpl(MetaData query, boolean fuzzy, boolean recursiveIntoSubdirectories) throws PrimaryDataDirectoryException, MetaDataException
Abstract function for implementation ofPrimaryDataDirectory.searchByMetaData(MetaData, boolean, boolean)
.- Specified by:
searchByMetaDataImpl
in classPrimaryDataDirectory
- Parameters:
query
- aMetaData
object.fuzzy
-true
: fuzzy search;false
: exact searchrecursiveIntoSubdirectories
-true
: include also all subPrimaryDataDirectory
recursively;false
search only in the currentPrimaryDataDirectory
object- Returns:
- a unmodifiable
List
ofPrimaryDataEntity
that match theMetaData
parameter - Throws:
PrimaryDataDirectoryException
- if unable to findPrimaryDataEntity
object or if there are too much results.MetaDataException
- if there are non valid values for someMetaData
elements.
-
searchByPublicationStatusImpl
protected java.util.List<? extends PrimaryDataEntity> searchByPublicationStatusImpl(PublicationStatus publicationStatus) throws PrimaryDataDirectoryException
Abstract function for the implementation ofPrimaryDataDirectory.searchByPublicationStatus(PublicationStatus)
.- Specified by:
searchByPublicationStatusImpl
in classPrimaryDataDirectory
- Parameters:
publicationStatus
- thePublicationStatus
of the searchedPrimaryDataEntity
.- Returns:
- a
List
of allPrimaryDataEntity
with aPublicReference
. - Throws:
PrimaryDataDirectoryException
- if unable to search forPublicationStatus
-
setVersionList
protected void setVersionList(java.util.SortedSet<PrimaryDataEntityVersionImplementation> versionList)
Setter for the fieldversionList
.- Parameters:
versionList
- aSortedSet
object.
-
storeVersion
protected void storeVersion(PrimaryDataEntityVersion publicVersion) throws PrimaryDataEntityVersionException
Abstract function for storing a newPrimaryDataEntityVersion
for anPrimaryDataEntity
object.- Specified by:
storeVersion
in classPrimaryDataEntity
- Parameters:
publicVersion
- the newPrimaryDataEntityVersion
to store.- Throws:
PrimaryDataEntityVersionException
- if unable to storePrimaryDataEntityVersion
.
-
-