|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.html.staticssi.StaticUtil
public class StaticUtil
In the case of HTTP communcation, the displayed html page can be generated in two ways.
1. Dynamic Html Page generation.
2. Customized Html Page generation using SSI tags.
In the first case the user don't need to type any html file for his instrumentation. The HtmlMain and DynamicHtml classes will generate dynamic html files and take care of all the necessary operations like modify value, create value, etc.
In the second case, using the .shtml files generated from the MibCompiler that contains required ssi tags to display the instrumented information, the user can customize the html pages.
This class is the common class to handle both type of html generation. The servlet should create an instance of this class and invoke corresponding functions from here.
com.adventnet.ssiparser.HtmlParser,
com.adventnet.ssiparser.DynamicHtml| Field Summary | |
|---|---|
static int |
CANCEL
If cancel button is invoked from the client |
static int |
DELETE_ROW
|
static int |
DO_GET
If get or refresh button is invoked from the client |
static int |
DO_OPER
If Get Operation is performed on the Attribute |
(package private) static int |
endIndex
|
(package private) boolean |
isNextButtonNeeded
|
(package private) boolean |
isPrevButtonNeeded
|
(package private) static Log |
log
Logger used to log the error,debug,trace messages, etc |
static int |
NEW_ROW
If new row button is invoked from the client |
static int |
NEXT_ROW
|
(package private) boolean |
nextRowFlag
|
java.lang.String |
page
|
static int |
POST_ERROR
If any error in the post |
static int |
PREV_ROW
|
(package private) boolean |
prevRowFlag
|
static int |
REFRESH
If refresh button is invoked from the client |
(package private) static int |
stIndex
|
| Constructor Summary | |
|---|---|
StaticUtil(ServerOperations serverOp)
Default Constructor for HtmlMain. |
|
| Method Summary | |
|---|---|
void |
addFormAndTableTags(java.lang.StringBuffer strBuf,
javax.management.ObjectName objName,
boolean isDynamicHtmlPage,
java.lang.String varName,
java.lang.String searchAttrbName)
Add the starting tags for form and table. |
static java.lang.String |
convertArrayToString(java.lang.String attrbType,
java.lang.Object attrbValue)
Method to convert the given attrbValue into string. |
static void |
createAttrbNameAccessTypeVector(java.lang.Object mbean,
java.util.Vector variable,
java.util.Vector access,
java.util.Vector type)
Create vectors for attribute names, their access and their basic data types from the xml file. |
javax.jmx.openmbean.CompositeData[] |
createCompositeDataForModifyOrDelete(java.util.Hashtable table,
java.lang.String objName,
boolean modifyFlag)
|
boolean |
createTable(java.lang.StringBuffer strBuf,
java.lang.Object obj,
javax.management.ObjectName objName,
java.lang.Object mbean,
boolean isDynamicHtmlPage,
int sIndex,
int eIndex,
boolean implementsModelListener)
If the given attribute is table then this function will be called to generate html table. |
void |
createTableHeader(java.util.Vector ve,
java.util.Vector type,
java.lang.StringBuffer strBuf)
|
boolean |
createTableRow(java.util.Vector varVect,
java.util.Vector valVect,
java.util.Vector typeVect,
java.lang.String indexes,
java.util.Vector accessVec,
java.lang.StringBuffer strBuf,
java.lang.String varName)
Used to create a dynamic row in the HTML table. |
javax.jmx.openmbean.TabularData |
createTabularDataForModifyOrDelete(java.util.Hashtable table,
java.lang.String objName,
boolean modifyFlag)
|
java.lang.String |
getAttributeValue(java.lang.String name,
java.lang.String searchAttrbName,
java.lang.Object searchAttrbValue,
boolean isForSetMethod,
boolean isDynamicHtmlPage,
boolean fromSetAttributeValue)
It will retrieve or update the MBean's attributes with the given parameters from the client. |
java.lang.String |
getFilter()
Getter for the filter value. |
(package private) static java.util.Hashtable |
getHeaderTable()
|
HtmlParser |
getHtmlParser()
Return the HtmlParser object reference. |
(package private) static java.lang.Object |
getMBean(java.lang.String objName)
Getter for the MBean. |
java.lang.String |
getNotifTable()
|
static boolean |
isTable(java.lang.String name)
|
void |
registerMBean(java.lang.String domain,
java.lang.String keys,
java.lang.String className,
java.lang.String loader,
java.lang.String xmlFile)
It is used to instantiate and register an MBean from the browser. |
int |
setAttributeValue(java.util.Hashtable table)
It is used to set the attributes value received from the client(browser). |
java.lang.String |
setAttributeValue(java.lang.String objName,
java.lang.String searchAttrbName,
java.lang.String searchAttrbValue)
It will update the MBean's attribute with the given value from the client. |
void |
setEndIndex(int value)
|
void |
setFilter(java.lang.String filter)
Setter for the filter value. |
void |
setHtmlPageProp(HtmlPageProp htmlPageProp)
|
void |
setNextRow(boolean flag)
|
void |
setOperationsButtonNeeded(boolean value)
|
void |
setPrevRow(boolean flag)
|
void |
setRefreshTime(int time)
Setter for the refresh time. |
int |
setScalarValues(java.util.Hashtable table,
java.util.Hashtable hashtable,
java.lang.String objName,
boolean isTable)
|
void |
setServletName(java.lang.String name)
Method to set the servlet name. |
void |
setStartIndex(int value)
|
int |
setTableValues(java.util.Hashtable table,
java.lang.String objName,
boolean implementsModelListener,
boolean addRowFlag,
boolean deleteRowFlag)
|
void |
unregisterMBean(java.lang.String domain,
java.lang.String keys)
It is used to unregister an MBean from the MBeanServer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static Log log
public static int CANCEL
public static int DO_GET
public static int NEW_ROW
public static int DELETE_ROW
public static int NEXT_ROW
public static int PREV_ROW
boolean nextRowFlag
boolean prevRowFlag
boolean isNextButtonNeeded
boolean isPrevButtonNeeded
public static int REFRESH
public static int POST_ERROR
public static int DO_OPER
public java.lang.String page
static int stIndex
static int endIndex
| Constructor Detail |
|---|
public StaticUtil(ServerOperations serverOp)
| Method Detail |
|---|
public void setHtmlPageProp(HtmlPageProp htmlPageProp)
public HtmlParser getHtmlParser()
public void setServletName(java.lang.String name)
name - the servlet namepublic void setNextRow(boolean flag)
public void setPrevRow(boolean flag)
public void setOperationsButtonNeeded(boolean value)
public void setRefreshTime(int time)
time - the time value for refesh time.public void setFilter(java.lang.String filter)
filter - the value for filter.public java.lang.String getFilter()
public java.lang.String getAttributeValue(java.lang.String name,
java.lang.String searchAttrbName,
java.lang.Object searchAttrbValue,
boolean isForSetMethod,
boolean isDynamicHtmlPage,
boolean fromSetAttributeValue)
throws java.lang.Exception
name - the MBean ObjectName.searchAttrbName - the attribute of the MBean name.searchAttrbValue - the value of the MBean atrribute.isForSetMethod - to say the operation is set or get.isDynamicHtmlPage - to say about the html page will be generated
dynamically or not.
java.lang.Exception
public java.lang.String setAttributeValue(java.lang.String objName,
java.lang.String searchAttrbName,
java.lang.String searchAttrbValue)
throws java.lang.Exception
objName - the domain MBean ObjectName.searchAttrbName - the MBean's attribute name.searchAttrbValue - the MBean's attribute value.
java.lang.Exceptionpublic int setAttributeValue(java.util.Hashtable table)
table - the hash table cotains param and its value.
static java.lang.Object getMBean(java.lang.String objName)
objName - - the string representation of the ObjectName.
public void registerMBean(java.lang.String domain,
java.lang.String keys,
java.lang.String className,
java.lang.String loader,
java.lang.String xmlFile)
domain - the DomanName of the ObjectName of MBean.keys - the key list of the ObjectName.className - the class name of the MBean.loader - the loader object namexmlFile - the xml file name in the case of model mbean.
public void unregisterMBean(java.lang.String domain,
java.lang.String keys)
domain - the DomanName of the ObjectName of MBean.keys - the key list of the ObjectName.public void setStartIndex(int value)
public void setEndIndex(int value)
public javax.jmx.openmbean.TabularData createTabularDataForModifyOrDelete(java.util.Hashtable table,
java.lang.String objName,
boolean modifyFlag)
public javax.jmx.openmbean.CompositeData[] createCompositeDataForModifyOrDelete(java.util.Hashtable table,
java.lang.String objName,
boolean modifyFlag)
static java.util.Hashtable getHeaderTable()
public boolean createTable(java.lang.StringBuffer strBuf,
java.lang.Object obj,
javax.management.ObjectName objName,
java.lang.Object mbean,
boolean isDynamicHtmlPage,
int sIndex,
int eIndex,
boolean implementsModelListener)
strBuf - to store the created html information about table.obj - the TabularData of the table.objName - the object name of the registed MBean.mbean - the MBean object of the table.
public static void createAttrbNameAccessTypeVector(java.lang.Object mbean,
java.util.Vector variable,
java.util.Vector access,
java.util.Vector type)
modelMBean - the registered mbean.variable - vector to store variable (column) name.access - vector to store the access of the variable (column).type - vector to store the type of the variable (coulmn).
public int setTableValues(java.util.Hashtable table,
java.lang.String objName,
boolean implementsModelListener,
boolean addRowFlag,
boolean deleteRowFlag)
public int setScalarValues(java.util.Hashtable table,
java.util.Hashtable hashtable,
java.lang.String objName,
boolean isTable)
public void addFormAndTableTags(java.lang.StringBuffer strBuf,
javax.management.ObjectName objName,
boolean isDynamicHtmlPage,
java.lang.String varName,
java.lang.String searchAttrbName)
strBuf - to store the generated tags information.objName - the ObjectName of the MBean.
public void createTableHeader(java.util.Vector ve,
java.util.Vector type,
java.lang.StringBuffer strBuf)
public boolean createTableRow(java.util.Vector varVect,
java.util.Vector valVect,
java.util.Vector typeVect,
java.lang.String indexes,
java.util.Vector accessVec,
java.lang.StringBuffer strBuf,
java.lang.String varName)
indexs - the index string in the case of table.ve - vector contains the each column value of a row.accessFlag - to tell about the attribute is read only or
read write.strBuf - the resultant html table will be stored in
this variable.
public static java.lang.String convertArrayToString(java.lang.String attrbType,
java.lang.Object attrbValue)
attrbType - the basic type of the object.attrbValue - the value of the object.
public static boolean isTable(java.lang.String name)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getNotifTable()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||