Class ClientDataManager
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.rmi.client.ClientDataManager
-
public class ClientDataManager extends java.lang.ObjectClass that provides the connection to an eDAL RMI server.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>>DEFAULT_PERMISSIONSConstant map with all initial default permissions.static org.apache.logging.log4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description ClientDataManager(java.lang.String serverAddress, int registryPort, Authentication authentication)Constructor forClientDataManager.
-
Method Summary
Modifier and Type Method Description MetaDatacreateMetadataInstance()Create a newMetaDatainstance with default values.AuthenticationgetAuthentication()java.lang.LonggetAvailableStorageSpace()Getter for the available space in the mount path of eDAL.java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>>getDefaultPermissions()Get the local stored default permissions for the current client user.intgetRegistryPort()ClientPrimaryDataDirectorygetRootDirectory()Central entry point.java.lang.StringgetServerAddress()protected javax.security.auth.SubjectgetSubject()Getter for the currentSubject.java.util.List<java.lang.Class<? extends java.security.Principal>>getSupportedPrincipals()Getter all supportedPrincipals of the current eDAL system.java.lang.LonggetUsedStorageSpace()Getter for the used space in the mount path of eDAL.static voidinit()Do nothing.voidresetDefaultPermissions()Reset the initial default permissions.voidsendEmail(java.lang.String emailMessage, java.lang.String emailSubject)voidsendEmail(java.lang.String emailMessage, java.lang.String emailSubject, java.net.URL attachment)voidsetDefaultPermissions(java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>> permissions)Overrides the current default permissions of the current user with the new permissions.voidtestReadingFromServer(java.lang.String fileName, java.io.OutputStream outputStream)voidtestStoringOnServer(java.lang.String fileName, java.io.InputStream inputStream)
-
-
-
Field Detail
-
logger
public static org.apache.logging.log4j.Logger logger
-
DEFAULT_PERMISSIONS
public static java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>> DEFAULT_PERMISSIONS
Constant map with all initial default permissions.Methods.listPrimaryDataEntities
Methods.getPrimaryDataEntity
Methods.read
Methods.exist
Methods.getParentDirectory
Methods.getVersions
Methods.getCurrentVersion
Methods.searchByDublinCoreElement
Methods.searchByMetaData
-
-
Constructor Detail
-
ClientDataManager
public ClientDataManager(java.lang.String serverAddress, int registryPort, Authentication authentication) throws EdalAuthenticateExceptionConstructor forClientDataManager.- Parameters:
authentication- theAuthenticationobject.registryPort- the port to the eDAL server.serverAddress- the path of the eDAL server.- Throws:
EdalAuthenticateException- if theSubjectis null.
-
-
Method Detail
-
init
public static void init()
Do nothing. Just to force the Java Class loader to load the class and run the static block to initialize the logging system.
-
createMetadataInstance
public MetaData createMetadataInstance()
Create a newMetaDatainstance with default values.- Returns:
- a new
MetaDataobject.
-
getAuthentication
public Authentication getAuthentication()
-
getAvailableStorageSpace
public java.lang.Long getAvailableStorageSpace() throws java.rmi.RemoteException, EdalExceptionGetter for the available space in the mount path of eDAL.- Returns:
- available space
- Throws:
java.rmi.RemoteException- if unable to call remote function.EdalException- if no mount path is set.
-
getDefaultPermissions
public java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>> getDefaultPermissions()
Get the local stored default permissions for the current client user.- Returns:
- the
Mapwith the default permissions.
-
getRegistryPort
public int getRegistryPort()
- Returns:
- the registryPort
-
getRootDirectory
public ClientPrimaryDataDirectory getRootDirectory() throws java.rmi.RemoteException, java.rmi.NotBoundException, PrimaryDataDirectoryException, EdalException, EdalAuthenticateException
Central entry point. Connect the client to the eDAL system and provide the rootClientPrimaryDataDirectory.- Returns:
- the root
ClientPrimaryDataDirectoryobject. - Throws:
java.rmi.RemoteException- if unable to call remote function.java.rmi.NotBoundException- if noDataManagerRmiInterfaceis bound.PrimaryDataDirectoryException- if unable to load the rootDirectory.EdalException- if failedEdalAuthenticateException- if authentication failed
-
getServerAddress
public java.lang.String getServerAddress()
- Returns:
- the serverAddress
-
getSubject
protected javax.security.auth.Subject getSubject()
Getter for the currentSubject.- Returns:
- the subject
-
getSupportedPrincipals
public java.util.List<java.lang.Class<? extends java.security.Principal>> getSupportedPrincipals() throws java.rmi.RemoteException, EdalExceptionGetter all supportedPrincipals of the current eDAL system.- Returns:
- the list of supported
Principals - Throws:
java.rmi.RemoteException- if unable to call remote function.EdalException- if unable to loadPrincipals.
-
getUsedStorageSpace
public java.lang.Long getUsedStorageSpace() throws java.rmi.RemoteException, EdalExceptionGetter for the used space in the mount path of eDAL.- Returns:
- used space
- Throws:
java.rmi.RemoteException- if unable to call remote function.EdalException- if no mount path is set.
-
resetDefaultPermissions
public void resetDefaultPermissions()
Reset the initial default permissions.
-
setDefaultPermissions
public void setDefaultPermissions(java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>> permissions)
Overrides the current default permissions of the current user with the new permissions.- Parameters:
permissions- the permissions to store.
-
testReadingFromServer
public void testReadingFromServer(java.lang.String fileName, java.io.OutputStream outputStream) throws java.io.IOException- Throws:
java.io.IOException
-
testStoringOnServer
public void testStoringOnServer(java.lang.String fileName, java.io.InputStream inputStream) throws java.io.IOException- Throws:
java.io.IOException
-
sendEmail
public void sendEmail(java.lang.String emailMessage, java.lang.String emailSubject) throws java.rmi.RemoteException- Throws:
java.rmi.RemoteException
-
sendEmail
public void sendEmail(java.lang.String emailMessage, java.lang.String emailSubject, java.net.URL attachment) throws java.rmi.RemoteException- Throws:
java.rmi.RemoteException
-
-