XMOJO 5 API Docs

com.adventnet.adaptors.html
Class JettyHtmlServer

java.lang.Object
  |
  +--com.adventnet.adaptors.html.JettyHtmlServer
All Implemented Interfaces:
HttpServerInterface

public class JettyHtmlServer
extends java.lang.Object
implements HttpServerInterface

This class plugs in the Jetty WebServer to the HtmlAdaptor.

See Also:
HttpServerInterface

Constructor Summary
JettyHtmlServer()
          Primary constructor for the HttpServerImpl without any configuration options.
JettyHtmlServer(int port, boolean authentication)
          Secondary constructor with configuration options.
JettyHtmlServer(int port, boolean authentication, boolean sslSupport)
          Constructor with configuration options.
JettyHtmlServer(int port, boolean authentication, boolean sslSupport, boolean isJarFile)
          Constructor with configuration options.
 
Method Summary
 void addUser(java.lang.String userName, java.lang.String passwd)
          This method adds a new User with the userName and password to the Authentication of the WebServer.
 java.lang.String getConfigFileName()
          Getter for the configFileName.
 java.lang.String getConfigJarFile()
          Setter for the configuration file Name which will be inside the jar containing this class.
 java.lang.Integer getPort()
          Returns the port number in which the http server gets started.
 boolean isAuthentication()
          To know whether the authentication is enabled in the WebServer.
 boolean isSslSupport()
          To know whether the SSL Support is enabled in the WebServer.
 void restartHttpServer()
          Restarts the WebServer.
 void setAuthentication(boolean auth)
          Setter for enabling and disabling Authentication of the WebServer.
 void setConfigFileName(java.lang.String configFileName)
          Setter for the configuration file Name with location.
 void setConfigJarFile(java.lang.String jarConfig)
          Setter for the configuration file Name which will be inside the jar containing this class.
 void setPort(int port)
          Sets the port number in which the http server to get started.
 void setPort(java.lang.Integer port)
          Sets the port number in which the http server to get started.
 void setSslSupport(boolean sslSupport)
          Setter for enabling and disabling SSL Support of the WebServer.
 void startHttpServer()
          Starts the HttpServer - Jetty WebServer.
 void stopHttpServer()
          Stops the WebServer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JettyHtmlServer

public JettyHtmlServer()
Primary constructor for the HttpServerImpl without any configuration options.

JettyHtmlServer

public JettyHtmlServer(int port,
                       boolean authentication)
Secondary constructor with configuration options. Note: For this version, authentication is disabled and hence will not have any effect by setting authentication to true.
Parameters:
port - The port to start the WebServer
authentication - The boolean flag to turn ON/OFF Authentication of the Requests. Default is false.

JettyHtmlServer

public JettyHtmlServer(int port,
                       boolean authentication,
                       boolean sslSupport)
Constructor with configuration options. Note: For this version, authentication and SSL support are disabled and hence will not have any effect by setting true to those parameters.
Parameters:
port - The port to start the WebServer
authentication - The boolean flag to turn ON/OFF Authentication of the Requests. Default is false.
sslSupport - The boolean flag to turn ON/OFF SSL Support. Default is false.

JettyHtmlServer

public JettyHtmlServer(int port,
                       boolean authentication,
                       boolean sslSupport,
                       boolean isJarFile)
Constructor with configuration options. Note: For this version, authentication and SSL support are disabled and hence will not have any effect by setting true to those parameters.
Parameters:
port - The port to start the WebServer
authentication - The boolean flag to turn ON/OFF Authentication of the Requests. Default is false.
sslSupport - The boolean flag to turn ON/OFF SSL Support. Default is false.
isJarFile - Boolean flag to indicate configuration files taken from Jar.
Method Detail

setConfigFileName

public void setConfigFileName(java.lang.String configFileName)
Setter for the configuration file Name with location.
Specified by:
setConfigFileName in interface HttpServerInterface
Parameters:
configFileName - The configuration file name with path.

getConfigFileName

public java.lang.String getConfigFileName()
Getter for the configFileName.
Specified by:
getConfigFileName in interface HttpServerInterface
Returns:
The configuration file Name by which the Server is running.

setConfigJarFile

public void setConfigJarFile(java.lang.String jarConfig)
Setter for the configuration file Name which will be inside the jar containing this class.
Parameters:
jarConfig - The configuration file name with path as in the jar File.

getConfigJarFile

public java.lang.String getConfigJarFile()
Setter for the configuration file Name which will be inside the jar containing this class.
Returns:
The configuration file name by which the Server is running with path as in the jar File.

getPort

public java.lang.Integer getPort()
Returns the port number in which the http server gets started.
Returns:
the port number.
See Also:
setPort(Integer port)

setPort

public void setPort(java.lang.Integer port)
             throws java.lang.Exception
Sets the port number in which the http server to get started.
Parameters:
the - port number of the http web-server.
See Also:
getPort()

setPort

public void setPort(int port)
Sets the port number in which the http server to get started.
Specified by:
setPort in interface HttpServerInterface
Parameters:
the - port number of the http web-server.
See Also:
getPort()

setAuthentication

public void setAuthentication(boolean auth)
Setter for enabling and disabling Authentication of the WebServer. Note: For this version, this is disabled and hence will not have any effect by calling this method.
Parameters:
auth - The flag for turning ON/OFF the authentication of WebServer.

isAuthentication

public boolean isAuthentication()
To know whether the authentication is enabled in the WebServer. Note: For this version, this is disabled and hence will always return false.
Returns:
true if the authentication of the WebServer is turned ON else false.

addUser

public void addUser(java.lang.String userName,
                    java.lang.String passwd)
This method adds a new User with the userName and password to the Authentication of the WebServer. Note: For this version, this is disabled and hence will not have any effect by calling this method.
Parameters:
userName - The user name to be added.
password - The password for the user.

setSslSupport

public void setSslSupport(boolean sslSupport)
Setter for enabling and disabling SSL Support of the WebServer. Note: For this version, this is disabled and hence will not have any effect by calling this method.
Parameters:
sslSupport - The flag for turning ON/OFF the SSL Support of WebServer.

isSslSupport

public boolean isSslSupport()
To know whether the SSL Support is enabled in the WebServer. Note: For this version, this is disabled and hence will always return false.
Returns:
true if the SSL Support of the WebServer is turned ON else false.

startHttpServer

public void startHttpServer()
                     throws java.lang.Exception
Starts the HttpServer - Jetty WebServer.
Specified by:
startHttpServer in interface HttpServerInterface
Throws:
java.lang.Exception - on error while starting WebServer.
See Also:
stopHttpServer()

stopHttpServer

public void stopHttpServer()
                    throws java.lang.Exception
Stops the WebServer.
Specified by:
stopHttpServer in interface HttpServerInterface
Throws:
java.lang.Exception - on error while stopping WebServer.

restartHttpServer

public void restartHttpServer()
                       throws java.lang.Exception
Restarts the WebServer.
Specified by:
restartHttpServer in interface HttpServerInterface
Throws:
java.lang.Exception - while error trying to restart the WebServer

XMOJO 5 API Docs

Copyright ©2003 XMOJO.org. All Rights Reserved.