Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
/*
* InstanceHandler.java
*
* Created on August 10, 2006, 2:32 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
/**
*
* @author anilam
*/
package org.glassfish.admingui.common.handlers;
import com.sun.jsftemplating.annotation.Handler;
import com.sun.jsftemplating.annotation.HandlerInput;
import com.sun.jsftemplating.annotation.HandlerOutput;
import com.sun.jsftemplating.layout.descriptors.handler.HandlerContext;
import java.util.Map;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.logging.Level;
import org.glassfish.admingui.common.util.GuiUtil;
import org.glassfish.admingui.common.util.RestUtil;
public class LoggingHandlers {
/** Creates a new instance of InstanceHandler */
public LoggingHandlers() {
}
@Handler(id = "getLoggerLevels",
input = {
@HandlerInput(name = "loggerLevels", type = Map.class, required = true)},
output = {
@HandlerOutput(name = "loggerList", type = List.class)
})
public static void getLoggerLevels(HandlerContext handlerCtx) {
Map loggerLevels = (Map) handlerCtx.getInputValue("loggerLevels");
List result = new ArrayList();
if (loggerLevels != null) {
for(Map.Entry e : loggerLevels.entrySet()){
Map oneRow = new HashMap();
oneRow.put("loggerName", e.getKey());
oneRow.put("level", e.getValue());
oneRow.put("selected", false);
result.add(oneRow);
}
}
handlerCtx.setOutputValue("loggerList", result);
}
@Handler(id = "changeLoggerLevels",
input = {
@HandlerInput(name = "newLogLevel", type = String.class, required = true),
@HandlerInput(name = "allRows", type = List.class, required = true)},
output = {
@HandlerOutput(name = "newList", type = List.class)})
public static void changeLoggerLevels(HandlerContext handlerCtx) {
String newLogLevel = (String) handlerCtx.getInputValue("newLogLevel");
List obj = (List) handlerCtx.getInputValue("allRows");
List