Class EdalHelpers


  • public class EdalHelpers
    extends java.lang.Object
    Provide some helpful function for the first experience with eDAL.
    • Constructor Detail

      • EdalHelpers

        public EdalHelpers()
    • Method Detail

      • authenticateORCIDUser

        public static javax.security.auth.Subject authenticateORCIDUser​(java.lang.String httpProxyHost,
                                                                        int httpProxyPort)
                                                                 throws EdalAuthenticateException
        Authenticate user using the ORCIDLoginModule.
        Parameters:
        httpProxyHost - the address of the HTTP proxy host
        httpProxyPort - the address of the HTTP proxy port
        Returns:
        the authenticated Subject
        Throws:
        EdalAuthenticateException - if unable to run LoginModule successful.
      • authenticateElixirUser

        public static javax.security.auth.Subject authenticateElixirUser​(java.lang.String httpProxyHost,
                                                                         int httpProxyPort)
                                                                  throws EdalAuthenticateException
        Authenticate user using the GoogleLoginModule.
        Parameters:
        httpProxyHost - the address of the HTTP proxy host
        httpProxyPort - the address of the HTTP proxy port
        Returns:
        the authenticated Subject
        Throws:
        EdalAuthenticateException - if unable to run LoginModule successful.
      • authenticateGoogleUser

        public static javax.security.auth.Subject authenticateGoogleUser​(java.lang.String httpProxyHost,
                                                                         int httpProxyPort)
                                                                  throws EdalAuthenticateException
        Authenticate user using the GoogleLoginModule.
        Parameters:
        httpProxyHost - the address of the HTTP proxy host
        httpProxyPort - the address of the HTTP proxy port
        Returns:
        the authenticated Subject
        Throws:
        EdalAuthenticateException - if unable to run LoginModule successful.
      • authenticateIPKKerberosUser

        public static javax.security.auth.Subject authenticateIPKKerberosUser​(java.lang.String user)
                                                                       throws EdalAuthenticateException
        Authenticate user using the IPK Kerberos-LoginModule.
        Parameters:
        user - user name.
        Returns:
        the authenticated Subject
        Throws:
        EdalAuthenticateException - if unable to run LoginModule successful.
      • authenticateJKIKerberosUser

        public static javax.security.auth.Subject authenticateJKIKerberosUser​(java.lang.String user)
                                                                       throws EdalAuthenticateException
        Authenticate user using the JKI Kerberos-LoginModule.
        Parameters:
        user - the user name to login
        Returns:
        the authenticated Subject
        Throws:
        EdalAuthenticateException - if unable to run LoginModule successful.
      • authenticateUser

        public static javax.security.auth.Subject authenticateUser​(java.lang.String name,
                                                                   java.lang.String password)
                                                            throws EdalAuthenticateException
        Authenticate user using the UserLoginModule -LoginModule.
        Parameters:
        name - the user name to authenticate
        password - the password of the user to authenticate
        Returns:
        the authenticated Subject
        Throws:
        EdalAuthenticateException - if unable to run LoginModule successful.
      • authenticateSubjectWithKerberos

        public static javax.security.auth.Subject authenticateSubjectWithKerberos​(java.lang.String kerberosRealm,
                                                                                  java.lang.String kerberosKDC,
                                                                                  java.lang.String user)
                                                                           throws EdalAuthenticateException
        Authenticate user using the specified Kerberos-LoginModule.
        Parameters:
        kerberosRealm - the Kerberos realm
        kerberosKDC - the Kerberos KDC
        user - optional username
        Returns:
        the authenticated Subject
        Throws:
        EdalAuthenticateException - if unable to run LoginModule successful.
      • authenticateWinOrUnixOrMacUser

        public static javax.security.auth.Subject authenticateWinOrUnixOrMacUser()
                                                                          throws EdalAuthenticateException
        Authenticate 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 EdalException
        Clean all files in directory.
        Parameters:
        path - a Path object.
        Throws:
        EdalException - if unable to clean mount path.
      • getSearchStatistic

        public static void getSearchStatistic​(org.hibernate.stat.Statistics statistics)
        Print SearchStatistic.
        Parameters:
        statistics - the Statistics to get information
      • getStatistic

        public static void getStatistic​(org.hibernate.stat.Statistics statistics)
        Print PermissionStatistic.
        Parameters:
        statistics - the Statistics to 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