|
XMOJO 5 API Docs | ||||||||
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.html.HtmlAdaptor
This class acts as a JMX adaptor for HTTP access to mbeans.
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 web-server.
For example, to start the web-server at 8050, you can specify the following object name:
Field Summary | |
static com.adventnet.adaptors.html.HtmlAuthTable |
htmlAuth
|
static boolean |
readFromJarFile
Specifies whether read from Jar File is enabled; the default is false. |
Fields inherited from class com.adventnet.adaptors.AbstractAdaptor |
port, state |
Constructor Summary | |
HtmlAdaptor()
The NoArg constructor used to initialize the HtmlAdaptor in forming the MBeanInfo and getting the reference of the MBeanServer using the MBeanServerFactory.findMBeanServer(..) method. |
|
HtmlAdaptor(boolean isJarFile)
This constructor used to initialize the HtmlAdaptor in forming the MBeanInfo and getting the reference of the MBeanServer using the MBeanServerFactory.findMBeanServer(..) method. |
|
HtmlAdaptor(int portNum)
This constructor used to initialize the HtmlAdaptor in forming the MBeanInfo and getting the reference of the MBeanServer using the MBeanServerFactory.findMBeanServer(..) method. |
|
HtmlAdaptor(java.lang.Integer portNum)
|
|
HtmlAdaptor(java.lang.Integer portNum,
MBeanServer MBServer)
This constructor used to initialize the HtmlAdaptor in forming the MBeanInfo and getting the reference of the MBeanServer using the MBeanServerFactory.findMBeanServer(..) method. |
|
HtmlAdaptor(java.lang.Integer portNum,
MBeanServer MBServer,
boolean isJarFile)
This constructor used to initialize the HtmlAdaptor in forming the MBeanInfo and getting the reference of the MBeanServer using the MBeanServerFactory.findMBeanServer(..) method. |
|
HtmlAdaptor(java.lang.String homeDir)
This constructor will be used to initialize the HtmlAdaptor (when the application is started from a different application directory) in forming the MBeanInfo and getting the reference of the MBeanServer using the MBeanServerFactory.findMBeanServer(..) method. |
Method Summary | |
void |
addHttpServerInterface(HttpServerInterface httpIntf)
Adds HttpServerInterface for controlling WebServer. |
void |
addHttpServerListener(java.lang.Object l)
Deprecated. Now the HttpServerInterface is used to plug-in WebServers to HTML Adaptor. |
void |
bind()
Must be used to bind to a naming service or to bind to a ServerSocket |
static void |
deleteClientInfo(java.lang.String id,
java.lang.String user)
|
void |
destroyAdaptor()
This method is used to destroy the adaptor |
void |
disableAllTypes()
Disables all types of notifications |
void |
disableType(java.lang.String prefix)
Disables the type of notification in the parameter |
void |
enableAuthentication(boolean authFlag)
enables the authentication feature of the adaptor. |
void |
enableAuthorisation(boolean authFlag)
enables the authorisation feature of the adaptor. |
void |
enableType(java.lang.String prefix)
Enables the type of notification in the parameter |
ObjectName |
getAdaptorObjectName()
Gets the ObjectName of this adaptor with which it has been registered with the MBeanServer. |
java.lang.Object |
getAttribute(java.lang.String attribute)
Gets the value of a specific attribute of this MBean. |
AttributeList |
getAttributes(java.lang.String[] attributes)
Enables the values of several attributes of this MBean. |
boolean |
getAuthentication()
Gets the authentication feature of the User. |
static java.util.Hashtable |
getConfTable()
|
java.util.Vector |
getEnabledTypes()
Gets all the enabled notifications |
static com.adventnet.adaptors.html.HtmlAuthTable |
getHtmlAuth()
|
static HtmlPageProp |
getHtmlPageProp(java.lang.String userName)
|
MBeanInfo |
getMBeanInfo()
This method discovers the attributes and operations this MBean exposes for management. |
static MBeanServer |
getMBeanServer()
Getter for MBean server. |
static java.util.ArrayList |
getNotificationList()
|
java.lang.String |
getObjectName()
Gets the ObjectName which are 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. |
static java.lang.String |
getUserName(java.lang.String id)
|
static com.adventnet.adaptors.html.UserViewInterface |
getUserViewIntf()
Gets the values of UserviewInterface. |
void |
handleNotification(Notification notification,
java.lang.Object handback)
Invoked when an JMX notification occurs. |
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()
Gets the authentication feature of the User. |
boolean |
isAuthenticationEnabled()
|
boolean |
isNotificationEnabled(Notification notification)
Invoked before sending the specified notification to the listener |
boolean |
isNotificationEnabled(Notification notification,
NotificationListener listener,
java.lang.Object handback)
|
static boolean |
isValidUser(java.lang.String userName,
java.lang.String password)
|
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()
This method enable the Authentication Support. |
void |
restartHttpServer()
Restarts the WebServer. |
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. |
void |
setHtmlAuth(com.adventnet.adaptors.html.HtmlAuthTable htmlAuth)
|
static void |
setHtmlPageProp(java.lang.String userName,
HtmlPageProp htmlPageProp)
|
void |
setLogFile(java.lang.String fileName)
Sets the logfile with the given filename parameter |
void |
setMaxNotifFileCount(int count)
Sets the maximum number of notification file |
void |
setNotifFileSize(long size)
Sets the notification file size |
static void |
setParentDir(java.lang.String dirName)
Sets the parents diectory for this adaptor |
void |
setPort(java.lang.Integer portNum)
This function is used to set the port of HtmlAdaptor. |
void |
setUserView(com.adventnet.adaptors.html.UserViewInterface userIntf)
Sets the values of UserviewInterface. |
void |
startHttpServer()
Starts the WebServer by calling the HttpServerInterface's startHttpServer method. |
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 |
static boolean |
updateClientInfo(java.lang.String id,
java.lang.String user,
java.lang.String passwd)
|
Methods inherited from class com.adventnet.adaptors.AbstractAdaptor |
addNotificationListener, changeState, getAdaptorVersion, getHost, getNotificationInfo, getPort, getState, getStateInString, isActive, isSecure, removeNotificationListener, setPort |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static com.adventnet.adaptors.html.HtmlAuthTable htmlAuth
public static boolean readFromJarFile
Constructor Detail |
public HtmlAdaptor()
public HtmlAdaptor(java.lang.String homeDir)
homeDir
- public HtmlAdaptor(int portNum)
port
- numberpublic HtmlAdaptor(java.lang.Integer portNum)
public HtmlAdaptor(java.lang.Integer portNum, MBeanServer MBServer)
port
- numberserver
- The MBeanServer in which the MBean will be registered.public HtmlAdaptor(boolean isJarFile)
isJarFile
- Boolean value to indicate whether HtmlAdaptor.prp is in jar or not.public HtmlAdaptor(java.lang.Integer portNum, MBeanServer MBServer, boolean isJarFile)
port
- numberserver
- The MBeanServer in which the MBean will be registered.isJarFile
- Boolean value to indicate whether HtmlAdaptor.prp is in jar or not.Method Detail |
public void setPort(java.lang.Integer portNum) throws java.lang.Exception
port
- numberpublic boolean isAuthenticationEnabled()
public void setUserView(com.adventnet.adaptors.html.UserViewInterface userIntf)
UserviewInterface
- public static com.adventnet.adaptors.html.UserViewInterface getUserViewIntf()
public void instantiateAdaptor() throws java.lang.InstantiationException
AbstractAdaptor
instantiateAdaptor
in class AbstractAdaptor
public void bind()
AbstractAdaptor
bind
in class AbstractAdaptor
public void unbind()
AbstractAdaptor
unbind
in class AbstractAdaptor
public void registerAuthentication()
public ObjectName getAdaptorObjectName()
getAdaptorObjectName
in class AbstractAdaptor
public java.lang.String getObjectName()
public void destroyAdaptor()
destroyAdaptor
in class AbstractAdaptor
public void processClientRequests()
public static java.util.Hashtable getConfTable()
public MBeanInfo getMBeanInfo()
getMBeanInfo
in interface DynamicMBean
public java.lang.Object getAttribute(java.lang.String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
getAttribute
in interface DynamicMBean
attribute
- A String specifying the name of the
attribute to be retrieved.AttributeNotFoundException
- The
specified attribute is not accessible in the MBean.MBeanException
- The constructor of the MBean has
thrown an exceptionReflectionException
- Wraps a
ClassNotFoundException or a java.lang.Exception that occured trying to
invoke the MBean's constructor.public AttributeList getAttributes(java.lang.String[] attributes)
getAttributes
in interface DynamicMBean
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
invoke
in interface DynamicMBean
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.MBeanException
- The constructor of the MBean has
thrown an exceptionReflectionException
- Wraps a
ClassNotFoundException or a java.lang.Exception that occured trying to
invoke the MBean's constructor.public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
setAttribute
in interface DynamicMBean
attribute
- The identification of the attribute to
be set and the value it is to be set to.AttributeNotFoundException
- The
specified attribute is not accessible in the MBean.InvalidAttributeValueException
- The
specified value for the attribute is not valid.MBeanException
- The constructor of the MBean has
thrown an exceptionReflectionException
- Wraps a
ClassNotFoundException or a java.lang.Exception that occured trying to
invoke the MBean's constructor.public AttributeList setAttributes(AttributeList attributes)
setAttributes
in interface DynamicMBean
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 web-server) gets started at the default port 8030.
preRegister
in interface MBeanRegistration
preRegister
in class AbstractAdaptor
server
- The MBeanServer in which the MBean will be registered.name
- The object name of the MBean.java.lang.Exception
- This exception should be caught by the MBeanServer and
re-thrown as an MBeanRegistrationException.public void postRegister(java.lang.Boolean registrationDone)
postRegister
in interface MBeanRegistration
postRegister
in class AbstractAdaptor
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
preDeregister
in interface MBeanRegistration
preDeregister
in class AbstractAdaptor
java.langException
- This exception should be caught by the MBeanServer and
re-thrown as an MBeanRegistrationException.public void postDeregister()
postDeregister
in interface MBeanRegistration
postDeregister
in class AbstractAdaptor
public void handleNotification(Notification notification, java.lang.Object handback)
handleNotification
in interface NotificationListener
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.public void setNotifFileSize(long size)
size
- of the file in longpublic void setMaxNotifFileCount(int count)
number
- of files in intpublic void setLogFile(java.lang.String fileName)
fileName
- String name of the filepublic static java.util.ArrayList getNotificationList()
public boolean isNotificationEnabled(Notification notification, NotificationListener listener, java.lang.Object handback)
public boolean isNotificationEnabled(Notification notification)
isNotificationEnabled
in interface NotificationFilter
notification
- - The notification to be sent.public void disableAllTypes()
public void disableType(java.lang.String prefix)
prefix
- Notification typepublic void enableType(java.lang.String prefix)
prefix
- Notification typepublic java.util.Vector getEnabledTypes()
public void startService() throws java.lang.IllegalStateException, java.lang.Exception
startService
in class AbstractAdaptor
com.adventnet.adaptors.AbstractAdaptor
java.lang.IllegalStateException
- when the adaptor is in STARTED or STARTING statepublic void stopService() throws java.lang.IllegalStateException
stopService
in class AbstractAdaptor
com.adventnet.adaptors.AbstractAdaptor
java.lang.IllegalStateException
- when the adaptor is in STOPPED or STOPPING statepublic boolean getAuthentication()
public static boolean isAuthenticated()
public void enableAuthentication(boolean authFlag)
enableAuthentication
in class AbstractAdaptor
public void enableAuthorisation(boolean authFlag)
enableAuthorisation
in class AbstractAdaptor
public static MBeanServer getMBeanServer()
public void addHttpServerListener(java.lang.Object l)
public void startHttpServer() throws java.lang.Exception
stopHttpServer
public void stopHttpServer() throws java.lang.Exception
startHttpServer
public void restartHttpServer() throws java.lang.Exception
on
- error while restarting WebServer.public java.lang.String getProtocol()
getProtocol
in class AbstractAdaptor
public void addHttpServerInterface(HttpServerInterface httpIntf)
httpIntf
- The HttpServerInterface of the user.public static void setParentDir(java.lang.String dirName)
dirName
- String name of the parent directorypublic static java.lang.String getParentDirectory()
public void setHtmlAuth(com.adventnet.adaptors.html.HtmlAuthTable htmlAuth)
public static com.adventnet.adaptors.html.HtmlAuthTable getHtmlAuth()
public static HtmlPageProp getHtmlPageProp(java.lang.String userName)
public static java.lang.String getUserName(java.lang.String id)
public static void setHtmlPageProp(java.lang.String userName, HtmlPageProp htmlPageProp)
public static boolean isValidUser(java.lang.String userName, java.lang.String password)
public static boolean updateClientInfo(java.lang.String id, java.lang.String user, java.lang.String passwd)
public static void deleteClientInfo(java.lang.String id, java.lang.String user)
|
XMOJO 5 API Docs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |