Class DataManagerWrapper
- java.lang.Object
-
- java.rmi.server.RemoteObject
-
- java.rmi.server.RemoteServer
-
- java.rmi.server.UnicastRemoteObject
-
- de.ipk_gatersleben.bit.bi.edal.rmi.server.wrapper.DataManagerWrapper
-
- All Implemented Interfaces:
DataManagerRmiInterface
,java.io.Serializable
,java.rmi.Remote
public class DataManagerWrapper extends java.rmi.server.UnicastRemoteObject implements DataManagerRmiInterface
Wrapper class to wrapDataManager
functions on server side.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DataManagerWrapper()
Constructor forDataManagerWrapper
.DataManagerWrapper(ImplementationProvider implementationProvider, int dataPort)
Constructor for DataManagerWrapper.
-
Method Summary
Modifier and Type Method Description javax.security.auth.Subject
authenticate(Authentication authentication)
authenticate a user and return on success aSubject
MetaData
createMetaDataInstance()
java.lang.Long
getAvailableStorageSpace()
java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>>
getDefaultPermissions()
PrimaryDataDirectoryRmiInterface
getRootDirectory(javax.security.auth.Subject subject)
java.util.List<java.lang.Class<? extends java.security.Principal>>
getSupportedPrincipals()
Get all supportedPrincipal
s of the current eDAL system.java.lang.Long
getUsedStorageSpace()
void
receiveTestData(com.healthmarketscience.rmiio.RemoteOutputStream outputStream)
void
sendEmail(Authentication authentication, java.lang.String emailMessage, java.lang.String emailSubject)
Request the server to send a e-mail to an authenticated subjectvoid
sendEmail(Authentication authentication, java.lang.String emailMessage, java.lang.String emailSubject, java.net.URL attachment)
Request the server to send a e-mail with attachment to an authenticated subjectcom.healthmarketscience.rmiio.RemoteInputStream
sendFileToClient(java.lang.String fileName)
com.healthmarketscience.rmiio.RemoteOutputStream
sendOutputStreamToFillFromClient(java.lang.String fileName)
void
shutdown()
-
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
-
-
-
-
Constructor Detail
-
DataManagerWrapper
public DataManagerWrapper() throws java.rmi.RemoteException
Constructor forDataManagerWrapper
.- Throws:
java.rmi.RemoteException
- if unable to call remote function.
-
DataManagerWrapper
public DataManagerWrapper(ImplementationProvider implementationProvider, int dataPort) throws java.rmi.RemoteException
Constructor for DataManagerWrapper.- Parameters:
dataPort
- the data port.implementationProvider
- aImplementationProvider
object.- Throws:
java.rmi.RemoteException
- if unable to call remote function.
-
-
Method Detail
-
getRootDirectory
public PrimaryDataDirectoryRmiInterface getRootDirectory(javax.security.auth.Subject subject) throws java.rmi.RemoteException, PrimaryDataDirectoryException
- Specified by:
getRootDirectory
in interfaceDataManagerRmiInterface
- Parameters:
subject
- the authenticated subject- Returns:
- the root
PrimaryDataDirectory
for the passed implementation - Throws:
java.rmi.RemoteException
- if unable to call remote function.PrimaryDataDirectoryException
- if any.- See Also:
DataManager.getRootDirectory(de.ipk_gatersleben.bit.bi.edal.primary_data.file.ImplementationProvider, Subject)
-
createMetaDataInstance
public MetaData createMetaDataInstance() throws java.rmi.RemoteException
- Specified by:
createMetaDataInstance
in interfaceDataManagerRmiInterface
- Returns:
- a new
MetaData
object. - Throws:
java.rmi.RemoteException
- if unable to call remote function.- See Also:
ImplementationProvider.createMetaDataInstance()
-
shutdown
public void shutdown() throws java.rmi.RemoteException
- Specified by:
shutdown
in interfaceDataManagerRmiInterface
- Throws:
java.rmi.RemoteException
- if unable to call remote function.- See Also:
ImplementationProvider.shutdown()
-
getDefaultPermissions
public java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>> getDefaultPermissions() throws java.rmi.RemoteException
- Specified by:
getDefaultPermissions
in interfaceDataManagerRmiInterface
- Returns:
- map with all default permissions.
- Throws:
java.rmi.RemoteException
- if unable to call remote function.- See Also:
DataManager.getDefaultPermissions()
-
getAvailableStorageSpace
public java.lang.Long getAvailableStorageSpace() throws java.rmi.RemoteException, EdalException
- Specified by:
getAvailableStorageSpace
in interfaceDataManagerRmiInterface
- Returns:
- available space
- Throws:
java.rmi.RemoteException
- if unable to call remote function.EdalException
- if no mount path is set.- See Also:
DataManager.getAvailableStorageSpace()
-
getUsedStorageSpace
public java.lang.Long getUsedStorageSpace() throws java.rmi.RemoteException, EdalException
- Specified by:
getUsedStorageSpace
in interfaceDataManagerRmiInterface
- Returns:
- used space
- Throws:
java.rmi.RemoteException
- if unable to call remote function.EdalException
- if no mount path is set.- See Also:
DataManager.getAvailableStorageSpace()
-
getSupportedPrincipals
public java.util.List<java.lang.Class<? extends java.security.Principal>> getSupportedPrincipals() throws java.rmi.RemoteException, EdalException
Get all supportedPrincipal
s of the current eDAL system.- Specified by:
getSupportedPrincipals
in interfaceDataManagerRmiInterface
- Returns:
- the list of supported
Principal
s - Throws:
java.rmi.RemoteException
- if unable to call remote function.EdalException
- if unable to loadPrincipal
s.
-
authenticate
public javax.security.auth.Subject authenticate(Authentication authentication) throws java.rmi.RemoteException, EdalAuthenticateException
authenticate a user and return on success aSubject
- Specified by:
authenticate
in interfaceDataManagerRmiInterface
- Parameters:
authentication
-Authentication
- Returns:
- the authenticated
Subject
- Throws:
java.rmi.RemoteException
- if unable to call remote function.EdalAuthenticateException
- if unable to authenticate user
-
receiveTestData
public void receiveTestData(com.healthmarketscience.rmiio.RemoteOutputStream outputStream) throws java.rmi.RemoteException, java.io.IOException
- Specified by:
receiveTestData
in interfaceDataManagerRmiInterface
- Throws:
java.rmi.RemoteException
java.io.IOException
-
sendFileToClient
public com.healthmarketscience.rmiio.RemoteInputStream sendFileToClient(java.lang.String fileName) throws java.rmi.RemoteException, java.io.FileNotFoundException, java.io.IOException
- Specified by:
sendFileToClient
in interfaceDataManagerRmiInterface
- Throws:
java.rmi.RemoteException
java.io.FileNotFoundException
java.io.IOException
-
sendOutputStreamToFillFromClient
public com.healthmarketscience.rmiio.RemoteOutputStream sendOutputStreamToFillFromClient(java.lang.String fileName) throws java.rmi.RemoteException, java.io.FileNotFoundException
- Specified by:
sendOutputStreamToFillFromClient
in interfaceDataManagerRmiInterface
- Throws:
java.rmi.RemoteException
java.io.FileNotFoundException
-
sendEmail
public void sendEmail(Authentication authentication, java.lang.String emailMessage, java.lang.String emailSubject) throws java.rmi.RemoteException
Description copied from interface:DataManagerRmiInterface
Request the server to send a e-mail to an authenticated subject- Specified by:
sendEmail
in interfaceDataManagerRmiInterface
- Parameters:
authentication
- the user authenticationemailMessage
- the content of the e-mailemailSubject
- the subject of the e-mail- Throws:
java.rmi.RemoteException
- if unable to send eMail
-
sendEmail
public void sendEmail(Authentication authentication, java.lang.String emailMessage, java.lang.String emailSubject, java.net.URL attachment) throws java.rmi.RemoteException
Description copied from interface:DataManagerRmiInterface
Request the server to send a e-mail with attachment to an authenticated subject- Specified by:
sendEmail
in interfaceDataManagerRmiInterface
- Parameters:
authentication
- the user authenticationemailMessage
- the content of the e-mailemailSubject
- the subject of the e-mailattachment
- the attachedURL
- Throws:
java.rmi.RemoteException
- if unable to send eMail
-
-