com.adventnet.adaptors.http
Class HttpRequestHandlerImpl

java.lang.Object
  extended by com.adventnet.adaptors.http.HttpRequestHandlerImpl
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.management.NotificationFilter, javax.management.NotificationListener

public class HttpRequestHandlerImpl
extends java.lang.Object
implements javax.management.NotificationFilter, javax.management.NotificationListener

This class is used to process the received HttpRequest.

The User implementing the HttpServerInterface to plug-in his web-server should call this class's handle method to handle HTTP requests for the agent.

Since:
AdventNet Agent Toolkit (Java Edition) 4.2 release.
See Also:
HttpConnectorServerImpl, Serialized Form

Nested Class Summary
(package private)  class HttpRequestHandlerImpl.ClientProperty
           
 
Field Summary
(package private) static javax.management.ObjectName adaptorName
           
 boolean authenticationEnabled
           
 boolean authorisationEnabled
           
(package private)  java.util.Hashtable clientTable
           
(package private)  boolean enableNotif
           
(package private)  int handback
           
(package private)  java.util.Hashtable mbeanTable
           
 
Constructor Summary
HttpRequestHandlerImpl()
          constructor to process the received HttpRequest.
HttpRequestHandlerImpl(javax.management.MBeanServer server)
          constructor to process the received HttpRequest.
 
Method Summary
 javax.management.MBeanInfo getAccessViewMBeanInfo(javax.management.MBeanInfo mbeanInfo, javax.management.ObjectName name)
           
 java.util.Set getViewAccessMBeans(java.util.Set names)
           
 java.util.Set getViewAccessNames(java.util.Set names)
           
 byte[] handle(byte[] request)
          This method will be called by WebServer's HttpRequestHandler to process the HttpRequest and return the result.
 void handleNotification(javax.management.Notification notification, java.lang.Object handback)
          Invoked when an JMX notification occurs.
 boolean isNotificationEnabled(javax.management.Notification notification)
          Returns true if the notification is enabled.
(package private) static byte[] serialize(java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

adaptorName

static javax.management.ObjectName adaptorName

authorisationEnabled

public boolean authorisationEnabled

authenticationEnabled

public boolean authenticationEnabled

handback

int handback

enableNotif

boolean enableNotif

clientTable

java.util.Hashtable clientTable

mbeanTable

java.util.Hashtable mbeanTable
Constructor Detail

HttpRequestHandlerImpl

public HttpRequestHandlerImpl()
constructor to process the received HttpRequest.


HttpRequestHandlerImpl

public HttpRequestHandlerImpl(javax.management.MBeanServer server)
constructor to process the received HttpRequest.

Parameters:
server - The MBeanServer used to process requests.
Method Detail

handle

public byte[] handle(byte[] request)
              throws java.lang.Exception
This method will be called by WebServer's HttpRequestHandler to process the HttpRequest and return the result.

Parameters:
request - The request stream of bytes.
Returns:
The response stream of bytes.
Throws:
java.lang.Exception - on error while processing request.

getViewAccessMBeans

public java.util.Set getViewAccessMBeans(java.util.Set names)

getViewAccessNames

public java.util.Set getViewAccessNames(java.util.Set names)

getAccessViewMBeanInfo

public javax.management.MBeanInfo getAccessViewMBeanInfo(javax.management.MBeanInfo mbeanInfo,
                                                         javax.management.ObjectName name)

serialize

static byte[] serialize(java.lang.Object obj)

isNotificationEnabled

public boolean isNotificationEnabled(javax.management.Notification notification)
Returns true if the notification is enabled.

Specified by:
isNotificationEnabled in interface javax.management.NotificationFilter
Parameters:
notification - The notification to be sent.
Returns:
True if the notification has to be sent to the listener, false otherwise.

handleNotification

public void handleNotification(javax.management.Notification notification,
                               java.lang.Object handback)
Invoked when an JMX notification occurs.

Specified by:
handleNotification in interface javax.management.NotificationListener
Parameters:
notification - The notification.
handback - An opaque object which helps the listener to associate information regarding the MBean emitter. This object was passed to the MBean during the addListener call and resend, without modification, to the listener. The MBean object should to use or modify the object.