Class ServiceProviderImplementation
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.file.implementation.ServiceProviderImplementation
-
- All Implemented Interfaces:
ServiceProvider
public class ServiceProviderImplementation extends java.lang.Object implements ServiceProvider
Implementaion of theServiceProviderinterface
-
-
Field Summary
Fields Modifier and Type Field Description static booleancleanedstatic java.lang.LongnumberOfReferenceDirectoriesstatic java.lang.LongnumberOfReferenceFilesstatic java.nio.file.PathPATH_FOR_DIRECTORY_FILE_MAPstatic java.nio.file.PathPATH_FOR_DIRECTORY_SIZE_MAPstatic java.nio.file.PathPATH_FOR_REFERENCE_CONTENTstatic java.nio.file.PathPATH_FOR_TOTAL_FILE_NUMBERstatic java.nio.file.PathPATH_FOR_TOTAL_VOLUMEstatic java.lang.LongtotalNumberOfFilesstatic java.lang.LongvolumeOfReference
-
Constructor Summary
Constructors Constructor Description ServiceProviderImplementation()
-
Method Summary
Modifier and Type Method Description voidcalculateDirectorySizes()Function to calculate the size ofPrimaryDataDirectorys viaCalculateDirectorySizeThreadvoidcleanUpForBrokenEntities(PrimaryDataDirectory root)Clean up function to remove objects, if a upload failedvoidcleanUpForRejectedEntities()Clean up function to remove objects, if a request for a persistent identifier was rejectedvoiddeleteDirectoriesRecursively(org.hibernate.Session session, PrimaryDataDirectory currentDirectory)voiddeleteFilesRecursively(org.hibernate.Session session, PrimaryDataDirectory currentDirectory)java.lang.LonggetAvailableStorageSpace()Getter for the available space in the mount path of eDAL.intgetNumberOfUsers()Function to get the current number of users, who have ever login to the current instancejava.lang.LonggetUsedStorageSpace()Getter for the used space in the mount path of eDAL.booleanisCleaned()Get flag for rebuild Lucene Index after a cleanup.voidsetCleaned(boolean flag)Set flag for rebuild Lucene Index after a cleanup.
-
-
-
Field Detail
-
cleaned
public static boolean cleaned
-
PATH_FOR_DIRECTORY_SIZE_MAP
public static final java.nio.file.Path PATH_FOR_DIRECTORY_SIZE_MAP
-
PATH_FOR_DIRECTORY_FILE_MAP
public static final java.nio.file.Path PATH_FOR_DIRECTORY_FILE_MAP
-
PATH_FOR_TOTAL_FILE_NUMBER
public static final java.nio.file.Path PATH_FOR_TOTAL_FILE_NUMBER
-
PATH_FOR_TOTAL_VOLUME
public static final java.nio.file.Path PATH_FOR_TOTAL_VOLUME
-
PATH_FOR_REFERENCE_CONTENT
public static final java.nio.file.Path PATH_FOR_REFERENCE_CONTENT
-
totalNumberOfFiles
public static java.lang.Long totalNumberOfFiles
-
numberOfReferenceFiles
public static java.lang.Long numberOfReferenceFiles
-
numberOfReferenceDirectories
public static java.lang.Long numberOfReferenceDirectories
-
volumeOfReference
public static java.lang.Long volumeOfReference
-
-
Method Detail
-
getUsedStorageSpace
public java.lang.Long getUsedStorageSpace() throws EdalExceptionGetter for the used space in the mount path of eDAL.- Specified by:
getUsedStorageSpacein interfaceServiceProvider- Returns:
- used space
- Throws:
EdalException- if no path is specified.
-
getAvailableStorageSpace
public java.lang.Long getAvailableStorageSpace() throws EdalExceptionGetter for the available space in the mount path of eDAL.- Specified by:
getAvailableStorageSpacein interfaceServiceProvider- Returns:
- available space
- Throws:
EdalException- if no path is specified.
-
cleanUpForRejectedEntities
public void cleanUpForRejectedEntities()
Description copied from interface:ServiceProviderClean up function to remove objects, if a request for a persistent identifier was rejected- Specified by:
cleanUpForRejectedEntitiesin interfaceServiceProvider
-
deleteDirectoriesRecursively
public void deleteDirectoriesRecursively(org.hibernate.Session session, PrimaryDataDirectory currentDirectory) throws PrimaryDataDirectoryException- Throws:
PrimaryDataDirectoryException
-
deleteFilesRecursively
public void deleteFilesRecursively(org.hibernate.Session session, PrimaryDataDirectory currentDirectory) throws PrimaryDataDirectoryException- Throws:
PrimaryDataDirectoryException
-
calculateDirectorySizes
public void calculateDirectorySizes()
Description copied from interface:ServiceProviderFunction to calculate the size ofPrimaryDataDirectorys viaCalculateDirectorySizeThread- Specified by:
calculateDirectorySizesin interfaceServiceProvider
-
getNumberOfUsers
public int getNumberOfUsers()
Description copied from interface:ServiceProviderFunction to get the current number of users, who have ever login to the current instance- Specified by:
getNumberOfUsersin interfaceServiceProvider- Returns:
- the number of logged users
-
cleanUpForBrokenEntities
public void cleanUpForBrokenEntities(PrimaryDataDirectory root)
Description copied from interface:ServiceProviderClean up function to remove objects, if a upload failed- Specified by:
cleanUpForBrokenEntitiesin interfaceServiceProvider- Parameters:
root- the initial directory to start clean process
-
isCleaned
public boolean isCleaned()
Description copied from interface:ServiceProviderGet flag for rebuild Lucene Index after a cleanup.- Specified by:
isCleanedin interfaceServiceProvider- Returns:
- the flag
-
setCleaned
public void setCleaned(boolean flag)
Description copied from interface:ServiceProviderSet flag for rebuild Lucene Index after a cleanup.- Specified by:
setCleanedin interfaceServiceProvider- Parameters:
flag- the flag to set
-
-