Search in sources :

Example 6 with ConfigServerImpl

use of lucee.runtime.config.ConfigServerImpl in project Lucee by lucee.

the class Admin method doListAuthKey.

private void doListAuthKey() throws PageException {
    ConfigServerImpl cs = (ConfigServerImpl) config;
    pageContext.setVariable(getString("admin", action, "returnVariable"), Caster.toArray(cs.getAuthenticationKeys()));
}
Also used : ConfigServerImpl(lucee.runtime.config.ConfigServerImpl)

Example 7 with ConfigServerImpl

use of lucee.runtime.config.ConfigServerImpl in project Lucee by lucee.

the class Admin method doGetMonitors.

private void doGetMonitors() throws PageException {
    if (!(config instanceof ConfigServerImpl))
        throw new ApplicationException("invalid context for this action");
    ConfigServerImpl cs = (ConfigServerImpl) config;
    IntervallMonitor[] intervalls = cs.getIntervallMonitors();
    RequestMonitor[] requests = cs.getRequestMonitors();
    lucee.runtime.type.Query qry = new QueryImpl(new Collection.Key[] { KeyConstants._name, KeyConstants._type, LOG_ENABLED, CLASS }, 0, "monitors");
    doGetMonitors(qry, intervalls);
    doGetMonitors(qry, requests);
    pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
}
Also used : IntervallMonitor(lucee.runtime.monitor.IntervallMonitor) QueryImpl(lucee.runtime.type.QueryImpl) ApplicationException(lucee.runtime.exp.ApplicationException) BundleCollection(lucee.loader.osgi.BundleCollection) Collection(lucee.runtime.type.Collection) ConfigServerImpl(lucee.runtime.config.ConfigServerImpl) Query(lucee.runtime.type.Query) RequestMonitor(lucee.runtime.monitor.RequestMonitor)

Example 8 with ConfigServerImpl

use of lucee.runtime.config.ConfigServerImpl in project Lucee by lucee.

the class Admin method doGetContexts.

/**
 * @throws PageException
 */
private void doGetContexts() throws PageException {
    CFMLFactory[] factories;
    if (config instanceof ConfigServerImpl) {
        ConfigServerImpl cs = (ConfigServerImpl) config;
        factories = cs.getJSPFactories();
    } else {
        ConfigWebImpl cw = (ConfigWebImpl) config;
        factories = new CFMLFactory[] { cw.getFactory() };
    }
    lucee.runtime.type.Query qry = new QueryImpl(new Collection.Key[] { KeyConstants._path, KeyConstants._id, KeyConstants._hash, KeyConstants._label, HAS_OWN_SEC_CONTEXT, KeyConstants._url, CONFIG_FILE, CLIENT_SIZE, CLIENT_ELEMENTS, SESSION_SIZE, SESSION_ELEMENTS }, factories.length, getString("admin", action, "returnVariable"));
    pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
    ConfigWebImpl cw;
    for (int i = 0; i < factories.length; i++) {
        int row = i + 1;
        CFMLFactoryImpl factory = (CFMLFactoryImpl) factories[i];
        cw = (ConfigWebImpl) factory.getConfig();
        qry.setAtEL(KeyConstants._path, row, ReqRspUtil.getRootPath(factory.getConfigWebImpl().getServletContext()));
        qry.setAtEL(CONFIG_FILE, row, factory.getConfigWebImpl().getConfigFile().getAbsolutePath());
        if (factory.getURL() != null)
            qry.setAtEL(KeyConstants._url, row, factory.getURL().toExternalForm());
        qry.setAtEL(KeyConstants._id, row, factory.getConfig().getIdentification().getId());
        qry.setAtEL(KeyConstants._hash, row, SystemUtil.hash(factory.getConfigWebImpl().getServletContext()));
        qry.setAtEL(KeyConstants._label, row, factory.getLabel());
        qry.setAtEL(HAS_OWN_SEC_CONTEXT, row, Caster.toBoolean(cw.hasIndividualSecurityManager()));
        setScopeDirInfo(qry, row, CLIENT_SIZE, CLIENT_ELEMENTS, cw.getClientScopeDir());
        setScopeDirInfo(qry, row, SESSION_SIZE, SESSION_ELEMENTS, cw.getSessionScopeDir());
    }
}
Also used : ConfigWebImpl(lucee.runtime.config.ConfigWebImpl) QueryImpl(lucee.runtime.type.QueryImpl) CFMLFactoryImpl(lucee.runtime.CFMLFactoryImpl) BundleCollection(lucee.loader.osgi.BundleCollection) Collection(lucee.runtime.type.Collection) CFMLFactory(lucee.runtime.CFMLFactory) ConfigServerImpl(lucee.runtime.config.ConfigServerImpl) Query(lucee.runtime.type.Query)

Example 9 with ConfigServerImpl

use of lucee.runtime.config.ConfigServerImpl in project Lucee by lucee.

the class Admin method doGetMonitor.

private void doGetMonitor() throws PageException {
    if (!(config instanceof ConfigServerImpl))
        throw new ApplicationException("invalid context for this action");
    ConfigServerImpl cs = (ConfigServerImpl) config;
    String type = getString("admin", action, "monitorType");
    String name = getString("admin", action, "name");
    type = type.trim();
    Monitor m;
    if ("request".equalsIgnoreCase(type))
        m = cs.getRequestMonitor(name);
    else
        m = cs.getIntervallMonitor(name);
    Struct sct = new StructImpl();
    sct.setEL(KeyConstants._name, m.getName());
    sct.setEL(KeyConstants._type, m.getType() == Monitor.TYPE_INTERVAL ? "intervall" : "request");
    sct.setEL(LOG_ENABLED, m.isLogEnabled());
    sct.setEL(CLASS, m.getClazz().getName());
    pageContext.setVariable(getString("admin", action, "returnVariable"), sct);
}
Also used : ApplicationException(lucee.runtime.exp.ApplicationException) RequestMonitor(lucee.runtime.monitor.RequestMonitor) Monitor(lucee.runtime.monitor.Monitor) IntervallMonitor(lucee.runtime.monitor.IntervallMonitor) StructImpl(lucee.runtime.type.StructImpl) ConfigServerImpl(lucee.runtime.config.ConfigServerImpl) Struct(lucee.runtime.type.Struct)

Aggregations

ConfigServerImpl (lucee.runtime.config.ConfigServerImpl)9 Resource (lucee.commons.io.res.Resource)2 BundleCollection (lucee.loader.osgi.BundleCollection)2 CFMLFactory (lucee.runtime.CFMLFactory)2 CFMLFactoryImpl (lucee.runtime.CFMLFactoryImpl)2 ApplicationException (lucee.runtime.exp.ApplicationException)2 IntervallMonitor (lucee.runtime.monitor.IntervallMonitor)2 RequestMonitor (lucee.runtime.monitor.RequestMonitor)2 Collection (lucee.runtime.type.Collection)2 Query (lucee.runtime.type.Query)2 QueryImpl (lucee.runtime.type.QueryImpl)2 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 ServletContext (javax.servlet.ServletContext)1 ConfigWeb (lucee.runtime.config.ConfigWeb)1 ConfigWebImpl (lucee.runtime.config.ConfigWebImpl)1 Monitor (lucee.runtime.monitor.Monitor)1 Struct (lucee.runtime.type.Struct)1 StructImpl (lucee.runtime.type.StructImpl)1