Package ome.system
Class Server
- java.lang.Object
-
- ome.system.Server
-
public class Server extends java.lang.Object
Provides simplified handling of server properties when creating aServiceFactory
. For more complicated uses,Properties
can also be used. In which case, the constantstrings
provided in this class can be used as the keys to theproperties instance
passed toServiceFactory(Properties)
.- Since:
- 1.0
- See Also:
ServiceFactory
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PORT
static java.lang.String
OMERO_HOST
Java property name for use in configuration of the client connection.static java.lang.String
OMERO_PORT
Java property name for use in configuration of the client connection.
-
Constructor Summary
Constructors Constructor Description Server(java.lang.String serverHost)
standard constructor which usersDEFAULT_PORT
.Server(java.lang.String serverHost, int port)
extended constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Properties
asProperties()
produces a copy of the internal fields as aProperties
instance.java.lang.String
getHost()
simple getter for the server host passed into the constructorint
getPort()
simple getter for the port passed into the constructor or the default port if none.
-
-
-
Field Detail
-
OMERO_HOST
public static final java.lang.String OMERO_HOST
Java property name for use in configuration of the client connection.- See Also:
- Constant Field Values
-
OMERO_PORT
public static final java.lang.String OMERO_PORT
Java property name for use in configuration of the client connection.- See Also:
- Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Server
public Server(java.lang.String serverHost)
standard constructor which usersDEFAULT_PORT
.- Parameters:
serverHost
- Not null.
-
Server
public Server(java.lang.String serverHost, int port)
extended constructor. As withServer(String)
, serverHost may not be null.- Parameters:
serverHost
- Not null.port
-
-
-
Method Detail
-
asProperties
public java.util.Properties asProperties()
produces a copy of the internal fields as aProperties
instance. Only those keys are present for which a field is non-null.- Returns:
- Properties. Not null.
-
getHost
public java.lang.String getHost()
simple getter for the server host passed into the constructor- Returns:
- host name Not null.
-
getPort
public int getPort()
simple getter for the port passed into the constructor or the default port if none.
-
-