sirius.web.health.console.ConsoleService Maven / Gradle / Ivy
/*
* Made with all the love in the world
* by scireum in Remshalden, Germany
*
* Copyright by scireum GmbH
* http://www.scireum.de - [email protected]
*/
package sirius.web.health.console;
import sirius.kernel.commons.Strings;
import sirius.kernel.commons.Watch;
import sirius.kernel.di.GlobalContext;
import sirius.kernel.di.std.Context;
import sirius.kernel.di.std.Register;
import sirius.kernel.health.Exceptions;
import sirius.kernel.health.console.Command;
import sirius.kernel.nls.NLS;
import sirius.kernel.xml.StructuredOutput;
import sirius.web.health.SystemController;
import sirius.web.security.Permission;
import sirius.web.services.ServiceCall;
import sirius.web.services.StructuredService;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
import java.util.Map;
/**
* Provides the glue logic between the system console UI and the {@link Command}s.
*/
@Register(name = "system/console")
@Permission(SystemController.PERMISSION_SYSTEM_CONSOLE)
public class ConsoleService implements StructuredService {
@Context
private GlobalContext ctx;
@Override
@SuppressWarnings("unchecked")
public void call(ServiceCall call, StructuredOutput out) throws Exception {
out.beginResult();
try {
Watch w = Watch.start();
Map map = call.getContext().getJSONContent();
String command = (String) map.get("method");
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy