@ConfigurationProperties(prefix="server", ignoreUnknownFields=false) public class ServerProperties extends Object implements InitializingBean
Configuration properties for configuring the archive server. These properties
define settings that may be different for different servers. This object is
injected with properties having the server.*
prefix.
The server.uuid
property allows setting various options that are
only desirable during development (e.g. turning off caches) in a single
place.
Instances of this class are safe for concurrent read access but are not safe for concurrent write access. Typically, this should not be a problem because an instance of this class is initialized once at application startup and then only used for read access.
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger
Logger for this class.
|
Constructor and Description |
---|
ServerProperties() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
int |
getAdminPort()
Returns the TCP port number on which the web server for the
administrative interface listens.
|
int |
getArchiveAccessPort()
Returns the TCP port number on which the web server for the access to the
archive listens.
|
int |
getInterNodeCommunicationPort()
Returns the TCP port number on which the web server for the inter-node
communication listens.
|
InetAddress |
getListenAddress()
Returns the address on which the server is supposed to listen.
|
UUID |
getUuid()
Returns the UUID identifying this server or
null if the UUID
has not been set. |
File |
getUuidFile()
Returns the file from which the current UUID has been read or
null if the current UUID has not been read from a file. |
void |
setAdminPort(int adminPort)
Sets the TCP port number on which the web server for the administrative
interface listens.
|
void |
setArchiveAccessPort(int archiveAccessPort)
Sets the TCP port number on which the web server for the access to the
archive listens.
|
void |
setInterNodeCommunicationPort(int interNodeCommunicationPort)
Sets the TCP port number on which the web server for the inter-node
communication listens.
|
void |
setListenAddress(String listenAddress)
Sets the address on which the server is supposed to listen.
|
void |
setUuid(String uuid)
Sets the UUID identifying this server.
|
void |
setUuidFile(File uuidFile)
Sets the current UUID by reading it from a file.
|
protected final org.apache.commons.logging.Log logger
public InetAddress getListenAddress()
InetAddress.getLocalHost()
. If that method returns a loop-back
address, the first non-loop-back address found on any interface is used.
If the first interface with valid addresses has both an IPv4 and an IPv6
address, the IPv4 address is preferred.null
).public void setListenAddress(String listenAddress) throws IllegalArgumentException
InetAddress.getLocalHost()
. If that method returns a loop-back
address, the first non-loop-back address found on any interface is used.
If the first interface with valid addresses has both an IPv4 and an IPv6
address, the IPv4 address is preferred.listenAddress
- address on which the server is supposed to listen. May be
specified in the form of a numeric address or a resolvable
host-name. This should not be a loop-back address because
other servers will try to contact this server on this address.
If null
or the empty string, the listen address
is going to be determined automatically.IllegalArgumentException
- if the specified listenAddress
is neither
null
nor an empty string but cannot be converted
to an InetAddress
.public int getAdminPort()
public void setAdminPort(int adminPort)
adminPort
- TCP port number for the administrative interface.IllegalArgumentException
- if the specified number is not a valid TCP port number.public int getArchiveAccessPort()
public void setArchiveAccessPort(int archiveAccessPort)
archiveAccessPort
- TCP port number for the archive-access interface.IllegalArgumentException
- if the specified number is not a valid TCP port number.public int getInterNodeCommunicationPort()
public void setInterNodeCommunicationPort(int interNodeCommunicationPort)
interNodeCommunicationPort
- TCP port number for the inter-node communication interface.IllegalArgumentException
- if the specified number is not a valid TCP port number.public UUID getUuid()
null
if the UUID
has not been set. The UUID must be set in order for a server to operate
correctly and must be unique within the whole cluster.null
if the UUID has
not been set.setUuid(String)
,
setUuidFile(File)
public void setUuid(String uuid)
setUuid(String)
or setUuidFile(File)
. If the specified string does not represent a valid UUID, the UUID is
set to null
.uuid
- string representing the UUID to be set (may be
null
).setUuidFile(File)
public File getUuidFile()
null
if the current UUID has not been read from a file.null
if the current UUID has not been read from a
file.public void setUuidFile(File uuidFile)
uuidFile
- file from which the UUID shall be read.public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
Copyright © 2011–2017 aquenos GmbH. All rights reserved.