public class JMXSummaryUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JMXSummaryUtils.StarredRequest
This class encapsulates a HttpServletRequest, making non-existing parameters appear as "*" for wildcard (or "0"
for the index parameter).
|
Modifier and Type | Field and Description |
---|---|
static String |
JMXApplicationInstIdProperty
JMX property for the application instance id.
|
static String |
JMXApplicationNameProperty
JMX property for the application name.
|
static String |
JMXArchiveReplicaNameProperty
JMX property for the replica name.
|
static String |
JMXHarvestChannelProperty
JMX property for the harvest channel.
|
static String |
JMXHttpportProperty
JMX property for the HTTP port.
|
static String |
JMXIndexProperty
JMX property for the index.
|
static String |
JMXMachineNameProperty
JMX property for the machine name.
|
static String |
JMXPhysLocationProperty
JMX property for the physical location.
|
static String |
JMXRemoveApplication
JMX property for remove application button.
|
static String[] |
STARRABLE_PARAMETERS
JMX properties, which can set to star.
|
static String |
STATUS_MONITOR_JMXSUMMARY
Status/Monitor-JMXsummary.jsp.
|
Constructor and Description |
---|
JMXSummaryUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
createJMXQuery(String[] parameters,
JMXSummaryUtils.StarredRequest starredRequest)
Build a JMX query string (ObjectName) from a request and a list of parameters to query for.
|
static String |
generateLink(JMXSummaryUtils.StarredRequest request,
String setPart,
String setValue,
String linkText)
Generate an HTML link to the JMX summary page with one part of the URL parameters set to a specific value.
|
static String |
generateMessage(String logMessage,
Locale l)
Make an HTML fragment that shows a log message preformatted.
|
static String |
generateShowAllLink(JMXSummaryUtils.StarredRequest starredRequest,
String parameter,
Locale l)
Generate HTML to show at the top of the table, containing a "show all" link if the parameter is currently
restricted.
|
static String |
generateShowColumn(JMXSummaryUtils.StarredRequest starredRequest,
Locale l)
Creates the show links for showing columns again.
|
static String |
generateShowLink(JMXSummaryUtils.StarredRequest starredRequest,
String parameter,
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 List<StatusEntry> |
queryJMXFromRequest(String[] parameters,
JMXSummaryUtils.StarredRequest request,
javax.servlet.jsp.PageContext context)
Get status entries from JMX based on a request and some parameters.
|
static String |
reduceApplicationName(String applicationName)
Reduce the class name of an application to the essentials.
|
static boolean |
showColumn(JMXSummaryUtils.StarredRequest starredRequest,
String parameter)
Tests if a parameter in the request is "-" (thus off).
|
static void |
unregisterJMXInstance(String[] parameters,
JMXSummaryUtils.StarredRequest request,
javax.servlet.jsp.PageContext context)
Select zero or more beans from JMX and unregister these.
|
public static final String JMXRemoveApplication
public static final String JMXPhysLocationProperty
public static final String JMXMachineNameProperty
public static final String JMXApplicationNameProperty
public static final String JMXApplicationInstIdProperty
public static final String JMXHttpportProperty
public static final String JMXHarvestChannelProperty
public static final String JMXArchiveReplicaNameProperty
public static final String JMXIndexProperty
public static final String[] STARRABLE_PARAMETERS
public static final String STATUS_MONITOR_JMXSUMMARY
public JMXSummaryUtils()
public static String reduceApplicationName(String applicationName) throws ArgumentNotValid
applicationName
- The class name of the application, should not be null.ArgumentNotValid
- if argument isn't valid.public static String generateShowColumn(JMXSummaryUtils.StarredRequest starredRequest, Locale l) throws ArgumentNotValid
Goes through all parameters to check if their column is active. If a column is not active, the link to showing a specific column again is generated.
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 String generateShowAllLink(JMXSummaryUtils.StarredRequest starredRequest, String parameter, 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 String generateShowLink(JMXSummaryUtils.StarredRequest starredRequest, String parameter, 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, 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 String generateLink(JMXSummaryUtils.StarredRequest request, String setPart, String setValue, 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 List<StatusEntry> queryJMXFromRequest(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(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 String createJMXQuery(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 String generateMessage(String logMessage, Locale l) throws ArgumentNotValid
logMessage
- The log message to present.l
- the current Locale.ArgumentNotValid
- if argument isn't valid.Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.