Class EdalConfiguration
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.EdalConfiguration
-
public final class EdalConfiguration extends java.lang.Objectclass to collect all parameters to start the eDAL system.
-
-
Field Summary
Fields Modifier and Type Field Description static intDATACITE_CONNECTION_READ_TIMEOUTConnection read timeout for HTTP connection to DataCite in milliseconds.static intDATACITE_CONNECTION_TIMEOUTConnection timeout for HTTP connection to DataCite in milliseconds.static java.lang.StringDATACITE_SEARCH_URLstatic java.lang.StringDATACITE_TESTPREFIXstatic java.lang.StringDEFAULT_DATABASE_PASSWORDThe default database passwordstatic java.lang.StringDEFAULT_DATABASE_USERNAMEThe default database user namestatic intDEFAULT_HTTP_PORTThe default port for the HTTP listenerstatic intDEFAULT_HTTPS_PORTstatic java.nio.file.PathDEFAULT_PATHstatic java.util.List<java.lang.Class<? extends java.security.Principal>>DEFAULT_SUPPORTED_PRINCIPALSThe default supported principals by eDAL.static java.net.URLKEY_STORE_PATHstatic java.lang.StringKEYSTORE_PASSWORDstatic intSMTP_CONNECTION_TIMEOUTConnection timeout for SMTP connection.static intSTREAM_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description 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)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)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)
-
Method Summary
Modifier and Type Method Description voidaddSupportedPrincipal(java.lang.Class<? extends java.security.Principal> principal)Add a supported Principal to the list of principals.java.util.List<java.lang.String>getAliasDomainNames()protected java.net.URLgetCertificatePathForHttpListener()java.lang.StringgetDatabasePassword()Getter for the database password.java.lang.StringgetDatabaseUsername()Getter for the database user name.java.lang.StringgetDataCitePassword()Getter for the DataCite password.java.lang.StringgetDataCitePrefix()Getter for the DataCite prefixjava.lang.StringgetDataCiteUser()Getter for the DataCite user name.java.nio.file.PathgetDataPath()java.lang.StringgetDoiInfix()java.lang.StringgetEdalEmailAddress()Getter for the edal email address.protected javax.mail.internet.InternetAddressgetErrorEmailAddress()Getter for the eMail address to send error messages.org.apache.logging.log4j.LoggergetErrorLogger()intgetHttpPort()Getter for the port of the HTTP server/listener.java.lang.StringgetHttpProxyHost()Getter for the HTTP proxy host.intgetHttpProxyPort()Getter for the HTTP proxy port.intgetHttpsPort()Getter for the port of the HTTPS server/listener.java.lang.StringgetHttpsProxyHost()Getter for the HTTPS proxy host.intgetHttpsProxyPort()Getter for the HTTPS proxy port.java.lang.StringgetInstanceNameLong()java.lang.StringgetInstanceNameShort()protected java.lang.StringgetKeystorePasswordForHttpListener()org.apache.logging.log4j.LoggergetLogger()java.lang.StringgetMailSmtpHost()Getter for the mail SMTP host.java.lang.StringgetMailSmtpLogin()Getter for the mail SMTP host.java.lang.StringgetMailSmtpPassword()Getter for the mail SMTP password.java.nio.file.PathgetMountPath()Getter for the mount path of the eDAL system.java.lang.StringgetPublisherString()javax.mail.internet.InternetAddressgetReviewerManaging()Getter for the eMail address of the managing reviewer.javax.mail.internet.InternetAddressgetReviewerScientific()Getter for the eMail address of the scientific reviewer.javax.mail.internet.InternetAddressgetReviewerSubstitute()Getter for the eMail address of the substitute reviewer.javax.mail.internet.InternetAddressgetRootUser()Getter for the eMail address for the root user.java.lang.StringgetStaticServerAddress()intgetStaticServerPort()java.util.List<java.lang.Class<? extends java.security.Principal>>getSupportedPrincipals()Getter for the List of supportedPrincipals.static java.net.InetSocketAddressguessProxySettings()static java.lang.StringguessSmtpSettings(java.lang.String smtpLogin, java.lang.String smtpPassword)booleanisCleanBrokenEntities()booleanisInTestMode()booleanisReadOnly()booleanisUseSSL()booleanisUseSSLForHttpListener()booleanisUseSystemProxies()Check if proxies should be used.protected voidsetCertificatePathForHttpListener(java.net.URL certificatePathForHttpListener)voidsetCleanBrokenEntities(boolean cleanBrokenEntities)voidsetCustomReplyEmail(java.lang.String customReplyEmail)voidsetDatabasePassword(java.lang.String databasePassword)Setter for the database password.voidsetDatabaseUsername(java.lang.String databaseUsername)Setter for the database user name.voidsetDataPath(java.nio.file.Path dataPath)Setter for the data path.voidsetDoiInfix(java.lang.String doiInfix)protected voidsetErrorEmailAddress(javax.mail.internet.InternetAddress errorEmailAddress)voidsetHttpPort(int httpPort)Setter for the port of the HTTP server/listener.voidsetHttpProxyHost(java.lang.String httpProxyHost)Setter for the HTTP proxy host.voidsetHttpProxyPort(int httpProxyPort)Setter for the HTTP proxy port.voidsetHttpsPort(int httpsPort)Setter for the port of the HTTPS server/listener.voidsetHttpsProxyHost(java.lang.String httpsProxyHost)Setter for the HTTPS proxy host.voidsetHttpsProxyPort(int httpsProxyPort)Setter for the HTTPS proxy port.voidsetInstanceNameLong(java.lang.String instanceNameLong)voidsetInstanceNameShort(java.lang.String instanceNameShort)protected voidsetKeystorePasswordForHttpListener(java.lang.String keystorePasswordForHttpListener)voidsetMailSmtpHost(java.lang.String mailSmtpHost)Setter for the mail SMTP host.voidsetMailSmtpLogin(java.lang.String mailSmtpLogin)Setter for the mail SMTP login.voidsetMailSmtpPassword(java.lang.String mailSmtpPassword)Setter for the SMTP password.voidsetMountPath(java.nio.file.Path mountPath)Setter for the mount path.voidsetPublisherString(java.lang.String publisherString)voidsetStaticServerAddress(java.lang.String staticServerAddress)voidsetStaticServerPort(int staticServerPort)voidsetSupportedPrincipals(java.util.List<java.lang.Class<? extends java.security.Principal>> supportedPrincipals)Setter for the supportedPrincipals.voidsetUseSSL(boolean useSSL)voidsetUseSSLForHttpListener(boolean useSSLForHttpListener, java.net.URL pathToKeyStore, java.lang.String keystorePassword)voidsetUseSystemProxies(boolean useSystemProxies)Setter to activate the usage of proxies.
-
-
-
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
-
STREAM_BUFFER_SIZE
public static final int STREAM_BUFFER_SIZE
- 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
-
DEFAULT_HTTPS_PORT
public static final int DEFAULT_HTTPS_PORT
- 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()
-
guessSmtpSettings
public static java.lang.String guessSmtpSettings(java.lang.String smtpLogin, java.lang.String smtpPassword) throws EdalConfigurationException- Throws:
EdalConfigurationException
-
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
-
getDatabasePassword
public java.lang.String getDatabasePassword() throws EdalConfigurationExceptionGetter for the database password.- Returns:
- the database password
- Throws:
EdalConfigurationException- if no database password is defined
-
getDatabaseUsername
public java.lang.String getDatabaseUsername() throws EdalConfigurationExceptionGetter for the database user name.- Returns:
- the database user name.
- Throws:
EdalConfigurationException- if no database user name is defined
-
getDataCitePassword
public java.lang.String getDataCitePassword() throws EdalConfigurationExceptionGetter for the DataCite password.- Returns:
- the DataCite password.
- Throws:
EdalConfigurationException- if no DataCite password is defined
-
getDataCitePrefix
public java.lang.String getDataCitePrefix() throws EdalConfigurationExceptionGetter for the DataCite prefix- Returns:
- the DataCite prefix
- Throws:
EdalConfigurationException- if no prefix is defined
-
getDataCiteUser
public java.lang.String getDataCiteUser() throws EdalConfigurationExceptionGetter for the DataCite user name.- Returns:
- the DataCite user name.
- Throws:
EdalConfigurationException- if no DataCite user name is defined
-
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 EdalConfigurationExceptionGetter 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
-
getHttpPort
public int getHttpPort() throws EdalConfigurationExceptionGetter for the port of the HTTP server/listener.- Returns:
- the HTTP port.
- Throws:
EdalConfigurationException- if no HTTP port is set.
-
getHttpProxyHost
public java.lang.String getHttpProxyHost() throws EdalConfigurationExceptionGetter for the HTTP proxy host.- Returns:
- the HTTP proxy host.
- Throws:
EdalConfigurationException- if no HTTP proxy host is defined
-
getHttpProxyPort
public int getHttpProxyPort() throws EdalConfigurationExceptionGetter for the HTTP proxy port.- Returns:
- the HTTP proxy port.
- Throws:
EdalConfigurationException- if no HTTP proxy port is defined
-
getHttpsPort
public int getHttpsPort() throws EdalConfigurationExceptionGetter for the port of the HTTPS server/listener.- Returns:
- the HTTPS port.
- Throws:
EdalConfigurationException- if no HTTPS port is set.
-
getHttpsProxyHost
public java.lang.String getHttpsProxyHost() throws EdalConfigurationExceptionGetter for the HTTPS proxy host.- Returns:
- the HTTPS proxy host.
- Throws:
EdalConfigurationException- if no HTTPS proxy host is defined
-
getHttpsProxyPort
public int getHttpsProxyPort() throws EdalConfigurationExceptionGetter for the HTTPS proxy port.- Returns:
- the HTTPS proxy port.
- Throws:
EdalConfigurationException- if no HTTPS proxy port is defined
-
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 EdalConfigurationExceptionGetter 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 EdalConfigurationExceptionGetter 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 EdalConfigurationExceptionGetter 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 EdalConfigurationExceptionGetter 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 EdalConfigurationExceptionGetter for the List of supportedPrincipals.- 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
-
setDoiInfix
public void setDoiInfix(java.lang.String doiInfix) throws EdalConfigurationException- Throws:
EdalConfigurationException
-
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 supportedPrincipals.- Parameters:
supportedPrincipals- the supportedPrincipals 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 setpathToKeyStore- thePathto the keystore filekeystorePassword- 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)
-
-