Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-1382, PAYARA-1574 admin console notifiers integration #1557

Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,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.
healthcheck.checker.configuration.garbageCollector.pageTitleHelpText=Configuration options for the Garbage Collector Healthcheck.

healthcheck.configuration.availableNotifiers=Avaliable Notifiers
healthcheck.configuration.selectedNotifiers=Selected Notifiers
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,26 @@
gf.restRequest(endpoint="#{sessionScope.HEALTHCHECK_CONFIG_URL}/get-healthcheck-configuration?target=#{pageSession.configName}"
method="GET" result="#{requestScope.resp}");
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}");

mapPut(map="#{pageSession.valueMap}" key="target" value="#{pageSession.configName}");
setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic", "historicalTraceEnabled"});
py.getHistoricHealthcheckMessages(parentEndpoint="#{sessionScope.HEALTHCHECK_CONFIG_URL}", result="#{requestScope.historic}");
setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic", "historicalTraceEnabled", "notifierEnabled"});
if (#{pageSession.valueMap['enabled']}=true) {
setPageSessionAttribute(key="enabledSelected", value="true");
}
if (#{pageSession.valueMap['historicalTraceEnabled']}=true) {
setPageSessionAttribute(key="historicalTraceEnabledSelected", value="true");
}
if (#{pageSession.valueNotifierMap['notifierEnabled']}=true) {
setPageSessionAttribute(key="notifierEnabledSelected", value="true");
}

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}");
/>
</event>

Expand All @@ -93,6 +97,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}");
/>
</sun:button>
</sun:panelGroup>
Expand All @@ -106,11 +111,6 @@
helpText="$resource{i18nhx.healthcheck.configuration.enabledLabelHelpText}">
<sun:checkbox id="enabledBox" selected="#{pageSession.enabledSelected}" selectedValue="true" />
</sun:property>
<sun:property id="logNotifierEnabledProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.configuration.logNotifierEnabled}"
helpText="$resource{i18nhx.healthcheck.configuration.logNotifierEnabledHelp}">
<sun:checkbox id="logNotifierEnabledLabel" selected="#{pageSession.notifierEnabledSelected}" selectedValue="true" />
</sun:property>
<sun:property id="dynamicProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.configuration.dynamicLabel}"
helpText="$resource{i18nhx.healthcheck.configuration.dynamicLabelHelpText}">
Expand All @@ -129,7 +129,20 @@
text="#{pageSession.valueMap['historicalTraceStoreSize']}"/>
</sun:property>
</sun:propertySheetSection>
<sun:propertySheetSection>

<sun:propertySheetSection id="notifiers">
<sun:property id="avaliableNotifiers" labelAlign="left" noWrap="#{true}" overlapLabel="#{true}">
<sun:addRemove id="notifiersAddRemove"
selectAll="$boolean{true}"
items="#{pageSession.allNotifiers}"
selected="#{pageSession.enabledNotifiersArr}"
availableItemsLabel="$resource{i18nhx.healthcheck.configuration.availableNotifiers}"
selectedItemsLabel="$resource{i18nhx.healthcheck.configuration.selectedNotifiers}">
</sun:addRemove>
</sun:property>
</sun:propertySheetSection>

<sun:propertySheetSection id="histroic">
<sun:property>
<sun:table id="historicHealthcheckTable" title="$resource{i18nhx.healthcheck.historic.table.name}" >
<sun:tableRowGroup id="historicHealthcheckRowGroup" data={"$attribute{historic}"} sourceVar="td"
Expand Down
51 changes: 40 additions & 11 deletions appserver/admingui/payara-console-extras/pom.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

Copyright (c) 2016 Payara Foundation. All rights reserved.
Copyright (c) [2016-2017] 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.
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 packager/legal/LICENSE.txt.
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -67,5 +90,11 @@ file and include the License file at packager/legal/LICENSE.txt.
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<scope>provided</scope>
<version>1.0</version>
</dependency>
</dependencies>
</project>
Loading