Search in sources :

Example 1 with UpdateServiceConfigurationPermission

use of org.eclipse.scout.rt.shared.security.UpdateServiceConfigurationPermission in project scout.rt by eclipse.

the class GeneralView method createMonitoringQuickLink.

private String createMonitoringQuickLink(HtmlComponent p) {
    if (!ACCESS.check(new UpdateServiceConfigurationPermission())) {
        return null;
    }
    final ProcessInspector inst = ProcessInspector.instance();
    if (inst.isEnabled()) {
        p.print("Monitor is active with maximum caching of " + (inst.getTimeout() / 1000 / 60) + " minutes [ ");
        p.linkAction("cache 2 min", new P_SetTimeoutAction(2));
        p.print(" | ");
        p.linkAction("cache 15 min", new P_SetTimeoutAction(15));
        p.print(" | ");
        p.linkAction("cache 60 min", new P_SetTimeoutAction(60));
        p.print(" | ");
        p.linkAction("deactivate", new P_EnableAction(false));
        p.print(" ]");
        p.br();
        if (inst.acceptCall(IPingService.class.getName(), "ping")) {
            p.linkAction("IPingService.ping (click to toggle)", new AbstractHtmlAction("IPingService.ignore") {

                @Override
                public void run() {
                    inst.getIgnoredCallSet().clear();
                    inst.getIgnoredCallSet().add(".*\\.IPingService\\.ping");
                }
            });
        } else {
            p.startLinkAction(new AbstractHtmlAction("IPingService.accept") {

                @Override
                public void run() {
                    inst.getIgnoredCallSet().clear();
                }
            });
            p.raw("<s>");
            p.printNoBreak("IPingService.ping");
            p.raw("</s>");
            p.printNoBreak(" (click to toggle)");
            p.endLinkAction();
        }
    } else {
        p.print("Monitor is inactive [ ");
        p.linkAction("activate", new P_EnableAction(true));
        p.print(" ]");
    }
    p.p();
    if (inst.isEnabled()) {
        return "<p><b>Note: Session Activity Monitor is enabled; this might affect performance and memory due to higher resource consumption during analysis.</b><p>";
    }
    return null;
}
Also used : UpdateServiceConfigurationPermission(org.eclipse.scout.rt.shared.security.UpdateServiceConfigurationPermission) AbstractHtmlAction(org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction) IPingService(org.eclipse.scout.rt.shared.services.common.ping.IPingService) ProcessInspector(org.eclipse.scout.rt.server.admin.inspector.ProcessInspector)

Aggregations

AbstractHtmlAction (org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction)1 ProcessInspector (org.eclipse.scout.rt.server.admin.inspector.ProcessInspector)1 UpdateServiceConfigurationPermission (org.eclipse.scout.rt.shared.security.UpdateServiceConfigurationPermission)1 IPingService (org.eclipse.scout.rt.shared.services.common.ping.IPingService)1