|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.adventnet.adaptors.AbstractAdaptor
|
+--com.adventnet.adaptors.http.HttpConnector
This class acts as a Connector for HTTP access to mbeans in Multi-Protocol.
It itself acts as a mbean for exposing the http properties. This class extends the AbstractAdaptor which provides the implementation of ServiceInfo interface and acts as the http-server.
The port number of the service can be specified in the ObjectName with key-value pair as, port=8050(by default)
For example, to start the web-server at 8200, you can specify the following object name:
| Inner classes inherited from class com.adventnet.adaptors.AbstractAdaptor |
AbstractAdaptor.ProcessNotification |
| Field Summary | |
static HttpAuthTable |
httpAuth
|
(package private) static java.lang.String |
parentDir
|
| Fields inherited from class com.adventnet.adaptors.AbstractAdaptor |
handleNotificationinNewThread,
notifications,
port,
processnotification,
state |
| Constructor Summary | |
HttpConnector()
The NoArg constructor used to initialize the HttpAdaptor in forming the MBeanInfo and getting the reference of the MBeanServer using the MBeanServerFactory.findMBeanServer(null) method. |
|
HttpConnector(int portNum)
|
|
HttpConnector(java.lang.Integer portNum)
|
|
HttpConnector(java.lang.Integer portNum,
MBeanServer MBServer)
This constructor used to initialize the HttpAdaptor in forming the MBeanInfo and getting the reference of the MBeanServer using the input parameter portNum and MBServer. |
|
| Method Summary | |
void |
addHttpServerInterface(HttpServerInterface httpServerInterface)
Adds HttpServerInterface for controlling WebServer. |
static boolean |
authenticate(com.adventnet.agent.security.UserContext userContext)
Deprecated |
void |
bind()
Must be used to bind to a naming service or to bind to a ServerSocket |
void |
destroyAdaptor()
Kills the adaptor and releases all its resources |
void |
enableAuthentication(boolean authFlag)
enables the authentication feature of the adaptor. |
void |
enableAuthorisation(boolean authFlag)
enables the authorisation feature of the adaptor. |
ObjectName |
getAdaptorObjectName()
Returns the ObjectName of this adaptor with which it has been registered with the MBeanServer. |
java.lang.String |
getAdaptorVersion()
Gets the version of the adaptor. |
java.lang.Object |
getAttribute(java.lang.String attribute)
Gets the value of a specific attribute of this MBean. |
AttributeList |
getAttributes(java.lang.String[] attributes)
Gets the value of a all attributes of this MBean. |
MBeanInfo |
getMBeanInfo()
This method discovers the attributes and operations this MBean exposes for management. |
static MBeanServer |
getMBeanServer()
|
java.lang.String |
getObjectName()
Returns the ObjectName of this adaptor with which it has been registered with the MBeanServer. |
static java.lang.String |
getParentDirectory()
Gets the parent directory for this adaptor |
java.lang.String |
getProtocol()
Gets the protocol supported by this adaptor. |
void |
instantiateAdaptor()
Must be implemented by the adaptor and should be used to instantiate itsefl |
java.lang.Object |
invoke(java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
Invokes an action on this MBean. |
static boolean |
isAuthenticated()
Deprecated |
static boolean |
isAuthorised()
Deprecated |
void |
postDeregister()
Allows this MBean to perform any operations needed after having been de-registered in the MBeanServer. |
void |
postRegister(java.lang.Boolean registrationDone)
Allows this MBean to perform any operations needed after having been registered in the MBeanServer or after the registration has failed. |
void |
preDeregister()
Allows this MBean to perform any operations it needs before being de-registered by the MBeanServer. |
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
This method is an implementation of MBeanRegistration interface. |
void |
processClientRequests()
|
void |
registerAuthentication()
|
void |
restartHttpServer()
Restarts the WebServer. |
void |
run()
Getter for MBean server. |
void |
setAttribute(Attribute attribute)
Sets the value of a specific attribute of this MBean. |
AttributeList |
setAttributes(AttributeList attributes)
Sets the values of several attributes of this MBean. |
static void |
setParentDir(java.lang.String dirName)
|
void |
startHttpServer()
Invoke the HTTP server in a thread. |
void |
startService()
Allows the web-server to get started. |
void |
stopHttpServer()
Method to stop the http server. |
void |
stopService()
Allows the web-server to get stopped. |
void |
unbind()
Must be used to unbind from a naming service or to relese a ServerSocket |
| Methods inherited from class com.adventnet.adaptors.AbstractAdaptor |
addNotificationListener,
changeState,
getHost,
getNotificationInfo,
getPort,
getState,
getStateInString,
handleNotification,
isActive,
isSecure,
processNotification,
removeNotificationListener,
setPort |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static HttpAuthTable httpAuth
static java.lang.String parentDir
| Constructor Detail |
public HttpConnector()
public HttpConnector(int portNum)
public HttpConnector(java.lang.Integer portNum)
public HttpConnector(java.lang.Integer portNum,
MBeanServer MBServer)
| Method Detail |
public static boolean authenticate(com.adventnet.agent.security.UserContext userContext)
public static boolean isAuthenticated()
public static boolean isAuthorised()
public MBeanInfo getMBeanInfo()
public java.lang.Object getAttribute(java.lang.String attribute)
throws AttributeNotFoundException,
MBeanException,
ReflectionException
attribute - A String specifying the name of the
attribute to be retrieved.public AttributeList getAttributes(java.lang.String[] attributes)
attributes - A list of attributes to be retrieved.
public java.lang.Object invoke(java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
throws MBeanException,
ReflectionException
actionName - The name of the action to be invoked.params - An array containing the parameters to be
set when the action is invokedsignature - An array containing the signature of
the action. The class objects will be loaded using the
same class loader as the one used for loading the MBean
on which the action was invoked.public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
attribute - The identification of the attribute to
be set and the value it is to be set to.public AttributeList setAttributes(AttributeList attributes)
attributes - A list of attributes: The identification
of the attributes to be set and the values they are to be set to.public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception
This method is called by the MBeanServer before this mbean getting registered with the server. If the passed objectName is invalid, the returned objectName is taken as valid name to get registered with the server.
The service gets actually started only inside this method at the specified port mentioned in the key "port". If the key "port" is absent, then the service(http - server) gets started at the default port 8050.
server - The MBeanServer in which the MBean will be registered.name - The object name of the MBean.public void postRegister(java.lang.Boolean registrationDone)
registrationDone - Indicates whether or not the MBean has been successfully
registered in the MBeanServer. The value false means that either the registration phase
has failed.
public void preDeregister()
throws java.lang.Exception
public void postDeregister()
public void startService()
throws java.lang.IllegalStateException,
java.lang.Exception
public void stopService()
throws java.lang.IllegalStateException
public void enableAuthentication(boolean authFlag)
public void enableAuthorisation(boolean authFlag)
public void processClientRequests()
public void instantiateAdaptor()
throws java.lang.InstantiationException
public void bind()
public void unbind()
public void registerAuthentication()
public void destroyAdaptor()
public ObjectName getAdaptorObjectName()
public java.lang.String getObjectName()
public void run()
public void startHttpServer()
throws java.lang.Exception
public void stopHttpServer()
public void restartHttpServer()
public java.lang.String getAdaptorVersion()
public java.lang.String getProtocol()
public void addHttpServerInterface(HttpServerInterface httpServerInterface)
httpServerInterface - The HttpServerInterface of the user.public static void setParentDir(java.lang.String dirName)
public static java.lang.String getParentDirectory()
public static MBeanServer getMBeanServer()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||