|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.monitor.webinterface.JMXSummaryUtils
public class JMXSummaryUtils
Various utility methods and classes for the JMX Monitor page. and a bunch of JMX properties used by Monitor-JMXsummary.jsp.
Nested Class Summary | |
---|---|
static class |
JMXSummaryUtils.StarredRequest
This class encapsulates a HttpServletRequest, making non-existing parameters appear as "*" for wildcard (or "0" for the index parameter). |
Field Summary | |
---|---|
static java.lang.String |
JMXApplicationInstIdProperty
JMX property for the application instance id. |
static java.lang.String |
JMXApplicationNameProperty
JMX property for the application name. |
static java.lang.String |
JMXArchiveReplicaNameProperty
JMX property for the replica name. |
static java.lang.String |
JMXHarvestPriorityProperty
JMX property for the harvest priority |
static java.lang.String |
JMXHttpportProperty
JMX property for the HTTP port. |
static java.lang.String |
JMXIndexProperty
JMX property for the index. |
static java.lang.String |
JMXMachineNameProperty
JMX property for the machine name. |
static java.lang.String |
JMXPhysLocationProperty
JMX property for the physical location. |
static java.lang.String |
JMXRemoveApplication
JMX property for remove application button. |
static java.lang.String[] |
STARRABLE_PARAMETERS
JMX properties, which can set to star. |
static java.lang.String |
STATUS_MONITOR_JMXSUMMARY
Status/Monitor-JMXsummary.jsp. |
Constructor Summary | |
---|---|
JMXSummaryUtils()
|
Method Summary | |
---|---|
static java.lang.String |
createJMXQuery(java.lang.String[] parameters,
JMXSummaryUtils.StarredRequest starredRequest)
Build a JMX query string (ObjectName) from a request and a list of parameters to query for. |
static java.lang.String |
generateLink(JMXSummaryUtils.StarredRequest request,
java.lang.String setPart,
java.lang.String setValue,
java.lang.String linkText)
Generate an HTML link to the JMX summary page with one part of the URL parameters set to a specific value. |
static java.lang.String |
generateMessage(java.lang.String logMessage,
java.util.Locale l)
Make an HTML fragment that shows a log message preformatted. |
static java.lang.String |
generateShowAllLink(JMXSummaryUtils.StarredRequest starredRequest,
java.lang.String parameter,
java.util.Locale l)
Generate HTML to show at the top of the table, containing a "show all" link if the parameter is currently restricted. |
static java.lang.String |
generateShowColumn(JMXSummaryUtils.StarredRequest starredRequest,
java.util.Locale l)
Creates the show links for showing columns again. |
static java.lang.String |
generateShowLink(JMXSummaryUtils.StarredRequest starredRequest,
java.lang.String parameter,
java.util.Locale l)
Generate HTML to show at the top of the table, containing a "show all" and a "off" links if the parameter is currently restricted. |
static java.util.List<StatusEntry> |
queryJMXFromRequest(java.lang.String[] parameters,
JMXSummaryUtils.StarredRequest request,
javax.servlet.jsp.PageContext context)
Get status entries from JMX based on a request and some parameters. |
static java.lang.String |
reduceApplicationName(java.lang.String applicationName)
Reduce the class name of an application to the essentials. |
static java.lang.String |
reduceHostname(java.lang.String hostname)
Reduce a hostname to a more readable form. |
static boolean |
showColumn(JMXSummaryUtils.StarredRequest starredRequest,
java.lang.String parameter)
Tests if a parameter in the request is "-" (thus off). |
static void |
unregisterJMXInstance(java.lang.String[] parameters,
JMXSummaryUtils.StarredRequest request,
javax.servlet.jsp.PageContext context)
Select zero or more beans from JMX and unregister these. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String JMXRemoveApplication
public static final java.lang.String JMXPhysLocationProperty
public static final java.lang.String JMXMachineNameProperty
public static final java.lang.String JMXApplicationNameProperty
public static final java.lang.String JMXApplicationInstIdProperty
public static final java.lang.String JMXHttpportProperty
public static final java.lang.String JMXHarvestPriorityProperty
public static final java.lang.String JMXArchiveReplicaNameProperty
public static final java.lang.String JMXIndexProperty
public static final java.lang.String[] STARRABLE_PARAMETERS
public static final java.lang.String STATUS_MONITOR_JMXSUMMARY
Constructor Detail |
---|
public JMXSummaryUtils()
Method Detail |
---|
public static java.lang.String reduceApplicationName(java.lang.String applicationName) throws ArgumentNotValid
applicationName
- The class name of the application, should not be
null.
ArgumentNotValid
- if argument isn't valid.public static java.lang.String reduceHostname(java.lang.String hostname) throws ArgumentNotValid
hostname
- A host name, should not be null.
ArgumentNotValid
- if argument isn't valid.public static java.lang.String generateShowColumn(JMXSummaryUtils.StarredRequest starredRequest, java.util.Locale l) throws ArgumentNotValid
starredRequest
- A request to take parameters from, should be
different from null.l
- For retrieving the correct words form the current language.
ArgumentNotValid
- if argument isn't valid.public static java.lang.String generateShowAllLink(JMXSummaryUtils.StarredRequest starredRequest, java.lang.String parameter, java.util.Locale l) throws ArgumentNotValid
starredRequest
- A request to take parameters from, should not be
null.parameter
- The parameter that, if not already unrestricted, should
be unrestricted in the "show all" link, should not be null.l
- the current locale.
ArgumentNotValid
- if arguments isn't valid.public static java.lang.String generateShowLink(JMXSummaryUtils.StarredRequest starredRequest, java.lang.String parameter, java.util.Locale l) throws ArgumentNotValid
starredRequest
- A request to take parameters from, should not be
null.parameter
- The parameter that, if not already unrestricted, should
be unrestricted in the "show all", should not be null.l
- the current locale.
ArgumentNotValid
- if arguments isn't valid.public static boolean showColumn(JMXSummaryUtils.StarredRequest starredRequest, java.lang.String parameter) throws ArgumentNotValid
starredRequest
- A request to take parameters from, should not be
null.parameter
- The parameter that should be tested.
ArgumentNotValid
- if argument isn't valid.public static java.lang.String generateLink(JMXSummaryUtils.StarredRequest request, java.lang.String setPart, java.lang.String setValue, java.lang.String linkText) throws ArgumentNotValid
request
- A request to draw other parameter values from, should not
be null.setPart
- Which of the parameters to set.setValue
- The value to set that parameter to.linkText
- The HTML text that should go inside the link. Remember
to escape HTML values if inserting a normal string.
ArgumentNotValid
- if request is null.public static java.util.List<StatusEntry> queryJMXFromRequest(java.lang.String[] parameters, JMXSummaryUtils.StarredRequest request, javax.servlet.jsp.PageContext context) throws ArgumentNotValid, ForwardedToErrorPage
parameters
- The parameters to query JMX for, should not be null.request
- A request possibly containing values for some of the
parameters, should not be null.context
- the current JSP context, should not be null.
ArgumentNotValid
- if the query is invalid (typically caused by
invalid parameters).
ForwardedToErrorPage
- if unable to create JMX-query.public static void unregisterJMXInstance(java.lang.String[] parameters, JMXSummaryUtils.StarredRequest request, javax.servlet.jsp.PageContext context) throws ArgumentNotValid
parameters
- The parameters to query JMX for, should not be null.request
- A request possibly containing values for some of the
parameters, which select zero or more beans.context
- the current JSP context, should not be null.
ArgumentNotValid
- if arguments isn't valid.public static java.lang.String createJMXQuery(java.lang.String[] parameters, JMXSummaryUtils.StarredRequest starredRequest) throws ArgumentNotValid
parameters
- The parameters to query for. These should make
up the parts of the unique identification of an MBean.starredRequest
- A request containing current values for the given
parameters.
ArgumentNotValid
- if one or all of the arguements are null.public static java.lang.String generateMessage(java.lang.String logMessage, java.util.Locale l) throws ArgumentNotValid
logMessage
- The log message to present.l
- the current Locale.
ArgumentNotValid
- if argument isn't valid.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |