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 wrapDataManagerfunctions 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.Subjectauthenticate(Authentication authentication)authenticate a user and return on success aSubjectMetaDatacreateMetaDataInstance()java.lang.LonggetAvailableStorageSpace()java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>>getDefaultPermissions()PrimaryDataDirectoryRmiInterfacegetRootDirectory(javax.security.auth.Subject subject)java.util.List<java.lang.Class<? extends java.security.Principal>>getSupportedPrincipals()Get all supportedPrincipals of the current eDAL system.java.lang.LonggetUsedStorageSpace()voidreceiveTestData(com.healthmarketscience.rmiio.RemoteOutputStream outputStream)voidsendEmail(Authentication authentication, java.lang.String emailMessage, java.lang.String emailSubject)Request the server to send a e-mail to an authenticated subjectvoidsendEmail(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.RemoteInputStreamsendFileToClient(java.lang.String fileName)com.healthmarketscience.rmiio.RemoteOutputStreamsendOutputStreamToFillFromClient(java.lang.String fileName)voidshutdown()-
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
-
-
-
-
Constructor Detail
-
DataManagerWrapper
public DataManagerWrapper() throws java.rmi.RemoteExceptionConstructor 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- aImplementationProviderobject.- 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:
getRootDirectoryin interfaceDataManagerRmiInterface- Parameters:
subject- the authenticated subject- Returns:
- the root
PrimaryDataDirectoryfor 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:
createMetaDataInstancein interfaceDataManagerRmiInterface- Returns:
- a new
MetaDataobject. - Throws:
java.rmi.RemoteException- if unable to call remote function.- See Also:
ImplementationProvider.createMetaDataInstance()
-
shutdown
public void shutdown() throws java.rmi.RemoteException- Specified by:
shutdownin 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:
getDefaultPermissionsin 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:
getAvailableStorageSpacein 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:
getUsedStorageSpacein 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, EdalExceptionGet all supportedPrincipals of the current eDAL system.- Specified by:
getSupportedPrincipalsin interfaceDataManagerRmiInterface- Returns:
- the list of supported
Principals - Throws:
java.rmi.RemoteException- if unable to call remote function.EdalException- if unable to loadPrincipals.
-
authenticate
public javax.security.auth.Subject authenticate(Authentication authentication) throws java.rmi.RemoteException, EdalAuthenticateException
authenticate a user and return on success aSubject- Specified by:
authenticatein 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:
receiveTestDatain interfaceDataManagerRmiInterface- Throws:
java.rmi.RemoteExceptionjava.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:
sendFileToClientin interfaceDataManagerRmiInterface- Throws:
java.rmi.RemoteExceptionjava.io.FileNotFoundExceptionjava.io.IOException
-
sendOutputStreamToFillFromClient
public com.healthmarketscience.rmiio.RemoteOutputStream sendOutputStreamToFillFromClient(java.lang.String fileName) throws java.rmi.RemoteException, java.io.FileNotFoundException- Specified by:
sendOutputStreamToFillFromClientin interfaceDataManagerRmiInterface- Throws:
java.rmi.RemoteExceptionjava.io.FileNotFoundException
-
sendEmail
public void sendEmail(Authentication authentication, java.lang.String emailMessage, java.lang.String emailSubject) throws java.rmi.RemoteException
Description copied from interface:DataManagerRmiInterfaceRequest the server to send a e-mail to an authenticated subject- Specified by:
sendEmailin 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:DataManagerRmiInterfaceRequest the server to send a e-mail with attachment to an authenticated subject- Specified by:
sendEmailin 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
-
-