Class EdalConfiguration


  • public final class EdalConfiguration
    extends java.lang.Object
    class to collect all parameters to start the eDAL system.
    • Field Detail

      • DATACITE_SEARCH_URL

        public static final java.lang.String DATACITE_SEARCH_URL
        See Also:
        Constant Field Values
      • DATACITE_TESTPREFIX

        public static final java.lang.String DATACITE_TESTPREFIX
        See Also:
        Constant Field Values
      • DATACITE_CONNECTION_TIMEOUT

        public static final int DATACITE_CONNECTION_TIMEOUT
        Connection timeout for HTTP connection to DataCite in milliseconds.
        See Also:
        Constant Field Values
      • DATACITE_CONNECTION_READ_TIMEOUT

        public static final int DATACITE_CONNECTION_READ_TIMEOUT
        Connection read timeout for HTTP connection to DataCite in milliseconds.
        See Also:
        Constant Field Values
      • SMTP_CONNECTION_TIMEOUT

        public static final int SMTP_CONNECTION_TIMEOUT
        Connection timeout for SMTP connection.
        See Also:
        Constant Field Values
      • DEFAULT_PATH

        public static final java.nio.file.Path DEFAULT_PATH
      • KEY_STORE_PATH

        public static final java.net.URL KEY_STORE_PATH
      • KEYSTORE_PASSWORD

        public static final java.lang.String KEYSTORE_PASSWORD
        See Also:
        Constant Field Values
      • DEFAULT_SUPPORTED_PRINCIPALS

        public static final java.util.List<java.lang.Class<? extends java.security.Principal>> DEFAULT_SUPPORTED_PRINCIPALS
        The default supported principals by eDAL.
      • DEFAULT_DATABASE_USERNAME

        public static final java.lang.String DEFAULT_DATABASE_USERNAME
        The default database user name
        See Also:
        Constant Field Values
      • DEFAULT_DATABASE_PASSWORD

        public static final java.lang.String DEFAULT_DATABASE_PASSWORD
        The default database password
        See Also:
        Constant Field Values
      • DEFAULT_HTTP_PORT

        public static final int DEFAULT_HTTP_PORT
        The default port for the HTTP listener
        See Also:
        Constant Field Values
    • Constructor Detail

      • EdalConfiguration

        public EdalConfiguration​(java.lang.String dataCiteUser,
                                 java.lang.String dataCitePassword,
                                 java.lang.String dataCitePrefix,
                                 javax.mail.internet.InternetAddress scientificReviewer,
                                 javax.mail.internet.InternetAddress substituteReviewer,
                                 javax.mail.internet.InternetAddress managingReviewer,
                                 javax.mail.internet.InternetAddress rootUser)
                          throws EdalConfigurationException
        Throws:
        EdalConfigurationException
      • EdalConfiguration

        public EdalConfiguration​(java.lang.String dataCiteUser,
                                 java.lang.String dataCitePassword,
                                 java.lang.String dataCitePrefix,
                                 javax.mail.internet.InternetAddress scientificReviewer,
                                 javax.mail.internet.InternetAddress substituteReviewer,
                                 javax.mail.internet.InternetAddress managingReviewer,
                                 javax.mail.internet.InternetAddress rootUser,
                                 java.lang.String httpProxyHost,
                                 int httpProxyPort,
                                 java.lang.String httpsProxyHost,
                                 int httpsProxyPort,
                                 java.lang.String smtpHost,
                                 java.lang.String smtpLogin,
                                 java.lang.String smtpPassword)
                          throws EdalConfigurationException
        Throws:
        EdalConfigurationException
      • EdalConfiguration

        public EdalConfiguration​(java.lang.String dataCiteUser,
                                 java.lang.String dataCitePassword,
                                 java.lang.String dataCitePrefix,
                                 javax.mail.internet.InternetAddress scientificReviewer,
                                 javax.mail.internet.InternetAddress substituteReviewer,
                                 javax.mail.internet.InternetAddress managingReviewer,
                                 javax.mail.internet.InternetAddress rootUser,
                                 java.lang.String smtpHost,
                                 java.lang.String smtpLogin,
                                 java.lang.String smtpPassword)
                          throws EdalConfigurationException
        Throws:
        EdalConfigurationException
    • Method Detail

      • guessProxySettings

        public static java.net.InetSocketAddress guessProxySettings()
      • addSupportedPrincipal

        public void addSupportedPrincipal​(java.lang.Class<? extends java.security.Principal> principal)
        Add a supported Principal to the list of principals.
        Parameters:
        principal - the principal to add.
      • getAliasDomainNames

        public java.util.List<java.lang.String> getAliasDomainNames()
      • getCertificatePathForHttpListener

        protected java.net.URL getCertificatePathForHttpListener()
        Returns:
        the certificatePathForHttpListener
      • getDataPath

        public java.nio.file.Path getDataPath()
        Returns:
        the data path.
      • getDoiInfix

        public java.lang.String getDoiInfix()
      • getEdalEmailAddress

        public java.lang.String getEdalEmailAddress()
        Getter for the edal email address.
        Returns:
        the email address for edal messages.
      • getErrorEmailAddress

        protected javax.mail.internet.InternetAddress getErrorEmailAddress()
                                                                    throws EdalConfigurationException
        Getter for the eMail address to send error messages.
        Returns:
        the errorEmailAddress
        Throws:
        EdalConfigurationException - if no email address is set
      • getErrorLogger

        public org.apache.logging.log4j.Logger getErrorLogger()
        Returns:
        the logger
      • getKeystorePasswordForHttpListener

        protected java.lang.String getKeystorePasswordForHttpListener()
        Returns:
        the keystorePasswordForHttpListener
      • getLogger

        public org.apache.logging.log4j.Logger getLogger()
        Returns:
        the logger
      • getMailSmtpHost

        public java.lang.String getMailSmtpHost()
        Getter for the mail SMTP host.
        Returns:
        the mail SMTP host.
      • getMailSmtpLogin

        public java.lang.String getMailSmtpLogin()
        Getter for the mail SMTP host.
        Returns:
        the mail SMTP host.
      • getMailSmtpPassword

        public java.lang.String getMailSmtpPassword()
        Getter for the mail SMTP password.
        Returns:
        the mail SMTP password.
      • getMountPath

        public java.nio.file.Path getMountPath()
        Getter for the mount path of the eDAL system.
        Returns:
        the mountPath
      • getReviewerManaging

        public javax.mail.internet.InternetAddress getReviewerManaging()
                                                                throws EdalConfigurationException
        Getter for the eMail address of the managing reviewer.
        Returns:
        the REVIEWER_MANAGING
        Throws:
        EdalConfigurationException - if no emailAddress is defined or if it is invalid.
      • getReviewerScientific

        public javax.mail.internet.InternetAddress getReviewerScientific()
                                                                  throws EdalConfigurationException
        Getter for the eMail address of the scientific reviewer.
        Returns:
        the reviewerScientific
        Throws:
        EdalConfigurationException - if no emailAddress is defined or if it is invalid.
      • getReviewerSubstitute

        public javax.mail.internet.InternetAddress getReviewerSubstitute()
                                                                  throws EdalConfigurationException
        Getter for the eMail address of the substitute reviewer.
        Returns:
        the reviewerSubstitute
        Throws:
        EdalConfigurationException - if no emailAddress is defined or if it is invalid.
      • getRootUser

        public javax.mail.internet.InternetAddress getRootUser()
                                                        throws EdalConfigurationException
        Getter for the eMail address for the root user.
        Returns:
        the rootUser
        Throws:
        EdalConfigurationException - if no emailAddress is defined or if it is invalid.
      • getStaticServerAddress

        public java.lang.String getStaticServerAddress()
      • getStaticServerPort

        public int getStaticServerPort()
      • getSupportedPrincipals

        public java.util.List<java.lang.Class<? extends java.security.Principal>> getSupportedPrincipals()
                                                                                                  throws EdalConfigurationException
        Getter for the List of supported Principals.
        Returns:
        the List of supported Principals
        Throws:
        EdalConfigurationException - if no supported principals are defined !
      • isInTestMode

        public boolean isInTestMode()
        Returns:
        the inTestModeE
      • isReadOnly

        public boolean isReadOnly()
      • isUseSSL

        public boolean isUseSSL()
        Returns:
        the useSSL
      • isUseSSLForHttpListener

        public boolean isUseSSLForHttpListener()
        Returns:
        the useSSLForHttpListener
      • isUseSystemProxies

        public boolean isUseSystemProxies()
        Check if proxies should be used.
        Returns:
        true or false
      • setCertificatePathForHttpListener

        protected void setCertificatePathForHttpListener​(java.net.URL certificatePathForHttpListener)
        Parameters:
        certificatePathForHttpListener - the certificatePathForHttpListener to set
      • setDatabasePassword

        public void setDatabasePassword​(java.lang.String databasePassword)
        Setter for the database password.
        Parameters:
        databasePassword - the database password to set
      • setDatabaseUsername

        public void setDatabaseUsername​(java.lang.String databaseUsername)
        Setter for the database user name.
        Parameters:
        databaseUsername - the database user name to set
      • setDataPath

        public void setDataPath​(java.nio.file.Path dataPath)
        Setter for the data path.
        Parameters:
        dataPath - the dataPath to set
      • setErrorEmailAddress

        protected void setErrorEmailAddress​(javax.mail.internet.InternetAddress errorEmailAddress)
        Parameters:
        errorEmailAddress - the errorEmail to set
      • setHttpPort

        public void setHttpPort​(int httpPort)
        Setter for the port of the HTTP server/listener.
        Parameters:
        httpPort - the HTTP port to set.
      • setHttpProxyHost

        public void setHttpProxyHost​(java.lang.String httpProxyHost)
        Setter for the HTTP proxy host.
        Parameters:
        httpProxyHost - the HTTP proxy host.
      • setHttpProxyPort

        public void setHttpProxyPort​(int httpProxyPort)
        Setter for the HTTP proxy port.
        Parameters:
        httpProxyPort - the HTTP proxy port.
      • setHttpsPort

        public void setHttpsPort​(int httpsPort)
        Setter for the port of the HTTPS server/listener.
        Parameters:
        httpsPort - the HTTPS port to set.
      • setHttpsProxyHost

        public void setHttpsProxyHost​(java.lang.String httpsProxyHost)
        Setter for the HTTPS proxy host.
        Parameters:
        httpsProxyHost - the HTTP proxy host to set.
      • setHttpsProxyPort

        public void setHttpsProxyPort​(int httpsProxyPort)
        Setter for the HTTPS proxy port.
        Parameters:
        httpsProxyPort - the HTTP proxy port to set.
      • setKeystorePasswordForHttpListener

        protected void setKeystorePasswordForHttpListener​(java.lang.String keystorePasswordForHttpListener)
        Parameters:
        keystorePasswordForHttpListener - the keystorePasswordForHttpListener to set
      • setMailSmtpHost

        public void setMailSmtpHost​(java.lang.String mailSmtpHost)
        Setter for the mail SMTP host.
        Parameters:
        mailSmtpHost - the mail SMTP host to set.
      • setMailSmtpLogin

        public void setMailSmtpLogin​(java.lang.String mailSmtpLogin)
        Setter for the mail SMTP login.
        Parameters:
        mailSmtpLogin - the mail SMTP login to set.
      • setMailSmtpPassword

        public void setMailSmtpPassword​(java.lang.String mailSmtpPassword)
        Setter for the SMTP password.
        Parameters:
        mailSmtpPassword - the password for the SMTP user
      • setMountPath

        public void setMountPath​(java.nio.file.Path mountPath)
        Setter for the mount path.
        Parameters:
        mountPath - the mount path to set
      • setStaticServerAddress

        public void setStaticServerAddress​(java.lang.String staticServerAddress)
      • setStaticServerPort

        public void setStaticServerPort​(int staticServerPort)
      • setSupportedPrincipals

        public void setSupportedPrincipals​(java.util.List<java.lang.Class<? extends java.security.Principal>> supportedPrincipals)
        Setter for the supported Principals.
        Parameters:
        supportedPrincipals - the supported Principals to set.
      • setUseSSL

        public void setUseSSL​(boolean useSSL)
        Parameters:
        useSSL - the useSSL to set
      • setUseSSLForHttpListener

        public void setUseSSLForHttpListener​(boolean useSSLForHttpListener,
                                             java.net.URL pathToKeyStore,
                                             java.lang.String keystorePassword)
        Parameters:
        useSSLForHttpListener - the useSSLForHttpListener to set
        pathToKeyStore - the Path to the keystore file
        keystorePassword - the password for the keystore
      • setUseSystemProxies

        public void setUseSystemProxies​(boolean useSystemProxies)
        Setter to activate the usage of proxies.
        Parameters:
        useSystemProxies - true if proxy should be used
      • isCleanBrokenEntities

        public boolean isCleanBrokenEntities()
      • setCleanBrokenEntities

        public void setCleanBrokenEntities​(boolean cleanBrokenEntities)
      • getInstanceNameLong

        public java.lang.String getInstanceNameLong()
      • setInstanceNameLong

        public void setInstanceNameLong​(java.lang.String instanceNameLong)
      • getInstanceNameShort

        public java.lang.String getInstanceNameShort()
      • setInstanceNameShort

        public void setInstanceNameShort​(java.lang.String instanceNameShort)
      • getPublisherString

        public java.lang.String getPublisherString()
      • setPublisherString

        public void setPublisherString​(java.lang.String publisherString)
      • setCustomReplyEmail

        public void setCustomReplyEmail​(java.lang.String customReplyEmail)