diff --git a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/AsmAccessor.java b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/AsmAccessor.java index 17c1e08..c6efcb4 100755 --- a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/AsmAccessor.java +++ b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/AsmAccessor.java @@ -96,7 +96,10 @@ private String executeApi(String callType, String callParams, boolean checkError boolean retry = false; String logsForUser = EpaUtils.getProperty(LOGS_FOR_USER, null); - if (!callType.startsWith("acct_") && (callType != "cp_list") && (logsForUser != null) && !logsForUser.isEmpty()) { + if (!callType.startsWith("acct_") + && (callType != "cp_list") + && (logsForUser != null) + && !logsForUser.isEmpty()) { callParams += "&acct=" + URLEncoder.encode(logsForUser, EpaUtils.getEncoding()); } diff --git a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/AssetDownloader.java b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/AssetDownloader.java index dc31b78..2f272e5 100644 --- a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/AssetDownloader.java +++ b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/AssetDownloader.java @@ -16,6 +16,12 @@ public class AssetDownloader extends AbstractHandler { private final String path; private final String key; + /** + * AssetDownloader constructor. + * @param successor successor + * @param path download path + * @param key key top extract + */ public AssetDownloader(Handler successor, String path, String key) { super(successor); this.path = path; diff --git a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/BaseMonitor.java b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/BaseMonitor.java index 531f7d9..6c8eb67 100644 --- a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/BaseMonitor.java +++ b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/BaseMonitor.java @@ -2,9 +2,12 @@ import java.util.HashSet; import java.util.Iterator; +import java.util.Map; import java.util.Set; +import java.util.UUID; import org.json.JSONArray; +import org.json.JSONException; import org.json.JSONObject; import com.ca.apm.swat.epaplugins.asm.AsmRequestHelper; @@ -17,12 +20,6 @@ import com.wily.introscope.epagent.EpaUtils; import com.wily.util.feedback.Module; -import java.util.Map; -import java.util.UUID; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.json.JSONException; - /** * Base class for implementations of the {@link Monitor} interface. * @author Guenter Grossberger - CA APM SWAT Team @@ -45,7 +42,7 @@ public class BaseMonitor extends AbstractMonitor implements AsmProperties { /** * Monitor base class. - * @param successor + * @param successor successor in chain * @param name name of the monitor * @param type monitor type * @param folder folder of the monitor @@ -226,16 +223,20 @@ public Map generateMetrics( JSONObject resultObj = innerJsonArray.getJSONObject(i); try { // find the monitor - Monitor m = MonitorFactory.findMonitor(resultObj.getString("name")); - if(m != null) { + Monitor mon = + MonitorFactory.findMonitor(resultObj.getString("name")); + if (mon != null) { // hand over parsing to a monitor-specific handler chain - m.generateMetrics(metricMap, resultObj.toString(), metricTree); + mon.generateMetrics(metricMap, + resultObj.toString(), + metricTree); } else { // recursively generate metrics for these tags generateMetrics(metricMap, resultObj.toString(), metricTree); } - } catch(JSONException e) { - EpaUtils.getFeedback().debug(module, "Missing name key for log record."); + } catch (JSONException e) { + EpaUtils.getFeedback().debug(module, + "Missing name key for log record."); } catch (AsmException e) { handleException(e, metricTree, metricMap, module); } diff --git a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/Handler.java b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/Handler.java index 5f61a0e..8c6e5e1 100644 --- a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/Handler.java +++ b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/Handler.java @@ -13,7 +13,7 @@ public interface Handler { /** - * @return next Handler in chain + * @return next Handler in chain. */ public Handler getSuccessor(); diff --git a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/HarHandler.java b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/HarHandler.java index 5ab12e6..2747b7a 100644 --- a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/HarHandler.java +++ b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/HarHandler.java @@ -45,7 +45,7 @@ public Map generateMetrics( JSONObject h1 = new JSONObject(harString); JSONObject h2 = h1.optJSONObject("har"); - JsonHar har = new JsonHar(h2 != null? h2 : h1); + JsonHar har = new JsonHar(h2 != null ? h2 : h1); int step = 1; @@ -130,7 +130,7 @@ private String getEntryMetric(Entry entry, String metricName) { private void addMetric(Map metricMap, String metricName, String value) { - value = StringUtils.escapeHTMLSpecialCharacters(value); + value = StringUtils.escapeHTMLSpecialCharacters(value); if (EpaUtils.getFeedback().isDebugEnabled(module)) { EpaUtils.getFeedback().debug(module, "METRIC: " + metricName + ":" + value); @@ -223,8 +223,8 @@ private Map reportEntryMetrics( String text = url; if ((null != text) && (0 < text.length())) { - // lopal05: now normalize URL, we dont't want anything behing '?' as that may result in metric tree - // explosion. Each new request creating new path / element. + // lopal05: now normalize URL, we dont't want anything behind '?' as that may result + // in metric tree explosion. Each new request creating new path / element. int indexOfChar = text.indexOf(";"); if (indexOfChar > 0) { text = text.substring(0, indexOfChar); diff --git a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/JMeterScriptHandler.java b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/JMeterScriptHandler.java index 05ac1e7..019adaf 100644 --- a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/JMeterScriptHandler.java +++ b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/JMeterScriptHandler.java @@ -184,8 +184,9 @@ private MetricMap reportJMeterStep(String metricTree, String text = stepChild.getTextContent(); if ((null != text) && (0 < text.length())) { - // lopal05: now normalize URL, we dont't want anything behing '?' as that may result in metric tree - // explosion. Each new request creating new path / element. + // lopal05: now normalize URL, we dont't want anything behind '?' as that + // may result in metric tree explosion. Each new request creating new + // path / element. int indexOfChar = text.indexOf(";"); if (indexOfChar > 0) { text = text.substring(0, indexOfChar); diff --git a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/ScriptMonitor.java b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/ScriptMonitor.java index b8945c3..395c794 100644 --- a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/ScriptMonitor.java +++ b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/ScriptMonitor.java @@ -33,8 +33,8 @@ public class ScriptMonitor extends BaseMonitor { * @param name name of the monitor * @param folder folder of the monitor * @param tags tags of the monitor - * @param url - * @param active + * @param url URL + * @param active is active? */ protected ScriptMonitor(String name, String folder, diff --git a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/XmlFixer.java b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/XmlFixer.java index 8428541..03fade7 100644 --- a/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/XmlFixer.java +++ b/asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/monitor/XmlFixer.java @@ -37,7 +37,9 @@ public Map generateMetrics(Map map, metricTree)); } // replace all occu - return getSuccessor().generateMetrics(map, xmlString.replaceAll("&", "&"), metricTree); + return getSuccessor().generateMetrics(map, + xmlString.replaceAll("&", "&"), + metricTree); } else { EpaUtils.getFeedback().error(module, AsmMessages.getMessage(