From af9e10e0620ea40ac47d8317212730e29987987c Mon Sep 17 00:00:00 2001 From: Cousjava Date: Thu, 20 Apr 2017 14:26:49 +0100 Subject: [PATCH 1/6] PAYARA-1382 Added avaliable notifiers to requesttracing page in admin console --- .../payara/admingui/extras/Strings.properties | 2 + .../requestTracing/requestTracing.jsf | 81 ++++++++++++++++--- .../admin/NotifierServiceLister.java | 60 ++++++++++---- .../admin/GetRequestTracingConfiguration.java | 52 ++++++++---- 4 files changed, 152 insertions(+), 43 deletions(-) diff --git a/appserver/admingui/payara-console-extras/src/main/resources/fish/payara/admingui/extras/Strings.properties b/appserver/admingui/payara-console-extras/src/main/resources/fish/payara/admingui/extras/Strings.properties index 2dc9451a064..da2c899b888 100644 --- a/appserver/admingui/payara-console-extras/src/main/resources/fish/payara/admingui/extras/Strings.properties +++ b/appserver/admingui/payara-console-extras/src/main/resources/fish/payara/admingui/extras/Strings.properties @@ -130,3 +130,5 @@ requestTracing.configuration.notifier.dynamicHelp=Starts or Stops the Request Tr requestTracing.configuration.notifier.name=Notifier Service Name requestTracing.configuration.notifier.nameHelp=Name of the Notifier Service +requestTracing.configuration.availableNotifiers=Avaliable Notifiers +requestTracing.configuration.selectedNotifiers=Active Notifiers \ No newline at end of file diff --git a/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf b/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf index e1d3cead3ce..110f6ea567a 100644 --- a/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf +++ b/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf @@ -1,20 +1,42 @@ @@ -67,12 +107,14 @@ gf.updateEntity(endpoint="#{pageSession.REQUEST_TRACING_CONFIG_URL}/set-requesttracing-configuration" attrs="#{pageSession.valueMap}" convertToFalse="#{pageSession.convertToFalseList}"); /> + #include "/common/shared/configNameSection.inc" + @@ -100,6 +142,19 @@ + + + + + + + + diff --git a/nucleus/payara-modules/notification-core/src/main/java/fish/payara/nucleus/notification/admin/NotifierServiceLister.java b/nucleus/payara-modules/notification-core/src/main/java/fish/payara/nucleus/notification/admin/NotifierServiceLister.java index 344984a591f..60cfb9fa78f 100644 --- a/nucleus/payara-modules/notification-core/src/main/java/fish/payara/nucleus/notification/admin/NotifierServiceLister.java +++ b/nucleus/payara-modules/notification-core/src/main/java/fish/payara/nucleus/notification/admin/NotifierServiceLister.java @@ -1,19 +1,41 @@ /* - - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - - Copyright (c) 2016 Payara Foundation. All rights reserved. - - The contents of this file are subject to the terms of the Common Development - and Distribution License("CDDL") (collectively, the "License"). You - may not use this file except in compliance with the License. You can - obtain a copy of the License at - https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - or packager/legal/LICENSE.txt. See the License for the specific - language governing permissions and limitations under the License. - - When distributing the software, include this License Header Notice in each - file and include the License file at packager/legal/LICENSE.txt. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2016-2017 Payara Foundation and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://github.com/payara/Payara/blob/master/LICENSE.txt + * See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at glassfish/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * The Payara Foundation designates this particular file as subject to the "Classpath" + * exception as provided by the Payara Foundation in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. */ package fish.payara.nucleus.notification.admin; @@ -31,7 +53,9 @@ and Distribution License("CDDL") (collectively, the "License"). You import org.jvnet.hk2.annotations.Service; import javax.inject.Inject; +import java.util.ArrayList; import java.util.List; +import java.util.Properties; /** @@ -70,10 +94,16 @@ public void execute(AdminCommandContext context) { StringBuffer sb = new StringBuffer(); sb.append(strings.getLocalString("notifier.list.services.availability.info", "Available Notifier Services") + ":\n"); + + Properties extrasProps = new Properties(); + ArrayList names = new ArrayList(); for (ServiceHandle serviceHandle : allServiceHandles) { sb.append("\t" + serviceHandle.getActiveDescriptor().getName() + "\n"); + names.add(serviceHandle.getActiveDescriptor().getName()); } + extrasProps.put("avaliableServices", names); report.setMessage(sb.toString()); + report.setExtraProperties(extrasProps); report.setActionExitCode(ActionReport.ExitCode.SUCCESS); } } diff --git a/nucleus/payara-modules/requesttracing-core/src/main/java/fish/payara/nucleus/requesttracing/admin/GetRequestTracingConfiguration.java b/nucleus/payara-modules/requesttracing-core/src/main/java/fish/payara/nucleus/requesttracing/admin/GetRequestTracingConfiguration.java index edb63dd0d75..7afb8f02bad 100644 --- a/nucleus/payara-modules/requesttracing-core/src/main/java/fish/payara/nucleus/requesttracing/admin/GetRequestTracingConfiguration.java +++ b/nucleus/payara-modules/requesttracing-core/src/main/java/fish/payara/nucleus/requesttracing/admin/GetRequestTracingConfiguration.java @@ -1,19 +1,41 @@ /* - - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - - Copyright (c) 2016 Payara Foundation. All rights reserved. - - The contents of this file are subject to the terms of the Common Development - and Distribution License("CDDL") (collectively, the "License"). You - may not use this file except in compliance with the License. You can - obtain a copy of the License at - https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - or packager/legal/LICENSE.txt. See the License for the specific - language governing permissions and limitations under the License. - - When distributing the software, include this License Header Notice in each - file and include the License file at packager/legal/LICENSE.txt. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2016-2017 Payara Foundation and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://github.com/payara/Payara/blob/master/LICENSE.txt + * See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at glassfish/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * The Payara Foundation designates this particular file as subject to the "Classpath" + * exception as provided by the Payara Foundation in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. */ package fish.payara.nucleus.requesttracing.admin; From dc1c458ee0f357887bdc97b27096e8c117b53aeb Mon Sep 17 00:00:00 2001 From: Cousjava Date: Mon, 24 Apr 2017 14:40:09 +0100 Subject: [PATCH 2/6] PAYARA-1382 active notifiers now appear --- .../admingui/payara-console-extras/pom.xml | 51 ++++++++++++---- .../extras/rest/PayaraRestApiHandlers.java | 59 +++++++++++++++++++ .../requestTracing/requestTracing.jsf | 20 ++++--- 3 files changed, 112 insertions(+), 18 deletions(-) diff --git a/appserver/admingui/payara-console-extras/pom.xml b/appserver/admingui/payara-console-extras/pom.xml index b661ac9a2cc..ed896cbc1a1 100644 --- a/appserver/admingui/payara-console-extras/pom.xml +++ b/appserver/admingui/payara-console-extras/pom.xml @@ -1,20 +1,43 @@ 4.0.0 @@ -67,5 +90,11 @@ file and include the License file at packager/legal/LICENSE.txt. ${project.version} provided + + javax.json + javax.json-api + provided + 1.0 + diff --git a/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java b/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java index d8cd0a4cd9b..78e4ec73d48 100644 --- a/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java +++ b/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java @@ -20,12 +20,14 @@ import com.sun.jsftemplating.annotation.HandlerInput; import com.sun.jsftemplating.annotation.HandlerOutput; import com.sun.jsftemplating.layout.descriptors.handler.HandlerContext; +import java.io.StringReader; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.glassfish.admingui.common.util.GuiUtil; import org.glassfish.admingui.common.util.RestUtil; +import org.jboss.logging.Logger; /** * A class containing Payara specific handler methods for the REST API @@ -173,4 +175,61 @@ public static void sendAsadminCommandToSelectedInstances(HandlerContext handlerC public static void prepareSuccessfulCommandMsg(HandlerContext handlerCtx){ GuiUtil.prepareAlert("success", "Command sent successfully", null); } + + @Handler(id="py.sortEnabledNotifierStatus", + input={ + @HandlerInput(name="requestTracingNotifiers", type=String.class, required=true), + @HandlerInput(name="avaliableNotifiers", type=List.class, required=true )}, + output={ + @HandlerOutput(name="enabled", type=List.class), + @HandlerOutput(name="disabled", type=List.class)}) + public static void sortEnabledNotifierStatus(HandlerContext handlerctx){ + List enabled = new ArrayList(); + List disabled = new ArrayList(); + + List avaliable = (List) handlerctx.getInputValue("avaliableNotifiers"); + Logger logger = Logger.getLogger(PayaraRestApiHandlers.class); + logger.log(Logger.Level.ERROR, handlerctx.getInputValue("requestTracingNotifiers")); + + String notifiersString = (String) handlerctx.getInputValue("requestTracingNotifiers"); + notifiersString = notifiersString.substring(1, notifiersString.length() - 2); + String[] notifiers = notifiersString.split("\\}\\,"); + for (String notifier : notifiers){ + String name = notifier.split("notifierName=", 2)[1]; + //String name = longName.substring(1, longName.length()); + if (notifier.contains("notifierEnabled=true")){ + enabled.add(name); + } else { + disabled.add(name); + } + avaliable.remove(name); + } + for (String unused : avaliable){ + disabled.add(unused); + } + + logger.log(Logger.Level.ERROR, enabled.toString()); + logger.log(Logger.Level.ERROR, disabled.toString()); + handlerctx.setOutputValue("disabled", disabled); + handlerctx.setOutputValue("enabled", enabled); + /*JsonObject notifiers = Json.createReader(new StringReader((String) handlerctx.getInputValue("requestTracingNotifiers"))).readObject(); + for (int i = 0; i < notifiers.size(); i++){ + + JsonObject service = notifiers.getJsonObject((String)notifiers.keySet().toArray()[i]); + //JsonObject service = notifiers.get(i).asJsonObject(); + String name = service.getString("notifierName"); + if (service.getBoolean("notifierEnabled")){ + enabled.add(name); + } else { + disabled.add(name); + } + avaliable.remove(name); + } + for (String left : avaliable){ + disabled.add(left); + }*/ + + + + } } diff --git a/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf b/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf index 110f6ea567a..6504f8aaba6 100644 --- a/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf +++ b/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf @@ -78,12 +78,18 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. convertListToArray(list="#{requestScope.respAllNotifiers.data.extraProperties.avaliableServices}" array="#{pageSession.allNotifiersArray}"); gf.convertListToOptionArray(list="#{pageSession.allservices}", optionArray="#{pageSession.allNotifiers}"); } - if (! empty "#{pageSession.selectedNotifiersList}"){ - convertListToArray(list="#{pageSession.selectedNotifiersList}" array="#{pageSession.selectedNotifiers}"); - } - // convertStringtoList(str="#{requestScope.respAllNotifiers.data.extraProperties.avaliableServices}" result="#{pageSession.avaliableList}"); + //if (! empty "#{pageSession.selectedNotifiersList}"){ + // convertListToArray(list="#{pageSession.selectedNotifiersList}" array="#{pageSession.selectedNotifiers}"); + //} + //convertStringtoList(str="#{requestScope.respAllNotifiers.data.extraProperties.avaliableServices}" result="#{pageSession.avaliableList}"); //convertListToArray(list="#{pageSession.avaliableList}" array="#{pageSession.allNotifiers}"); - //gf.sortEnabledNotifierStatus(requestTracingNotifiers="#{requestScope.resp.data.subReports.get(0).extraProperties}" avaliableNotifiers="#{pageSession.avaliableList}" enabled="#{pageSession.enabledNotifiers} enabled="#{pageSession.disabledNotifiers}); + py.sortEnabledNotifierStatus(requestTracingNotifiers="#{requestScope.resp.data.subReports.get(0).extraProperties}" avaliableNotifiers="#{pageSession.allservices}" enabled="#{pageSession.enabledNotifiersList}" disabled="#{pageSession.disabledNotifiersList}"); + //gf.convertListToOptionArray(list="#{pageSession.enabledNotifiersList}", optionArray="#{pageSession.enabledNotifiers}"); + convertListToArray(list="#{pageSession.enabledNotifiersList}" array="#{pageSession.enabledNotifiersArr}"); + //gf.stringArrayToSelectItemArray(stringArray="#{requestScope.enabledNotifiersArr}" item="#{pageSession.enabledNotifiers}") + //gf.convertListToOptionArray(list="#{pageSession.disabledNotifiersList}", optionArray="#{pageSession.disabledNotifiers}"); + convertListToArray(list="#{pageSession.disabledNotifiersList}" array="#{pageSession.disabledNotifiersArr}"); + gf.stringArrayToSelectItemArray(stringArray="#{pageSession.disabledNotifiersArr}" item="#{pageSession.disabledNotifiers}"); setPageSessionAttribute(key="dynamic", value="true"); setPageSessionAttribute(key="notifierDynamic", value="true"); /> @@ -107,7 +113,7 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. gf.updateEntity(endpoint="#{pageSession.REQUEST_TRACING_CONFIG_URL}/set-requesttracing-configuration" attrs="#{pageSession.valueMap}" convertToFalse="#{pageSession.convertToFalseList}"); /> - + @@ -150,7 +156,7 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. From 3cbdb954fa040a3b9daf08f14ce30af71c1dbcf2 Mon Sep 17 00:00:00 2001 From: Cousjava Date: Mon, 24 Apr 2017 15:56:30 +0100 Subject: [PATCH 3/6] PAYARA-1382 can now save active notifiers configuration --- .../extras/rest/PayaraRestApiHandlers.java | 104 +++++++++++++----- .../requestTracing/requestTracing.jsf | 14 +-- 2 files changed, 75 insertions(+), 43 deletions(-) diff --git a/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java b/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java index 78e4ec73d48..25ac425b275 100644 --- a/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java +++ b/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java @@ -1,18 +1,41 @@ -/** +/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2016 Payara Foundation and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * Copyright (c) [2016-2017] Payara Foundation and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://github.com/payara/Payara/blob/master/LICENSE.txt + * See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at glassfish/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * The Payara Foundation designates this particular file as subject to the "Classpath" + * exception as provided by the Payara Foundation in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. */ package fish.payara.admingui.extras.rest; @@ -20,8 +43,8 @@ import com.sun.jsftemplating.annotation.HandlerInput; import com.sun.jsftemplating.annotation.HandlerOutput; import com.sun.jsftemplating.layout.descriptors.handler.HandlerContext; -import java.io.StringReader; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -212,24 +235,45 @@ public static void sortEnabledNotifierStatus(HandlerContext handlerctx){ logger.log(Logger.Level.ERROR, disabled.toString()); handlerctx.setOutputValue("disabled", disabled); handlerctx.setOutputValue("enabled", enabled); - /*JsonObject notifiers = Json.createReader(new StringReader((String) handlerctx.getInputValue("requestTracingNotifiers"))).readObject(); - for (int i = 0; i < notifiers.size(); i++){ - - JsonObject service = notifiers.getJsonObject((String)notifiers.keySet().toArray()[i]); - //JsonObject service = notifiers.get(i).asJsonObject(); - String name = service.getString("notifierName"); - if (service.getBoolean("notifierEnabled")){ - enabled.add(name); + + } + + /** + * Updates the request tracing notifiers to be enabled or disabled + * @param handlerCtx + */ + @Handler(id="py.updateRequesttracingNotifiers", + input={ + @HandlerInput(name="endpoint", type=String.class, required=true), + @HandlerInput(name="selected", type=String[].class, required=true), + @HandlerInput(name="notifiers", type=String[].class, required=true), + @HandlerInput(name="dynamic", type=Boolean.class, required=true), + @HandlerInput(name="quiet", type=boolean.class, defaultValue="false"), + @HandlerInput(name="throwException", type=boolean.class, defaultValue="true") + }) + public static void updateRequesttracingNotifiers(HandlerContext handlerCtx){ + String[] notifiers = (String[]) handlerCtx.getInputValue("notifiers"); + String[] enabled = (String[]) handlerCtx.getInputValue("selected"); + String endpoint = (String) handlerCtx.getInputValue("endpoint"); + Boolean dynamic = (Boolean) handlerCtx.getInputValue("dynamic"); + Boolean quiet = (Boolean) handlerCtx.getInputValue("quiet"); + Boolean throwException = (Boolean) handlerCtx.getInputValue("throwException"); + List enabledNotifiers = Arrays.asList(enabled); + for (String notifier : notifiers){ + String name = notifier.split("-")[1]; + String restEndpoint = endpoint + "/requesttracing-" + name + "-notifier-configure"; + HashMap attrs = new HashMap(); + if (enabledNotifiers.contains(notifier)){ + attrs.put("enabled", "true"); } else { - disabled.add(name); + attrs.put("enabled", "false"); } - avaliable.remove(name); + if (dynamic){ + attrs.put("dynamic", "true"); + } else { + attrs.put("dynamic", "false"); + } + RestUtil.restRequest(restEndpoint, attrs, "post", handlerCtx, quiet, throwException); } - for (String left : avaliable){ - disabled.add(left); - }*/ - - - } } diff --git a/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf b/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf index 6504f8aaba6..c6b0aec6963 100644 --- a/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf +++ b/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf @@ -67,27 +67,15 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. setPageSessionAttribute(key="notifierEnabledSelected", value="true") } - listAdd(list="#{pageSession.selectedNotifiersList}", value="Log" index="0"); if (#{pageSession.valueMap['historicalTraceEnabled']}=true) { setPageSessionAttribute(key="historicalTraceEnabled", value="true"); } - //if (not empty "#{requestScope.resp.data.subReports.get(0).extraProperties.getRequesttracingConfigurationLOG}"){ - // listAdd(list="#{pageSession.selectedNotifiersList}", value="Log" index="Log"); - //} if (not empty "#{requestScope.respAllNotifiers.data.extraProperties.avaliableservices}"){ convertListToArray(list="#{requestScope.respAllNotifiers.data.extraProperties.avaliableServices}" array="#{pageSession.allNotifiersArray}"); gf.convertListToOptionArray(list="#{pageSession.allservices}", optionArray="#{pageSession.allNotifiers}"); } - //if (! empty "#{pageSession.selectedNotifiersList}"){ - // convertListToArray(list="#{pageSession.selectedNotifiersList}" array="#{pageSession.selectedNotifiers}"); - //} - //convertStringtoList(str="#{requestScope.respAllNotifiers.data.extraProperties.avaliableServices}" result="#{pageSession.avaliableList}"); - //convertListToArray(list="#{pageSession.avaliableList}" array="#{pageSession.allNotifiers}"); py.sortEnabledNotifierStatus(requestTracingNotifiers="#{requestScope.resp.data.subReports.get(0).extraProperties}" avaliableNotifiers="#{pageSession.allservices}" enabled="#{pageSession.enabledNotifiersList}" disabled="#{pageSession.disabledNotifiersList}"); - //gf.convertListToOptionArray(list="#{pageSession.enabledNotifiersList}", optionArray="#{pageSession.enabledNotifiers}"); convertListToArray(list="#{pageSession.enabledNotifiersList}" array="#{pageSession.enabledNotifiersArr}"); - //gf.stringArrayToSelectItemArray(stringArray="#{requestScope.enabledNotifiersArr}" item="#{pageSession.enabledNotifiers}") - //gf.convertListToOptionArray(list="#{pageSession.disabledNotifiersList}", optionArray="#{pageSession.disabledNotifiers}"); convertListToArray(list="#{pageSession.disabledNotifiersList}" array="#{pageSession.disabledNotifiersArr}"); gf.stringArrayToSelectItemArray(stringArray="#{pageSession.disabledNotifiersArr}" item="#{pageSession.disabledNotifiers}"); setPageSessionAttribute(key="dynamic", value="true"); @@ -111,9 +99,9 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. value="#{pageSession.historicalTraceEnabled}"); prepareSuccessfulMsg(); gf.updateEntity(endpoint="#{pageSession.REQUEST_TRACING_CONFIG_URL}/set-requesttracing-configuration" attrs="#{pageSession.valueMap}" convertToFalse="#{pageSession.convertToFalseList}"); + py.updateRequesttracingNotifiers(endpoint="#{pageSession.REQUEST_TRACING_CONFIG_URL}" dynamic="#{pageSession.dynamic}" selected="#{pageSession.enabledNotifiersArr}" notifiers="#{pageSession.allNotifiersArray}"); /> - From 3529829ca1ff06eb6b8a22d2e6023e450e7b0dad Mon Sep 17 00:00:00 2001 From: Cousjava Date: Mon, 24 Apr 2017 15:59:55 +0100 Subject: [PATCH 4/6] Removed extraneous logging --- .../admingui/extras/rest/PayaraRestApiHandlers.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java b/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java index 25ac425b275..b455e1b6ddd 100644 --- a/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java +++ b/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java @@ -50,7 +50,6 @@ import java.util.Map; import org.glassfish.admingui.common.util.GuiUtil; import org.glassfish.admingui.common.util.RestUtil; -import org.jboss.logging.Logger; /** * A class containing Payara specific handler methods for the REST API @@ -211,8 +210,6 @@ public static void sortEnabledNotifierStatus(HandlerContext handlerctx){ List disabled = new ArrayList(); List avaliable = (List) handlerctx.getInputValue("avaliableNotifiers"); - Logger logger = Logger.getLogger(PayaraRestApiHandlers.class); - logger.log(Logger.Level.ERROR, handlerctx.getInputValue("requestTracingNotifiers")); String notifiersString = (String) handlerctx.getInputValue("requestTracingNotifiers"); notifiersString = notifiersString.substring(1, notifiersString.length() - 2); @@ -229,10 +226,7 @@ public static void sortEnabledNotifierStatus(HandlerContext handlerctx){ } for (String unused : avaliable){ disabled.add(unused); - } - - logger.log(Logger.Level.ERROR, enabled.toString()); - logger.log(Logger.Level.ERROR, disabled.toString()); + } handlerctx.setOutputValue("disabled", disabled); handlerctx.setOutputValue("enabled", enabled); From 54a87e25158edff9159481dfc0a9797b65dff8bd Mon Sep 17 00:00:00 2001 From: Cousjava Date: Tue, 25 Apr 2017 10:23:31 +0100 Subject: [PATCH 5/6] PAYARA-1574 admin console integration for selecting notifiers for healthheck service --- .../admingui/healthcheck/Strings.properties | 5 +- .../healthcheck/healthcheckConfiguration.jsf | 24 ++++++- .../extras/rest/PayaraRestApiHandlers.java | 64 ++++++++++++++++--- .../rest/UnknownConfigurationException.java | 48 ++++++++++++++ .../requestTracing/requestTracing.jsf | 6 +- 5 files changed, 133 insertions(+), 14 deletions(-) create mode 100644 appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/UnknownConfigurationException.java diff --git a/appserver/admingui/healthcheck-service-console-plugin/src/main/resources/fish/payara/admingui/healthcheck/Strings.properties b/appserver/admingui/healthcheck-service-console-plugin/src/main/resources/fish/payara/admingui/healthcheck/Strings.properties index aec4dcc8a70..615a2f4e04b 100644 --- a/appserver/admingui/healthcheck-service-console-plugin/src/main/resources/fish/payara/admingui/healthcheck/Strings.properties +++ b/appserver/admingui/healthcheck-service-console-plugin/src/main/resources/fish/payara/admingui/healthcheck/Strings.properties @@ -84,4 +84,7 @@ healthcheck.checker.configuration.hoggingThreads.retryCountLabel=Retry Count healthcheck.checker.configuration.hoggingThreads.retryCountLabelHelpText=Number of times to retry a thread before marking it as hogging. healthcheck.checker.configuration.garbageCollector.pageTitle=Garbage Collector -healthcheck.checker.configuration.garbageCollector.pageTitleHelpText=Configuration options for the Garbage Collector Healthcheck. \ No newline at end of file +healthcheck.checker.configuration.garbageCollector.pageTitleHelpText=Configuration options for the Garbage Collector Healthcheck. + +healthcheck.configuration.availableNotifiers=Avaliable Notifiers +healthcheck.configuration.selectedNotifiers=Selected Notifiers \ No newline at end of file diff --git a/appserver/admingui/healthcheck-service-console-plugin/src/main/resources/healthcheck/healthcheckConfiguration.jsf b/appserver/admingui/healthcheck-service-console-plugin/src/main/resources/healthcheck/healthcheckConfiguration.jsf index 8c2c3f4e738..00901d96c3b 100644 --- a/appserver/admingui/healthcheck-service-console-plugin/src/main/resources/healthcheck/healthcheckConfiguration.jsf +++ b/appserver/admingui/healthcheck-service-console-plugin/src/main/resources/healthcheck/healthcheckConfiguration.jsf @@ -36,7 +36,7 @@ setPageSessionAttribute(key="valueMap", value="#{requestScope.resp.data.extraProperties.healthcheckConfiguration}"); setPageSessionAttribute(key="valueNotifierMap", value="#{requestScope.resp.data.extraProperties.notifierListLOG}"); mapPut(map="#{pageSession.valueMap}" key="target" value="#{pageSession.configName}"); - + setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic", "historicalTraceEnabled", "notifierEnabled"}); if (#{pageSession.valueMap['enabled']}=true) { setPageSessionAttribute(key="enabledSelected", value="true"); @@ -49,6 +49,15 @@ } setPageSessionAttribute(key="dynamic", value="true"); + + gf.restRequest(endpoint="#{sessionScope.REST_URL}/notifier-list-services" method="GET" result="#{requestScope.respAllNotifiers}"); + setPageSessionAttribute(key="allservices", value="#{requestScope.respAllNotifiers.data.extraProperties.avaliableServices}"); + if (not empty "#{requestScope.respAllNotifiers.data.extraProperties.avaliableservices}"){ + convertListToArray(list="#{requestScope.respAllNotifiers.data.extraProperties.avaliableServices}" array="#{pageSession.allNotifiersArray}"); + gf.convertListToOptionArray(list="#{pageSession.allservices}", optionArray="#{pageSession.allNotifiers}"); + } + py.sortHealthcheckEnabledNotifierStatus(specifiedNotifiers="#{requestScope.resp.data.extraProperties}" avaliableNotifiers="#{pageSession.allservices}" enabled="#{pageSession.enabledNotifiersList}" disabled="#{pageSession.disabledNotifiersList}"); + convertListToArray(list="#{pageSession.enabledNotifiersList}" array="#{pageSession.enabledNotifiersArr}"); /> @@ -70,6 +79,7 @@ prepareSuccessfulMsg(); gf.updateEntity(endpoint="#{sessionScope.HEALTHCHECK_CONFIG_URL}/healthcheck-configure" attrs="#{pageSession.valueMap}" convertToFalse="#{pageSession.convertToFalseList}"); + py.updateNotifiers(endpoint="#{sessionScope.HEALTHCHECK_CONFIG_URL}" dynamic="#{pageSession.dynamic}" selected="#{pageSession.enabledNotifiersArr}" notifiers="#{pageSession.allNotifiersArray}"); /> @@ -106,6 +116,18 @@ text="#{pageSession.valueMap['historicalTraceStoreSize']}"/> + + + + + + + diff --git a/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java b/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java index b455e1b6ddd..951f00bd2bf 100644 --- a/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java +++ b/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/PayaraRestApiHandlers.java @@ -198,25 +198,64 @@ public static void prepareSuccessfulCommandMsg(HandlerContext handlerCtx){ GuiUtil.prepareAlert("success", "Command sent successfully", null); } - @Handler(id="py.sortEnabledNotifierStatus", + @Handler(id="py.sortRequestTracingEnabledNotifierStatus", input={ - @HandlerInput(name="requestTracingNotifiers", type=String.class, required=true), + @HandlerInput(name="specifiedNotifiers", type=String.class, required=true), @HandlerInput(name="avaliableNotifiers", type=List.class, required=true )}, output={ @HandlerOutput(name="enabled", type=List.class), @HandlerOutput(name="disabled", type=List.class)}) - public static void sortEnabledNotifierStatus(HandlerContext handlerctx){ + public static void sortRequestTracingEnabledNotifierStatus(HandlerContext handlerctx){ List enabled = new ArrayList(); List disabled = new ArrayList(); List avaliable = (List) handlerctx.getInputValue("avaliableNotifiers"); - String notifiersString = (String) handlerctx.getInputValue("requestTracingNotifiers"); + String notifiersString = (String) handlerctx.getInputValue("specifiedNotifiers"); notifiersString = notifiersString.substring(1, notifiersString.length() - 2); String[] notifiers = notifiersString.split("\\}\\,"); for (String notifier : notifiers){ String name = notifier.split("notifierName=", 2)[1]; - //String name = longName.substring(1, longName.length()); + if (notifier.contains("notifierEnabled=true")){ + enabled.add(name); + } else { + disabled.add(name); + } + avaliable.remove(name); + } + for (String unused : avaliable){ + disabled.add(unused); + } + handlerctx.setOutputValue("disabled", disabled); + handlerctx.setOutputValue("enabled", enabled); + + } + + @Handler(id="py.sortHealthcheckEnabledNotifierStatus", + input={ + @HandlerInput(name="specifiedNotifiers", type=String.class, required=true), + @HandlerInput(name="avaliableNotifiers", type=List.class, required=true )}, + output={ + @HandlerOutput(name="enabled", type=List.class), + @HandlerOutput(name="disabled", type=List.class)}) + public static void sortHealthcheckEnabledNotifierStatus(HandlerContext handlerctx){ + List enabled = new ArrayList(); + List disabled = new ArrayList(); + + List avaliable = (List) handlerctx.getInputValue("avaliableNotifiers"); + + String notifiersString = (String) handlerctx.getInputValue("specifiedNotifiers"); + notifiersString = notifiersString.substring(1, notifiersString.length() - 2); + + String[] notifiers = notifiersString.split("[\\}\\]]\\,"); + for (String notifier : notifiers){ + //Check to see if this is actually a notifier + notifier = notifier.trim(); + if (!notifier.startsWith("notifierList")){ + continue; + } + + String name = "service-" + notifier.split("notifierName=", 2)[1].toLowerCase(); if (notifier.contains("notifierEnabled=true")){ enabled.add(name); } else { @@ -236,7 +275,7 @@ public static void sortEnabledNotifierStatus(HandlerContext handlerctx){ * Updates the request tracing notifiers to be enabled or disabled * @param handlerCtx */ - @Handler(id="py.updateRequesttracingNotifiers", + @Handler(id="py.updateNotifiers", input={ @HandlerInput(name="endpoint", type=String.class, required=true), @HandlerInput(name="selected", type=String[].class, required=true), @@ -245,7 +284,7 @@ public static void sortEnabledNotifierStatus(HandlerContext handlerctx){ @HandlerInput(name="quiet", type=boolean.class, defaultValue="false"), @HandlerInput(name="throwException", type=boolean.class, defaultValue="true") }) - public static void updateRequesttracingNotifiers(HandlerContext handlerCtx){ + public static void updateNotifiers(HandlerContext handlerCtx) { String[] notifiers = (String[]) handlerCtx.getInputValue("notifiers"); String[] enabled = (String[]) handlerCtx.getInputValue("selected"); String endpoint = (String) handlerCtx.getInputValue("endpoint"); @@ -255,7 +294,16 @@ public static void updateRequesttracingNotifiers(HandlerContext handlerCtx){ List enabledNotifiers = Arrays.asList(enabled); for (String notifier : notifiers){ String name = notifier.split("-")[1]; - String restEndpoint = endpoint + "/requesttracing-" + name + "-notifier-configure"; + String restEndpoint; + if (endpoint.contains("request-tracing-service-configuration")){ + restEndpoint = endpoint + "/requesttracing-" + name + "-notifier-configure"; + } else if (endpoint.contains("health-check-service-configuration")){ + restEndpoint = endpoint + "/healthcheck-" + name + "-notifier-configure"; + } else { + //Unknown service being configured + throw new UnknownConfigurationException(); + } + HashMap attrs = new HashMap(); if (enabledNotifiers.contains(notifier)){ attrs.put("enabled", "true"); diff --git a/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/UnknownConfigurationException.java b/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/UnknownConfigurationException.java new file mode 100644 index 00000000000..254edbfcff6 --- /dev/null +++ b/appserver/admingui/payara-console-extras/src/main/java/fish/payara/admingui/extras/rest/UnknownConfigurationException.java @@ -0,0 +1,48 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) [2017] Payara Foundation and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://github.com/payara/Payara/blob/master/LICENSE.txt + * See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at glassfish/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * The Payara Foundation designates this particular file as subject to the "Classpath" + * exception as provided by the Payara Foundation in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package fish.payara.admingui.extras.rest; + +/** + * + * @author jonathan coustick + */ +public class UnknownConfigurationException extends RuntimeException { + +} diff --git a/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf b/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf index c6b0aec6963..62e02bc0958 100644 --- a/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf +++ b/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf @@ -74,10 +74,8 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. convertListToArray(list="#{requestScope.respAllNotifiers.data.extraProperties.avaliableServices}" array="#{pageSession.allNotifiersArray}"); gf.convertListToOptionArray(list="#{pageSession.allservices}", optionArray="#{pageSession.allNotifiers}"); } - py.sortEnabledNotifierStatus(requestTracingNotifiers="#{requestScope.resp.data.subReports.get(0).extraProperties}" avaliableNotifiers="#{pageSession.allservices}" enabled="#{pageSession.enabledNotifiersList}" disabled="#{pageSession.disabledNotifiersList}"); + py.sortRequestTracingEnabledNotifierStatus(specifiedNotifiers="#{requestScope.resp.data.subReports.get(0).extraProperties}" avaliableNotifiers="#{pageSession.allservices}" enabled="#{pageSession.enabledNotifiersList}" disabled="#{pageSession.disabledNotifiersList}"); convertListToArray(list="#{pageSession.enabledNotifiersList}" array="#{pageSession.enabledNotifiersArr}"); - convertListToArray(list="#{pageSession.disabledNotifiersList}" array="#{pageSession.disabledNotifiersArr}"); - gf.stringArrayToSelectItemArray(stringArray="#{pageSession.disabledNotifiersArr}" item="#{pageSession.disabledNotifiers}"); setPageSessionAttribute(key="dynamic", value="true"); setPageSessionAttribute(key="notifierDynamic", value="true"); /> @@ -99,7 +97,7 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. value="#{pageSession.historicalTraceEnabled}"); prepareSuccessfulMsg(); gf.updateEntity(endpoint="#{pageSession.REQUEST_TRACING_CONFIG_URL}/set-requesttracing-configuration" attrs="#{pageSession.valueMap}" convertToFalse="#{pageSession.convertToFalseList}"); - py.updateRequesttracingNotifiers(endpoint="#{pageSession.REQUEST_TRACING_CONFIG_URL}" dynamic="#{pageSession.dynamic}" selected="#{pageSession.enabledNotifiersArr}" notifiers="#{pageSession.allNotifiersArray}"); + py.updateNotifiers(endpoint="#{pageSession.REQUEST_TRACING_CONFIG_URL}" dynamic="#{pageSession.dynamic}" selected="#{pageSession.enabledNotifiersArr}" notifiers="#{pageSession.allNotifiersArray}"); /> From 04ee6b73e8e1b9237a280115fbc2dbd38948a06b Mon Sep 17 00:00:00 2001 From: Cousjava Date: Thu, 27 Apr 2017 11:54:32 +0100 Subject: [PATCH 6/6] Removed log notifier checkbox. Also deprecated notiferenabled argument for asadmin command as now there are the notifer configure commands --- .../healthcheck/healthcheckConfiguration.jsf | 41 ++++++++++++------- .../requestTracing/requestTracing.jsf | 9 ---- .../admin/HealthCheckConfigurer.java | 3 +- .../admin/SetRequestTracingConfiguration.java | 7 +++- 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/appserver/admingui/healthcheck-service-console-plugin/src/main/resources/healthcheck/healthcheckConfiguration.jsf b/appserver/admingui/healthcheck-service-console-plugin/src/main/resources/healthcheck/healthcheckConfiguration.jsf index 00901d96c3b..0d2ab565086 100644 --- a/appserver/admingui/healthcheck-service-console-plugin/src/main/resources/healthcheck/healthcheckConfiguration.jsf +++ b/appserver/admingui/healthcheck-service-console-plugin/src/main/resources/healthcheck/healthcheckConfiguration.jsf @@ -5,16 +5,38 @@ Copyright (c) 2017 Payara Foundation and/or its affiliatess. All rights reserved. - The contents of this file are subject to the terms of the Common Development + The contents of this file are subject to the terms of either the GNU + General Public License Version 2 only ("GPL") or the Common Development and Distribution License("CDDL") (collectively, the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the License at - https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - or packager/legal/LICENSE.txt. See the License for the specific + https://github.com/payara/Payara/blob/master/LICENSE.txt + See the License for the specific language governing permissions and limitations under the License. When distributing the software, include this License Header Notice in each - file and include the License file at packager/legal/LICENSE.txt. + file and include the License file at glassfish/legal/LICENSE.txt. + + GPL Classpath Exception: + The Payara Foundation designates this particular file as subject to the "Classpath" + exception as provided by the Payara Foundation in the GPL Version 2 section of the License + file that accompanied this code. + + Modifications: + If applicable, add the following below the License Header, with the fields + enclosed by brackets [] replaced by your own identifying information: + Portions Copyright [year] [name of copyright owner]" + Contributor(s): + If you wish your version of this file to be governed by only the CDDL or + only the GPL Version 2, indicate your decision by adding "[Contributor] + elects to include this software in this distribution under the [CDDL or GPL + Version 2] license." If you don't indicate a single choice of license, a + recipient has the option to distribute your version of this file under + either the CDDL, the GPL Version 2 or to extend the choice of license to + its licensees as provided above. However, if you add GPL Version 2 code + and therefore, elected the GPL Version 2 license, then the option applies + only if the new code is made subject to such option by the copyright + holder. --> - - - diff --git a/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf b/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf index 62e02bc0958..ed311f3982f 100644 --- a/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf +++ b/appserver/admingui/payara-console-extras/src/main/resources/requestTracing/requestTracing.jsf @@ -55,7 +55,6 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. gf.restRequest(endpoint="#{pageSession.REQUEST_TRACING_CONFIG_URL}/get-requesttracing-configuration?target=#{pageSession.configName}" method="GET" result="#{requestScope.resp}"); setPageSessionAttribute(key="valueMap", value="#{requestScope.resp.data.extraProperties.requestTracingConfiguration}"); mapPut(map="#{pageSession.valueMap}" key="target" value="#{pageSession.configName}"); - setPageSessionAttribute(key="logNotifierValueMap", value="#{requestScope.resp.data.subReports.get(0).extraProperties.getRequesttracingConfigurationLOG}"); gf.restRequest(endpoint="#{sessionScope.REST_URL}/notifier-list-services" method="GET" result="#{requestScope.respAllNotifiers}"); setPageSessionAttribute(key="allservices", value="#{requestScope.respAllNotifiers.data.extraProperties.avaliableServices}"); @@ -63,10 +62,6 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. if (#{pageSession.valueMap['enabled']}=true) { setPageSessionAttribute(key="enabledSelected", value="true"); } - if (#{pageSession.logNotifierValueMap['notifierEnabled']}=true) { - setPageSessionAttribute(key="notifierEnabledSelected", value="true") - - } if (#{pageSession.valueMap['historicalTraceEnabled']}=true) { setPageSessionAttribute(key="historicalTraceEnabled", value="true"); } @@ -90,7 +85,6 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. onClick="if (guiValidate('#{reqMsg}','#{reqInt}','#{reqPort}')) submitAndDisable(this, '$resource{i18n.button.Processing}'); return false;" > - - - diff --git a/nucleus/payara-modules/healthcheck-core/src/main/java/fish/payara/nucleus/healthcheck/admin/HealthCheckConfigurer.java b/nucleus/payara-modules/healthcheck-core/src/main/java/fish/payara/nucleus/healthcheck/admin/HealthCheckConfigurer.java index 5e9a9cc1874..c554c8d809d 100644 --- a/nucleus/payara-modules/healthcheck-core/src/main/java/fish/payara/nucleus/healthcheck/admin/HealthCheckConfigurer.java +++ b/nucleus/payara-modules/healthcheck-core/src/main/java/fish/payara/nucleus/healthcheck/admin/HealthCheckConfigurer.java @@ -110,7 +110,8 @@ public class HealthCheckConfigurer implements AdminCommand { @Param(name = "enabled") private Boolean enabled; - @Param(name = "notifierEnabled") + @Deprecated + @Param(name = "notifierEnabled", optional = true) private Boolean notifierEnabled; @Param(name = "historicalTraceEnabled", optional = true) diff --git a/nucleus/payara-modules/requesttracing-core/src/main/java/fish/payara/nucleus/requesttracing/admin/SetRequestTracingConfiguration.java b/nucleus/payara-modules/requesttracing-core/src/main/java/fish/payara/nucleus/requesttracing/admin/SetRequestTracingConfiguration.java index b1d3159378b..fdaef2f0486 100644 --- a/nucleus/payara-modules/requesttracing-core/src/main/java/fish/payara/nucleus/requesttracing/admin/SetRequestTracingConfiguration.java +++ b/nucleus/payara-modules/requesttracing-core/src/main/java/fish/payara/nucleus/requesttracing/admin/SetRequestTracingConfiguration.java @@ -81,7 +81,8 @@ public class SetRequestTracingConfiguration implements AdminCommand { @Param(name = "notifierDynamic", optional = true, defaultValue = "false") private Boolean notifierDynamic; - @Param(name = "notifierEnabled") + @Deprecated + @Param(name = "notifierEnabled", optional = true) private Boolean notifierEnabled; @Param(name = "historicalTraceEnabled", optional = true) @@ -151,7 +152,9 @@ private void enableRequestTracingNotifierConfigurerOnTarget(ActionReport actionR ParameterMap params = new ParameterMap(); params.add("dynamic", notifierDynamic.toString()); params.add("target", target); - params.add("enabled", notifierEnabled.toString()); + if (notifierEnabled != null) { + params.add("enabled", notifierEnabled.toString()); + } inv.parameters(params); inv.execute(); // swallow the offline warning as it is not a problem