public class HttpServerConfig extends Object
| Constructor and Description |
|---|
HttpServerConfig() |
| Modifier and Type | Method and Description |
|---|---|
InetSocketAddress |
createInetSocketAddress()
Creates the InetSocketAddress to be user by the server.
|
SSLContext |
createSSLContext()
Creates a new SSLContext from the parameters of this configuration, that
can be use for the SSL codec of the HTTP server.
|
String |
getKeyStoreAlgo()
The algorithm for the KeyManagerFactory.
|
String |
getKeyStoreFile()
The file that holds the key store for the SSLContext.
|
String |
getKeyStorePass()
The password for the key store file.
|
String |
getKeyStoreType()
The KeyStore type to create for the SSLContext.
|
String |
getListen()
The listen IP on witch to start the HTTP server, can be null witch means
all IPs will be allowed.
|
String |
getName()
The HTTP server name, by default it will be "Bridje HTTP Server" but you
can change that setting this property.
|
int |
getPort()
The port on witch the HTTP server will listen for new connections.
|
String |
getSslAlgo()
The algorithm to use to create the SSLContext.
|
boolean |
isSsl()
Gets if the server must run with SSL connector for HTTPs, if this
parameter is true, the SSL parameters must be configure properly for the
server to start.
|
static HttpServerConfig |
load(VFile xmlFile)
Loads a HttpServerConfig from a file.
|
static void |
save(OutputStream os,
HttpServerConfig object)
Save a SipServerConfig to an output stream.
|
void |
setKeyStoreAlgo(String keyStoreAlgo)
The algorithm for the KeyManagerFactory.
|
void |
setKeyStoreFile(String keyStoreFile)
The file that holds the key store for the SSLContext.
|
void |
setKeyStorePass(String keyStorePass)
The password for the key store file.
|
void |
setKeyStoreType(String keyStoreType)
The KeyStore type to create for the SSLContext.
|
void |
setListen(String listen)
The host on witch to start the HTTP server, can be null witch means all
IPs will be allowed.
|
void |
setName(String name)
The HTTP server name, by default it will be "Bridje HTTP Server" but you
can change that setting this property.
|
void |
setPort(int port)
The port on witch the HTTP server will listen for new connections.
|
void |
setSsl(boolean ssl)
Gets if the server must run with SSL connector for HTTPs, if this
parameter is true, the SSL parameters must be configure properly for the
server to start.
|
void |
setSslAlgo(String sslAlgo)
The algorithm to use to create the SSLContext.
|
public String getListen()
public void setListen(String listen)
listen - The host for the HTTP server.public String getName()
public void setName(String name)
name - The name of the HTTP server.public int getPort()
public void setPort(int port)
port - The HTTP server portpublic boolean isSsl()
public void setSsl(boolean ssl)
ssl - true SSL is enabled, false SSL is disabled.public String getSslAlgo()
public void setSslAlgo(String sslAlgo)
sslAlgo - The algorithm that will be use to create the SSLContext.public String getKeyStoreFile()
public void setKeyStoreFile(String keyStoreFile)
keyStoreFile - An String with the path relative to the current
folder for the key store file.public String getKeyStorePass()
public void setKeyStorePass(String keyStorePass)
keyStorePass - The password for the key store file.public String getKeyStoreType()
public void setKeyStoreType(String keyStoreType)
keyStoreType - The KeyStore type to create for the SSLContext.public String getKeyStoreAlgo()
public void setKeyStoreAlgo(String keyStoreAlgo)
keyStoreAlgo - The algorithm for the KeyManagerFactory.public InetSocketAddress createInetSocketAddress()
public SSLContext createSSLContext() throws NoSuchAlgorithmException, KeyStoreException, IOException, UnrecoverableKeyException, CertificateException, KeyManagementException
NoSuchAlgorithmException - If a wrong algorithm is
provided.KeyStoreException - If any error occurs with the KeyStore.IOException - If the key store file is not found or cannot be read.UnrecoverableKeyException - This exception is thrown if a key in the key store cannot be recovered.CertificateException - This exception indicates one of a variety of certificate problems.KeyManagementException - This is the general key management exception for all operations dealing with key management.public static HttpServerConfig load(VFile xmlFile) throws JAXBException, IOException
xmlFile - The file to load the object from.JAXBException - If any JAXB Exception occurs.IOException - If any IO Exception occurs.public static void save(OutputStream os, HttpServerConfig object) throws JAXBException
os - The output stream to write the object to.object - The object to write.JAXBException - If any JAXB Exception occurs.Copyright © 2015–2017 Bridje Framework. All rights reserved.