com.adventnet.adaptors.http
Class HttpConnectorServerImpl

java.lang.Object
  |
  +--com.adventnet.adaptors.http.HttpConnectorServerImpl

public class HttpConnectorServerImpl
extends java.lang.Object
implements HttpServerInterface

This class plugs in the Tomcat WebServer to the HTTP Connector.

Since:
AdventNet Agent Toolkit (Java Edition) 4.2 release.
See Also:
HttpServerInterface

Constructor Summary
HttpConnectorServerImpl()
           
HttpConnectorServerImpl(int port, MBeanServer server)
          constructor with Port and MBeanServer configuration options.
HttpConnectorServerImpl(int port, MBeanServer server, boolean sslSupport)
          constructor with the given port, MBean server and SSL support.
HttpConnectorServerImpl(int port, MBeanServer server, boolean sslSupport, boolean isJarFile)
          Constructor with the given port, MBean server, SSL support and configuraton file taken from jar or not.
 
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.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 setPort(int port)
          set the port of the WebServer.
 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 - Tomcat 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

HttpConnectorServerImpl

public HttpConnectorServerImpl()

HttpConnectorServerImpl

public HttpConnectorServerImpl(int port,
                               MBeanServer server)
constructor with Port and MBeanServer configuration options.
Parameters:
port - The port of the HTTP Server - Tomcat WebServer.
server - The MBeanserver.

HttpConnectorServerImpl

public HttpConnectorServerImpl(int port,
                               MBeanServer server,
                               boolean sslSupport)
constructor with the given port, MBean server and SSL support.
Parameters:
port - The port to start the HTTP Server.
server - The MBeanServer.
sslSupport - The boolean flag to turn ON/OFF SSL Support

HttpConnectorServerImpl

public HttpConnectorServerImpl(int port,
                               MBeanServer server,
                               boolean sslSupport,
                               boolean isJarFile)
Constructor with the given port, MBean server, SSL support and configuraton file taken from jar or not.
Parameters:
port - The port to start the HTTP Server.
server - The MBeanServer.
sslSupport - The boolean flag to turn ON/OFF SSL Support
isJarFile - Boolean flag to indicate SSL configuration file 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.

getPort

public java.lang.Integer getPort()
Returns the port number in which the http server gets started.
Returns:
the port number.
See Also:
setPort(int 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()

setAuthentication

public void setAuthentication(boolean auth)
Setter for enabling and disabling Authentication of the WebServer.
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.
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.
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.
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.
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 - Tomcat 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.
See Also:
startHttpServer()

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
See Also:
startHttpServer()

setPort

public void setPort(int port)
set the port of the WebServer.
Specified by:
setPort in interface HttpServerInterface
Throws:
java.lang.Exception - while error trying to restart the WebServer