Class EdalConfiguration
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.EdalConfiguration
-
public final class EdalConfiguration extends java.lang.Object
class to collect all parameters to start the eDAL system.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DATACITE_CONNECTION_READ_TIMEOUT
Connection read timeout for HTTP connection to DataCite in milliseconds.static int
DATACITE_CONNECTION_TIMEOUT
Connection timeout for HTTP connection to DataCite in milliseconds.static java.lang.String
DATACITE_SEARCH_URL
static java.lang.String
DATACITE_TESTPREFIX
static java.lang.String
DEFAULT_DATABASE_PASSWORD
The default database passwordstatic java.lang.String
DEFAULT_DATABASE_USERNAME
The default database user namestatic int
DEFAULT_HTTP_PORT
The default port for the HTTP listenerstatic int
DEFAULT_HTTPS_PORT
static java.nio.file.Path
DEFAULT_PATH
static java.util.List<java.lang.Class<? extends java.security.Principal>>
DEFAULT_SUPPORTED_PRINCIPALS
The default supported principals by eDAL.static java.net.URL
KEY_STORE_PATH
static java.lang.String
KEYSTORE_PASSWORD
static int
SMTP_CONNECTION_TIMEOUT
Connection timeout for SMTP connection.static int
STREAM_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 void
addSupportedPrincipal(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.URL
getCertificatePathForHttpListener()
java.lang.String
getDatabasePassword()
Getter for the database password.java.lang.String
getDatabaseUsername()
Getter for the database user name.java.lang.String
getDataCitePassword()
Getter for the DataCite password.java.lang.String
getDataCitePrefix()
Getter for the DataCite prefixjava.lang.String
getDataCiteUser()
Getter for the DataCite user name.java.nio.file.Path
getDataPath()
java.lang.String
getDoiInfix()
java.lang.String
getEdalEmailAddress()
Getter for the edal email address.protected javax.mail.internet.InternetAddress
getErrorEmailAddress()
Getter for the eMail address to send error messages.org.apache.logging.log4j.Logger
getErrorLogger()
int
getHttpPort()
Getter for the port of the HTTP server/listener.java.lang.String
getHttpProxyHost()
Getter for the HTTP proxy host.int
getHttpProxyPort()
Getter for the HTTP proxy port.int
getHttpsPort()
Getter for the port of the HTTPS server/listener.java.lang.String
getHttpsProxyHost()
Getter for the HTTPS proxy host.int
getHttpsProxyPort()
Getter for the HTTPS proxy port.java.lang.String
getInstanceNameLong()
java.lang.String
getInstanceNameShort()
protected java.lang.String
getKeystorePasswordForHttpListener()
org.apache.logging.log4j.Logger
getLogger()
java.lang.String
getMailSmtpHost()
Getter for the mail SMTP host.java.lang.String
getMailSmtpLogin()
Getter for the mail SMTP host.java.lang.String
getMailSmtpPassword()
Getter for the mail SMTP password.java.nio.file.Path
getMountPath()
Getter for the mount path of the eDAL system.java.lang.String
getPublisherString()
javax.mail.internet.InternetAddress
getReviewerManaging()
Getter for the eMail address of the managing reviewer.javax.mail.internet.InternetAddress
getReviewerScientific()
Getter for the eMail address of the scientific reviewer.javax.mail.internet.InternetAddress
getReviewerSubstitute()
Getter for the eMail address of the substitute reviewer.javax.mail.internet.InternetAddress
getRootUser()
Getter for the eMail address for the root user.java.lang.String
getStaticServerAddress()
int
getStaticServerPort()
java.util.List<java.lang.Class<? extends java.security.Principal>>
getSupportedPrincipals()
Getter for the List of supportedPrincipal
s.static java.net.InetSocketAddress
guessProxySettings()
static java.lang.String
guessSmtpSettings(java.lang.String smtpLogin, java.lang.String smtpPassword)
boolean
isCleanBrokenEntities()
boolean
isInTestMode()
boolean
isReadOnly()
boolean
isUseSSL()
boolean
isUseSSLForHttpListener()
boolean
isUseSystemProxies()
Check if proxies should be used.protected void
setCertificatePathForHttpListener(java.net.URL certificatePathForHttpListener)
void
setCleanBrokenEntities(boolean cleanBrokenEntities)
void
setCustomReplyEmail(java.lang.String customReplyEmail)
void
setDatabasePassword(java.lang.String databasePassword)
Setter for the database password.void
setDatabaseUsername(java.lang.String databaseUsername)
Setter for the database user name.void
setDataPath(java.nio.file.Path dataPath)
Setter for the data path.void
setDoiInfix(java.lang.String doiInfix)
protected void
setErrorEmailAddress(javax.mail.internet.InternetAddress errorEmailAddress)
void
setHttpPort(int httpPort)
Setter for the port of the HTTP server/listener.void
setHttpProxyHost(java.lang.String httpProxyHost)
Setter for the HTTP proxy host.void
setHttpProxyPort(int httpProxyPort)
Setter for the HTTP proxy port.void
setHttpsPort(int httpsPort)
Setter for the port of the HTTPS server/listener.void
setHttpsProxyHost(java.lang.String httpsProxyHost)
Setter for the HTTPS proxy host.void
setHttpsProxyPort(int httpsProxyPort)
Setter for the HTTPS proxy port.void
setInstanceNameLong(java.lang.String instanceNameLong)
void
setInstanceNameShort(java.lang.String instanceNameShort)
protected void
setKeystorePasswordForHttpListener(java.lang.String keystorePasswordForHttpListener)
void
setMailSmtpHost(java.lang.String mailSmtpHost)
Setter for the mail SMTP host.void
setMailSmtpLogin(java.lang.String mailSmtpLogin)
Setter for the mail SMTP login.void
setMailSmtpPassword(java.lang.String mailSmtpPassword)
Setter for the SMTP password.void
setMountPath(java.nio.file.Path mountPath)
Setter for the mount path.void
setPublisherString(java.lang.String publisherString)
void
setStaticServerAddress(java.lang.String staticServerAddress)
void
setStaticServerPort(int staticServerPort)
void
setSupportedPrincipals(java.util.List<java.lang.Class<? extends java.security.Principal>> supportedPrincipals)
Setter for the supportedPrincipal
s.void
setUseSSL(boolean useSSL)
void
setUseSSLForHttpListener(boolean useSSLForHttpListener, java.net.URL pathToKeyStore, java.lang.String keystorePassword)
void
setUseSystemProxies(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 EdalConfigurationException
Getter for the database password.- Returns:
- the database password
- Throws:
EdalConfigurationException
- if no database password is defined
-
getDatabaseUsername
public java.lang.String getDatabaseUsername() throws EdalConfigurationException
Getter 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 EdalConfigurationException
Getter for the DataCite password.- Returns:
- the DataCite password.
- Throws:
EdalConfigurationException
- if no DataCite password is defined
-
getDataCitePrefix
public java.lang.String getDataCitePrefix() throws EdalConfigurationException
Getter for the DataCite prefix- Returns:
- the DataCite prefix
- Throws:
EdalConfigurationException
- if no prefix is defined
-
getDataCiteUser
public java.lang.String getDataCiteUser() throws EdalConfigurationException
Getter 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 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
-
getHttpPort
public int getHttpPort() throws EdalConfigurationException
Getter 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 EdalConfigurationException
Getter for the HTTP proxy host.- Returns:
- the HTTP proxy host.
- Throws:
EdalConfigurationException
- if no HTTP proxy host is defined
-
getHttpProxyPort
public int getHttpProxyPort() throws EdalConfigurationException
Getter for the HTTP proxy port.- Returns:
- the HTTP proxy port.
- Throws:
EdalConfigurationException
- if no HTTP proxy port is defined
-
getHttpsPort
public int getHttpsPort() throws EdalConfigurationException
Getter 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 EdalConfigurationException
Getter for the HTTPS proxy host.- Returns:
- the HTTPS proxy host.
- Throws:
EdalConfigurationException
- if no HTTPS proxy host is defined
-
getHttpsProxyPort
public int getHttpsProxyPort() throws EdalConfigurationException
Getter 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 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 supportedPrincipal
s.- Returns:
- the List of supported
Principal
s - 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 supportedPrincipal
s.- Parameters:
supportedPrincipals
- the supportedPrincipal
s 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
- thePath
to 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)
-
-