Class EdalHelpers
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.sample.EdalHelpers
-
public class EdalHelpers extends java.lang.ObjectProvide some helpful function for the first experience with eDAL.
-
-
Constructor Summary
Constructors Constructor Description EdalHelpers()
-
Method Summary
Modifier and Type Method Description static javax.security.auth.SubjectauthenticateElixirUser(java.lang.String httpProxyHost, int httpProxyPort)Authenticate user using theGoogleLoginModule.static javax.security.auth.SubjectauthenticateGoogleUser()Authenticate user using theGoogleLoginModule.static javax.security.auth.SubjectauthenticateGoogleUser(java.lang.String httpProxyHost, int httpProxyPort)Authenticate user using theGoogleLoginModule.static javax.security.auth.SubjectauthenticateIPKKerberosUser(java.lang.String user)Authenticate user using the IPK Kerberos-LoginModule.static javax.security.auth.SubjectauthenticateJKIKerberosUser(java.lang.String user)Authenticate user using the JKI Kerberos-LoginModule.static javax.security.auth.SubjectauthenticateORCIDUser(java.lang.String httpProxyHost, int httpProxyPort)Authenticate user using theORCIDLoginModule.static javax.security.auth.SubjectauthenticateSampleUser()Authenticate user using theSampleUserLoginModule-LoginModule.static javax.security.auth.SubjectauthenticateSubjectWithKerberos(java.lang.String kerberosRealm, java.lang.String kerberosKDC, java.lang.String user)Authenticate user using the specified Kerberos-LoginModule.static javax.security.auth.SubjectauthenticateUser(java.lang.String name, java.lang.String password)Authenticate user using theUserLoginModule-LoginModule.static javax.security.auth.SubjectauthenticateWinOrUnixOrMacUser()Authenticate user using the Windows- or Unix- or MAC-LoginModule.static voidcleanMountPath(java.nio.file.Path path)Clean all files in directory.static ImplementationProvidergetFileSystemImplementationProvider(boolean cleanMountPathBefore, EdalConfiguration config)Get a newFileSystemImplementationProvider.static voidgetSearchStatistic(org.hibernate.stat.Statistics statistics)Print SearchStatistic.static voidgetStatistic(org.hibernate.stat.Statistics statistics)Print PermissionStatistic.static booleanopenURL(java.lang.String url)Function to open a browser and loading the given URL.
-
-
-
Method Detail
-
authenticateGoogleUser
public static javax.security.auth.Subject authenticateGoogleUser() throws EdalAuthenticateExceptionAuthenticate user using theGoogleLoginModule.- Returns:
- the authenticated
Subject - Throws:
EdalAuthenticateException- if unable to runLoginModulesuccessful.
-
authenticateORCIDUser
public static javax.security.auth.Subject authenticateORCIDUser(java.lang.String httpProxyHost, int httpProxyPort) throws EdalAuthenticateExceptionAuthenticate user using theORCIDLoginModule.- Parameters:
httpProxyHost- the address of the HTTP proxy hosthttpProxyPort- the address of the HTTP proxy port- Returns:
- the authenticated
Subject - Throws:
EdalAuthenticateException- if unable to runLoginModulesuccessful.
-
authenticateElixirUser
public static javax.security.auth.Subject authenticateElixirUser(java.lang.String httpProxyHost, int httpProxyPort) throws EdalAuthenticateExceptionAuthenticate user using theGoogleLoginModule.- Parameters:
httpProxyHost- the address of the HTTP proxy hosthttpProxyPort- the address of the HTTP proxy port- Returns:
- the authenticated
Subject - Throws:
EdalAuthenticateException- if unable to runLoginModulesuccessful.
-
authenticateGoogleUser
public static javax.security.auth.Subject authenticateGoogleUser(java.lang.String httpProxyHost, int httpProxyPort) throws EdalAuthenticateExceptionAuthenticate user using theGoogleLoginModule.- Parameters:
httpProxyHost- the address of the HTTP proxy hosthttpProxyPort- the address of the HTTP proxy port- Returns:
- the authenticated
Subject - Throws:
EdalAuthenticateException- if unable to runLoginModulesuccessful.
-
authenticateIPKKerberosUser
public static javax.security.auth.Subject authenticateIPKKerberosUser(java.lang.String user) throws EdalAuthenticateExceptionAuthenticate user using the IPK Kerberos-LoginModule.- Parameters:
user- user name.- Returns:
- the authenticated
Subject - Throws:
EdalAuthenticateException- if unable to runLoginModulesuccessful.
-
authenticateJKIKerberosUser
public static javax.security.auth.Subject authenticateJKIKerberosUser(java.lang.String user) throws EdalAuthenticateExceptionAuthenticate user using the JKI Kerberos-LoginModule.- Parameters:
user- the user name to login- Returns:
- the authenticated
Subject - Throws:
EdalAuthenticateException- if unable to runLoginModulesuccessful.
-
authenticateUser
public static javax.security.auth.Subject authenticateUser(java.lang.String name, java.lang.String password) throws EdalAuthenticateExceptionAuthenticate user using theUserLoginModule-LoginModule.- Parameters:
name- the user name to authenticatepassword- the password of the user to authenticate- Returns:
- the authenticated
Subject - Throws:
EdalAuthenticateException- if unable to runLoginModulesuccessful.
-
authenticateSampleUser
public static javax.security.auth.Subject authenticateSampleUser() throws EdalAuthenticateExceptionAuthenticate user using theSampleUserLoginModule-LoginModule.- Returns:
- the authenticated
Subject - Throws:
EdalAuthenticateException- if unable to runLoginModulesuccessful.
-
authenticateSubjectWithKerberos
public static javax.security.auth.Subject authenticateSubjectWithKerberos(java.lang.String kerberosRealm, java.lang.String kerberosKDC, java.lang.String user) throws EdalAuthenticateExceptionAuthenticate user using the specified Kerberos-LoginModule.- Parameters:
kerberosRealm- the Kerberos realmkerberosKDC- the Kerberos KDCuser- optional username- Returns:
- the authenticated
Subject - Throws:
EdalAuthenticateException- if unable to runLoginModulesuccessful.
-
authenticateWinOrUnixOrMacUser
public static javax.security.auth.Subject authenticateWinOrUnixOrMacUser() throws EdalAuthenticateExceptionAuthenticate user using the Windows- or Unix- or MAC-LoginModule.- Returns:
- authenticated
Subject - Throws:
EdalAuthenticateException- if the authentication failed
-
cleanMountPath
public static void cleanMountPath(java.nio.file.Path path) throws EdalExceptionClean all files in directory.- Parameters:
path- aPathobject.- Throws:
EdalException- if unable to clean mount path.
-
getFileSystemImplementationProvider
public static ImplementationProvider getFileSystemImplementationProvider(boolean cleanMountPathBefore, EdalConfiguration config) throws EdalException
Get a newFileSystemImplementationProvider. The path to use for file storage and database is set to users home/edal_test- Parameters:
cleanMountPathBefore- true if you want to clean the database before start eDAL.config- theEdalConfigurationclass.- Returns:
- new
FileSystemImplementationProvider - Throws:
EdalException- if unable to clean mount path or create new mount path.
-
getSearchStatistic
public static void getSearchStatistic(org.hibernate.stat.Statistics statistics)
Print SearchStatistic.- Parameters:
statistics- theStatisticsto get information
-
getStatistic
public static void getStatistic(org.hibernate.stat.Statistics statistics)
Print PermissionStatistic.- Parameters:
statistics- theStatisticsto get information
-
openURL
public static boolean openURL(java.lang.String url)
Function to open a browser and loading the given URL.- Parameters:
url- the URL to open in a browser- Returns:
- true if the function was able to open the browser
-
-