org.apache.felix.mosgi.jmx.httpconnector.mx4j.tools.adaptor.http
Interface HttpAdaptorMBean

All Known Implementing Classes:
HttpAdaptor

public interface HttpAdaptorMBean

Management interface for the HttpAdaptor MBean.

Version:
$Revision: 1.1.1.1 $
Author:
Carlos Quiroz

Method Summary
 void addAuthorization(String username, String password)
          Adds an authorization pair as username/password
 void addCommandProcessor(String path, HttpCommandProcessor processor)
          Adds a command processor object
 void addCommandProcessor(String path, String processorClass)
          Adds a command processor object by class
 String getAuthenticationMethod()
          Authentication Method
 String getHost()
          Return the host name the server will be listening to.
 int getPort()
          Returns the port where the server is running on.
 ProcessorMBean getProcessor()
          Returns the Processor set by setProcessor(org.apache.felix.mosgi.jmx.httpconnector.mx4j.tools.adaptor.http.ProcessorMBean)
 ObjectName getProcessorName()
          Returns the ObjectName of the processor set by setProcessorName(javax.management.ObjectName)
 long getRequestsCount()
          Requests count
 Date getStartDate()
          Starting date
 String getVersion()
          Gets the HttpAdaptor version
 boolean isActive()
          Indicates whether the server's running
 void removeCommandProcessor(String path)
          Removes a command processor object by class
 void setAuthenticationMethod(String method)
          Sets the Authentication Method.
 void setHost(String host)
          Sets the host name where the server will be listening
 void setPort(int port)
          Sets the value of the server's port
 void setProcessor(ProcessorMBean processor)
          Sets the object which will post process the XML results.
 void setProcessorClass(String processorClass)
          Sets the classname of the object which will post process the XML results.
 void setProcessorName(ObjectName processorName)
          Sets the object name which will post process the XML result.
 void setProcessorNameString(String processorName)
          Sets the object name of the PostProcessor MBean.
 void setSocketFactory(AdaptorServerSocketFactory factory)
          Sets the object which create the server sockets
 void setSocketFactoryName(ObjectName factoryName)
          Sets the factory's object name which will create the server sockets
 void setSocketFactoryNameString(String factoryName)
          Sets the factory's object name which will create the server sockets
 void start()
          Starts the server
 void stop()
          Stops the HTTP daemon
 

Method Detail

setPort

void setPort(int port)
Sets the value of the server's port

Parameters:
port - the new port's value

getPort

int getPort()
Returns the port where the server is running on. Default is 8080

Returns:
HTTPServer's port

setHost

void setHost(String host)
Sets the host name where the server will be listening

Parameters:
host - Server's host

getHost

String getHost()
Return the host name the server will be listening to. If null the server listen at the localhost

Returns:
the current hostname

setAuthenticationMethod

void setAuthenticationMethod(String method)
Sets the Authentication Method.

Parameters:
method - none/basic/digest

getAuthenticationMethod

String getAuthenticationMethod()
Authentication Method

Returns:
authentication method

setProcessor

void setProcessor(ProcessorMBean processor)
Sets the object which will post process the XML results. The last value set between the setPostProcessor and setPostProcessorName will be the valid one

Parameters:
processor - a Post processor object

getProcessor

ProcessorMBean getProcessor()
Returns the Processor set by setProcessor(org.apache.felix.mosgi.jmx.httpconnector.mx4j.tools.adaptor.http.ProcessorMBean)


setProcessorClass

void setProcessorClass(String processorClass)
Sets the classname of the object which will post process the XML results. The adaptor will try to build the object and use the processor name ObjectName to register it. The class name has to implements mx4j.tools.adaptor.http.ProcessorMBean and be MBean compliant

Parameters:
processorClass - a Post processor object

setProcessorNameString

void setProcessorNameString(String processorName)
                            throws MalformedObjectNameException
Sets the object name of the PostProcessor MBean. If ProcessorClass is set the processor will be created

Parameters:
processorName - a Post processor object
Throws:
MalformedObjectNameException

setProcessorName

void setProcessorName(ObjectName processorName)
Sets the object name which will post process the XML result. The last value set between the setPostProcessor and setPostProcessorName will be the valid one. The MBean will be verified to be of instance HttpPostProcessor

Parameters:
processorName - The new processorName value

getProcessorName

ObjectName getProcessorName()
Returns the ObjectName of the processor set by setProcessorName(javax.management.ObjectName)


setSocketFactory

void setSocketFactory(AdaptorServerSocketFactory factory)
Sets the object which create the server sockets

Parameters:
factory - the socket factory

setSocketFactoryName

void setSocketFactoryName(ObjectName factoryName)
Sets the factory's object name which will create the server sockets

Parameters:
factoryName - the socket factory

setSocketFactoryNameString

void setSocketFactoryNameString(String factoryName)
                                throws MalformedObjectNameException
Sets the factory's object name which will create the server sockets

Parameters:
factoryName - the socket factory
Throws:
MalformedObjectNameException

isActive

boolean isActive()
Indicates whether the server's running

Returns:
The active value

getStartDate

Date getStartDate()
Starting date

Returns:
The date when the server was started

getRequestsCount

long getRequestsCount()
Requests count

Returns:
The total of requests served so far

getVersion

String getVersion()
Gets the HttpAdaptor version

Returns:
HttpAdaptor's version

addCommandProcessor

void addCommandProcessor(String path,
                         HttpCommandProcessor processor)
Adds a command processor object


addCommandProcessor

void addCommandProcessor(String path,
                         String processorClass)
Adds a command processor object by class


removeCommandProcessor

void removeCommandProcessor(String path)
Removes a command processor object by class


start

void start()
           throws IOException
Starts the server

Throws:
IOException

stop

void stop()
Stops the HTTP daemon


addAuthorization

void addAuthorization(String username,
                      String password)
Adds an authorization pair as username/password



Copyright © 2011 Apache Software Foundation. All Rights Reserved.