Class ServerAddressHolder
java.lang.Object
de.iip_ecosphere.platform.support.iip_aas.config.ServerAddressHolder
- Direct Known Subclasses:
NetworkManagerAas.ManagedServerAddressHolder,TlsServerAddressHolder
A proxy for
ServerAddress as we do not want to have setters there.- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance (deserialization).Creates an instance by copying data from a given instance.ServerAddressHolder(de.iip_ecosphere.platform.support.Schema schema, String host, int port) Creates an instance.ServerAddressHolder(de.iip_ecosphere.platform.support.ServerAddress addr) Creates an instance from a given instance (serialization). -
Method Summary
Modifier and TypeMethodDescriptiongetHost()Returns the host value.intgetPort()Returns the port value.de.iip_ecosphere.platform.support.SchemaReturns the schema value.de.iip_ecosphere.platform.support.ServerAddressReturns a server address instance constructed from the data in this instance.booleanReturns whether the port is set to be determined dynamically.booleanReturns whether the server is already running and shall not be started.static de.iip_ecosphere.platform.support.ServerAddressserverAddressFromJson(Object json) Reads aServerAddressfrom a JSON string.voidDefines thehostvalue.voidsetPort(int port) Defines theportvalue.voidsetRunning(boolean running) Changes whether the server is already running.voidsetSchema(de.iip_ecosphere.platform.support.Schema schema) Defines theschemavalue.static StringtoJson(de.iip_ecosphere.platform.support.ServerAddress address) Turns aServerAddressinto JSON.
-
Field Details
-
MAPPER
private static final de.iip_ecosphere.platform.support.json.Json MAPPER -
port
private int port -
host
-
schema
private de.iip_ecosphere.platform.support.Schema schema -
running
private boolean running
-
-
Constructor Details
-
ServerAddressHolder
public ServerAddressHolder()Creates an instance (deserialization). -
ServerAddressHolder
Creates an instance.- Parameters:
schema- the schemahost- the host nameport- the port
-
ServerAddressHolder
public ServerAddressHolder(de.iip_ecosphere.platform.support.ServerAddress addr) Creates an instance from a given instance (serialization).- Parameters:
addr- the instance to take data from
-
ServerAddressHolder
Creates an instance by copying data from a given instance.- Parameters:
holder- the holder to copy from
-
-
Method Details
-
getPort
public int getPort()Returns the port value.- Returns:
- the port (may be negative, indicates ephemerial)
-
setPort
public void setPort(int port) Defines theportvalue. [required by data mapper]- Parameters:
port- the new value ofport(may be negative, indicates ephemerial)
-
getHost
Returns the host value.- Returns:
- the host
-
isEphmemeral
public boolean isEphmemeral()Returns whether the port is set to be determined dynamically.- Returns:
truefor ephemeral,falseelse
-
setHost
Defines thehostvalue. [required by data mapper]- Parameters:
host- the new value ofhost
-
getSchema
public de.iip_ecosphere.platform.support.Schema getSchema()Returns the schema value.- Returns:
- the schema
-
setSchema
public void setSchema(de.iip_ecosphere.platform.support.Schema schema) Defines theschemavalue. [required by data mapper]- Parameters:
schema- the new value ofschema
-
isRunning
public boolean isRunning()Returns whether the server is already running and shall not be started.- Returns:
- whether we can assume that it is already running
-
setRunning
public void setRunning(boolean running) Changes whether the server is already running. [snakeyaml]- Parameters:
running- whether we can assume that it is already running
-
getServerAddress
public de.iip_ecosphere.platform.support.ServerAddress getServerAddress()Returns a server address instance constructed from the data in this instance.- Returns:
- the server address
-
serverAddressFromJson
Reads aServerAddressfrom a JSON string.- Parameters:
json- the JSON value, usually a String- Returns:
- the server address or null if reading fails
- See Also:
-
toJson
Turns aServerAddressinto JSON.- Parameters:
address- the address (may be null)- Returns:
- the JSON string or an empty string in case of problems/no address
- See Also:
-