|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.mbari.siam.configt.ConfigTool
public class ConfigTool
PlatformConfigServlet is the main class for the SIAM configuration tool. It is based on the Jetty servlet classes, and is used in conjunction with the Jetty HTTP server and servlet container (SimpleServer.class, http://org.mortbay.org/jetty). The PlatformConfigServlet (servlet) is used to configure an MMC node via a web browser. One of the motivations for the servlet is to hide the complexity of the node configuration, which is distributed throughout a number of files on an MMC node. A web-based design makes it possible for the same configuration tool to be used either as a command-line tool (through a serial console, using text based browsers) or remotely, via the network. The servlet architecture is stateful, unlike CGI, and supports session control (not implemented yet). The configuration process consists of setting general node options (e.g., node ID, communications settings, network settings, etc.) and configuring instrument serial ports. Once the options have been set, the system configuration files, consisting of various Linux system files and Java properties files, are written by the servlet. The files affected are:
| Field Summary | |
|---|---|
protected static org.apache.log4j.Logger |
_log4j
Log4J logger |
static int |
READY
File write state: ready to write |
static int |
WRITING
File write state: write in progress |
| Constructor Summary | |
|---|---|
ConfigTool()
|
|
| Method Summary | |
|---|---|
boolean |
accept(java.io.File file,
java.lang.String name)
Implement JAR file filter for jarList ConfigItem. |
void |
back(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
void |
cancel(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
void |
configureAuxLink(java.lang.String sNodeType,
java.lang.String sLinkType)
|
void |
configureParentLink(java.lang.String sNodeType,
java.lang.String sLinkType)
|
ConfigItem |
createJarList(java.lang.String jarPath)
Create a global (servlet level) ConfigItem; a SELECT drop box containing a list of service JAR files. |
void |
doConfigAction()
After the configuration files have been written, a shell script or executable may be called to perform any special operations required. |
void |
finish(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
java.util.Vector |
getConfigFiles()
|
ConfigItem |
getElement(java.lang.String name)
Lookup ConfigItem by name. |
java.util.Vector |
getElements()
|
ConfigItem |
getItem(java.lang.String name)
|
java.lang.String |
getItemValue(java.lang.String name)
|
java.util.Vector |
getPageNames()
|
java.util.Properties |
getProperties()
Fulfills ServletApp interface |
java.lang.String |
getSiamHome()
Return SIAM_HOME path |
java.lang.String |
getValue(java.lang.String name)
Lookup ConfigItem value by name. |
void |
init()
Servlet initialization. |
protected void |
loadProperties()
Load servlet configuration from configtool.properties |
static void |
main(java.lang.String[] args)
|
void |
next(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
protected void |
setConfigItem(ConfigItem item,
java.lang.String itemName,
java.lang.String itemValue)
Set config item with specified value, create it if it doesn't exist |
void |
setProgressPercent(int p)
Set file-write progress % value |
void |
setProgressText(java.lang.String t)
Set file-write progress text value |
void |
setServletConfigItems()
Calculate value of global (servlet level) ConfigItems based on current configuration settings. |
void |
setState(java.lang.String pageID)
Save current state and proceed to next state |
void |
update(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Handler for HTTP GET request |
void |
writeConfigFiles()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.log4j.Logger _log4j
public static final int READY
public static final int WRITING
| Constructor Detail |
|---|
public ConfigTool()
| Method Detail |
|---|
public void update(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
update in interface ServletAppjavax.servlet.ServletException
java.io.IOException
public void next(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
next in interface ServletWizardjavax.servlet.ServletException
java.io.IOException
public void back(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
back in interface ServletWizardjavax.servlet.ServletException
java.io.IOException
public void cancel(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
cancel in interface ServletWizardjavax.servlet.ServletException
java.io.IOException
public void finish(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
finish in interface ServletWizardjavax.servlet.ServletException
java.io.IOExceptionpublic java.util.Vector getPageNames()
getPageNames in interface ServletApppublic java.util.Vector getElements()
getElements in interface ServletApppublic java.util.Vector getConfigFiles()
getConfigFiles in interface ServletApp
public void init()
throws javax.servlet.ServletException
init in interface ServletAppjavax.servlet.ServletExceptionpublic void setState(java.lang.String pageID)
protected void loadProperties()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getSiamHome()
public java.lang.String getValue(java.lang.String name)
getValue in interface ServletApppublic java.lang.String getItemValue(java.lang.String name)
public ConfigItem getElement(java.lang.String name)
getElement in interface ServletApppublic ConfigItem getItem(java.lang.String name)
public ConfigItem createJarList(java.lang.String jarPath)
protected void setConfigItem(ConfigItem item,
java.lang.String itemName,
java.lang.String itemValue)
public void setServletConfigItems()
public void configureParentLink(java.lang.String sNodeType,
java.lang.String sLinkType)
throws java.io.IOException,
java.lang.Exception
java.io.IOException
java.lang.Exception
public void configureAuxLink(java.lang.String sNodeType,
java.lang.String sLinkType)
throws java.io.IOException,
java.lang.Exception
java.io.IOException
java.lang.Exceptionpublic void doConfigAction()
public void writeConfigFiles()
public void setProgressText(java.lang.String t)
public void setProgressPercent(int p)
public boolean accept(java.io.File file,
java.lang.String name)
accept in interface java.io.FilenameFilterpublic java.util.Properties getProperties()
getProperties in interface ServletApppublic static void main(java.lang.String[] args)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||