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 theServiceProvider
interface
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
cleaned
static java.lang.Long
numberOfReferenceDirectories
static java.lang.Long
numberOfReferenceFiles
static java.nio.file.Path
PATH_FOR_DIRECTORY_FILE_MAP
static java.nio.file.Path
PATH_FOR_DIRECTORY_SIZE_MAP
static java.nio.file.Path
PATH_FOR_REFERENCE_CONTENT
static java.nio.file.Path
PATH_FOR_TOTAL_FILE_NUMBER
static java.nio.file.Path
PATH_FOR_TOTAL_VOLUME
static java.lang.Long
totalNumberOfFiles
static java.lang.Long
volumeOfReference
-
Constructor Summary
Constructors Constructor Description ServiceProviderImplementation()
-
Method Summary
Modifier and Type Method Description void
calculateDirectorySizes()
Function to calculate the size ofPrimaryDataDirectory
s viaCalculateDirectorySizeThread
void
cleanUpForBrokenEntities(PrimaryDataDirectory root)
Clean up function to remove objects, if a upload failedvoid
cleanUpForRejectedEntities()
Clean up function to remove objects, if a request for a persistent identifier was rejectedvoid
deleteDirectoriesRecursively(org.hibernate.Session session, PrimaryDataDirectory currentDirectory)
void
deleteFilesRecursively(org.hibernate.Session session, PrimaryDataDirectory currentDirectory)
java.lang.Long
getAvailableStorageSpace()
Getter for the available space in the mount path of eDAL.int
getNumberOfUsers()
Function to get the current number of users, who have ever login to the current instancejava.lang.Long
getUsedStorageSpace()
Getter for the used space in the mount path of eDAL.boolean
isCleaned()
Get flag for rebuild Lucene Index after a cleanup.void
setCleaned(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 EdalException
Getter for the used space in the mount path of eDAL.- Specified by:
getUsedStorageSpace
in interfaceServiceProvider
- Returns:
- used space
- Throws:
EdalException
- if no path is specified.
-
getAvailableStorageSpace
public java.lang.Long getAvailableStorageSpace() throws EdalException
Getter for the available space in the mount path of eDAL.- Specified by:
getAvailableStorageSpace
in interfaceServiceProvider
- Returns:
- available space
- Throws:
EdalException
- if no path is specified.
-
cleanUpForRejectedEntities
public void cleanUpForRejectedEntities()
Description copied from interface:ServiceProvider
Clean up function to remove objects, if a request for a persistent identifier was rejected- Specified by:
cleanUpForRejectedEntities
in 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:ServiceProvider
Function to calculate the size ofPrimaryDataDirectory
s viaCalculateDirectorySizeThread
- Specified by:
calculateDirectorySizes
in interfaceServiceProvider
-
getNumberOfUsers
public int getNumberOfUsers()
Description copied from interface:ServiceProvider
Function to get the current number of users, who have ever login to the current instance- Specified by:
getNumberOfUsers
in interfaceServiceProvider
- Returns:
- the number of logged users
-
cleanUpForBrokenEntities
public void cleanUpForBrokenEntities(PrimaryDataDirectory root)
Description copied from interface:ServiceProvider
Clean up function to remove objects, if a upload failed- Specified by:
cleanUpForBrokenEntities
in interfaceServiceProvider
- Parameters:
root
- the initial directory to start clean process
-
isCleaned
public boolean isCleaned()
Description copied from interface:ServiceProvider
Get flag for rebuild Lucene Index after a cleanup.- Specified by:
isCleaned
in interfaceServiceProvider
- Returns:
- the flag
-
setCleaned
public void setCleaned(boolean flag)
Description copied from interface:ServiceProvider
Set flag for rebuild Lucene Index after a cleanup.- Specified by:
setCleaned
in interfaceServiceProvider
- Parameters:
flag
- the flag to set
-
-