Search in sources :

Example 21 with Javalin

use of io.javalin.Javalin in project micrometer by micrometer-metrics.

the class MicrometerPlugin method main.

public static void main(String[] args) {
    PrometheusMeterRegistry meterRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
    // add any tags here that will apply to all metrics streaming from this app
    // (e.g. EC2 region, stack, instance id, server group)
    meterRegistry.config().commonTags("app", "javalin-sample");
    new JvmGcMetrics().bindTo(meterRegistry);
    new JvmHeapPressureMetrics().bindTo(meterRegistry);
    new JvmMemoryMetrics().bindTo(meterRegistry);
    new ProcessorMetrics().bindTo(meterRegistry);
    new FileDescriptorMetrics().bindTo(meterRegistry);
    Javalin app = Javalin.create(config -> config.registerPlugin(new MicrometerPlugin(meterRegistry))).start(8080);
    // must manually delegate to Micrometer exception handler for excepton tags to be
    // correct
    app.exception(IllegalArgumentException.class, (e, ctx) -> {
        MicrometerPlugin.EXCEPTION_HANDLER.handle(e, ctx);
        e.printStackTrace();
    });
    app.get("/", ctx -> ctx.result("Hello World"));
    app.get("/hello/:name", ctx -> ctx.result("Hello: " + ctx.pathParam("name")));
    app.get("/boom", ctx -> {
        throw new IllegalArgumentException("boom");
    });
    app.routes(() -> {
        path("hi", () -> {
            get(":name", ctx -> ctx.result("Hello: " + ctx.pathParam("name")));
        });
    });
    app.after("/hello/*", ctx -> {
        System.out.println("hello");
    });
    app.get("/prometheus", ctx -> ctx.contentType(TextFormat.CONTENT_TYPE_004).result(meterRegistry.scrape()));
}
Also used : PrometheusMeterRegistry(io.micrometer.prometheus.PrometheusMeterRegistry) Javalin(io.javalin.Javalin) ProcessorMetrics(io.micrometer.core.instrument.binder.system.ProcessorMetrics) HandlerEntry(io.javalin.http.HandlerEntry) TimedHandler(io.micrometer.core.instrument.binder.jetty.TimedHandler) Javalin(io.javalin.Javalin) JettyConnectionMetrics(io.micrometer.core.instrument.binder.jetty.JettyConnectionMetrics) JvmGcMetrics(io.micrometer.core.instrument.binder.jvm.JvmGcMetrics) ExceptionHandler(io.javalin.http.ExceptionHandler) JvmMemoryMetrics(io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics) NonNull(io.micrometer.common.lang.NonNull) StringUtils(io.micrometer.common.util.StringUtils) HttpServletRequest(javax.servlet.http.HttpServletRequest) TextFormat(io.prometheus.client.exporter.common.TextFormat) Server(org.eclipse.jetty.server.Server) FileDescriptorMetrics(io.micrometer.core.instrument.binder.system.FileDescriptorMetrics) Tag(io.micrometer.core.instrument.Tag) Tags(io.micrometer.core.instrument.Tags) HttpServletResponse(javax.servlet.http.HttpServletResponse) JvmHeapPressureMetrics(io.micrometer.core.instrument.binder.jvm.JvmHeapPressureMetrics) HandlerType(io.javalin.http.HandlerType) DefaultHttpServletRequestTagsProvider(io.micrometer.core.instrument.binder.http.DefaultHttpServletRequestTagsProvider) MeterRegistry(io.micrometer.core.instrument.MeterRegistry) PrometheusMeterRegistry(io.micrometer.prometheus.PrometheusMeterRegistry) JettyServerThreadPoolMetrics(io.micrometer.core.instrument.binder.jetty.JettyServerThreadPoolMetrics) ApiBuilder.get(io.javalin.apibuilder.ApiBuilder.get) ApiBuilder.path(io.javalin.apibuilder.ApiBuilder.path) Plugin(io.javalin.core.plugin.Plugin) PrometheusConfig(io.micrometer.prometheus.PrometheusConfig) ProcessorMetrics(io.micrometer.core.instrument.binder.system.ProcessorMetrics) JvmHeapPressureMetrics(io.micrometer.core.instrument.binder.jvm.JvmHeapPressureMetrics) FileDescriptorMetrics(io.micrometer.core.instrument.binder.system.FileDescriptorMetrics) JvmMemoryMetrics(io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics) JvmGcMetrics(io.micrometer.core.instrument.binder.jvm.JvmGcMetrics)

Example 22 with Javalin

use of io.javalin.Javalin in project cineast by vitrivr.

the class APIEndpoint method dispatchService.

/**
 * Dispatches a new Jetty {@link Javalin} (HTTP endpoint). The method takes care of all the necessary setup.
 *
 * @param secure If true, the new Service will be setup as secure with TLS enabled.
 * @return {@link Javalin}
 */
public Javalin dispatchService(boolean secure) {
    final APIConfig config = Config.sharedConfig().getApi();
    final int port = this.validateAndNormalizePort(secure, config);
    final Javalin service = Javalin.create(serviceConfig -> {
        /* Default return mime */
        serviceConfig.defaultContentType = "application/json";
        /* Prefer 405 over 404 to not expose information */
        serviceConfig.prefer405over404 = true;
        /* Configure server (TLS, thread pool, etc.) */
        serviceConfig.enableCorsForAllOrigins();
        /* Configuration of the actual server */
        serviceConfig.server(() -> {
            QueuedThreadPool threadPool = new QueuedThreadPool(config.getThreadPoolSize(), 2, 30000);
            Server server = new Server(threadPool);
            ServerConnector connector;
            if (secure) {
                /* Setup TLS if secure flag was set. */
                SslContextFactory sslContextFactory = new SslContextFactory.Server();
                sslContextFactory.setKeyStorePath(config.getKeystore());
                sslContextFactory.setKeyStorePassword(config.getKeystorePassword());
                connector = new ServerConnector(server, sslContextFactory);
            } else {
                connector = new ServerConnector(server);
            }
            if (port > 0) {
                connector.setPort(port);
            }
            server.setConnectors(new Connector[] { connector });
            return server;
        });
        /* Configure OpenAPI/Swagger doc */
        if (config.getEnableLiveDoc()) {
            this.openApi = new OpenApiPlugin(OpenApiCompatHelper.getJavalinOpenApiOptions(config));
            serviceConfig.registerPlugin(this.openApi);
            /* Enable webjars to serve Swagger-UI */
            serviceConfig.enableWebjars();
        }
        /* Serve the UI if requested statically*/
        if (config.getServeUI()) {
            LOGGER.info("UI serving is enabled");
            /* Add css, js and other static files */
            serviceConfig.addStaticFiles(config.getUiLocation(), Location.EXTERNAL);
            /* Add index.html - the ui's front page as default route. Anything reroutes to there */
            serviceConfig.addSinglePageRoot("/", config.getUiLocation() + "/index.html", Location.EXTERNAL);
        }
    });
    /* Enable WebSocket (if configured). */
    if (config.getEnableWebsocket()) {
        LOGGER.info("Starting WS API");
        this.webSocketApi = new WebsocketAPI();
        service.ws(String.format("%s/websocket", namespace()), handler -> {
            handler.onConnect(ctx -> webSocketApi.connected(ctx.session));
            handler.onClose(ctx -> webSocketApi.closed(ctx.session, ctx.status(), ctx.reason()));
            handler.onError(ctx -> webSocketApi.onWebSocketException(ctx.session, ctx.error()));
            handler.onMessage(ctx -> webSocketApi.message(ctx.session, ctx.message()));
        });
    }
    /* Setup HTTP/RESTful connection (if configured). */
    if (config.getEnableRest() || config.getEnableRestSecure()) {
        LOGGER.info("Starting REST API");
        this.restHandlers.forEach(handler -> registerRestHandler(service, handler));
        this.registerServingRoutes(service, config);
    }
    /* Register a general exception handler. TODO: Add fine grained exception handling. */
    service.exception(Exception.class, (ex, ctx) -> {
        ex.printStackTrace();
        LOGGER.error(ex);
    });
    /* Start javalin */
    try {
        if (port > 0) {
            service.start(port);
        } else {
            service.start();
        }
    } catch (Exception ex) {
        LOGGER.log(Level.FATAL, "Failed to start HTTP endpoint due to an exception. Cineast will shut down now!", ex);
        System.exit(100);
    }
    return service;
}
Also used : Javalin(io.javalin.Javalin) ServerConnector(org.eclipse.jetty.server.ServerConnector) SslContextFactory(org.eclipse.jetty.util.ssl.SslContextFactory) Server(org.eclipse.jetty.server.Server) APIConfig(org.vitrivr.cineast.standalone.config.APIConfig) QueuedThreadPool(org.eclipse.jetty.util.thread.QueuedThreadPool) WebsocketAPI(org.vitrivr.cineast.api.websocket.WebsocketAPI) OpenApiPlugin(io.javalin.plugin.openapi.OpenApiPlugin)

Example 23 with Javalin

use of io.javalin.Javalin in project emfcloud-modelserver by eclipse-emfcloud.

the class ModelServerRoutingV2Test method setUp.

// 
// Test framework
// 
@Before
public void setUp() throws Exception {
    Javalin javalin = mock(Javalin.class);
    when(javalin.routes(ArgumentMatchers.any())).thenCallRealMethod();
    when(javalin.get(ArgumentMatchers.anyString(), ArgumentMatchers.any())).then(invocation -> {
        setHandler("GET", invocation.getArgument(0), invocation.getArgument(1));
        return javalin;
    });
    when(context.result(ArgumentMatchers.anyString())).then(invocation -> {
        resultString = invocation.getArgument(0);
        return context;
    });
    when(context.status(ArgumentMatchers.anyInt())).then(invocation -> {
        resultStatus = invocation.getArgument(0);
        return context;
    });
    when(serverConfiguration.getWorkspaceRootURI()).thenReturn(WORKSPACE_URI);
    when(uriConverter.resolveModelURI(context, "modeluri")).then(invocation -> {
        return Optional.ofNullable(context.queryParam(invocation.getArgument(1))).map(uriString -> URI.createURI(uriString, true)).flatMap(uri -> new DefaultModelURIConverter.APIV2Resolver(serverConfiguration).apply(uri));
    });
    when(uriConverter.resolveModelURI(context)).thenCallRealMethod();
    routing = new ModelServerRoutingV2(javalin, resourceManager, modelController, schemaController, serverController, sessionController, transactionController);
    routing.setModelURIConverter(uriConverter);
    routing.bindRoutes();
}
Also used : Javalin(io.javalin.Javalin) CoreMatchers.is(org.hamcrest.CoreMatchers.is) Collections.emptyMap(java.util.Collections.emptyMap) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) ArgumentMatchers(org.mockito.ArgumentMatchers) URI(org.eclipse.emf.common.util.URI) Mock(org.mockito.Mock) ServerConfiguration(org.eclipse.emfcloud.modelserver.emf.configuration.ServerConfiguration) RunWith(org.junit.runner.RunWith) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Javalin(io.javalin.Javalin) Maps(com.google.common.collect.Maps) CoreMatchers.notNullValue(org.hamcrest.CoreMatchers.notNullValue) Handler(io.javalin.http.Handler) Context(io.javalin.http.Context) Mockito.doAnswer(org.mockito.Mockito.doAnswer) Map(java.util.Map) Optional(java.util.Optional) Assert.fail(org.junit.Assert.fail) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) Mockito.mock(org.mockito.Mockito.mock) Before(org.junit.Before) Before(org.junit.Before)

Example 24 with Javalin

use of io.javalin.Javalin in project okaeri-platform by OkaeriPoland.

the class OkaeriWebApplication method plan.

@Override
public void plan(@NonNull ExecutionPlan plan) {
    plan.add(PRE_SETUP, new InjectorSetupTask());
    plan.add(PRE_SETUP, (ExecutionTask<OkaeriWebApplication>) platform -> {
        platform.registerInjectable("dataFolder", platform.getDataFolder());
        platform.registerInjectable("jarFile", platform.getFile());
        platform.registerInjectable("logger", platform.getLogger());
        platform.registerInjectable("app", platform);
        platform.registerInjectable("javalin", platform.getJavalin());
        platform.registerInjectable("jetty", Objects.requireNonNull(platform.getJavalin().jettyServer()));
        platform.registerInjectable("placeholders", Placeholders.create(true));
        platform.registerInjectable("defaultConfigurerProvider", (ConfigurerProvider) YamlSnakeYamlConfigurer::new);
        platform.registerInjectable("defaultConfigurerSerdes", new Class[] { SerdesCommons.class, SerdesWeb.class });
        platform.registerInjectable("defaultPlaceholdersFactory", new SimplePlaceholdersFactory());
        platform.registerInjectable("i18nLocaleProvider", new SystemLocaleProvider());
    });
    plan.add(SETUP, new CommandsSetupTask(new OkaeriCommands()));
    plan.add(SETUP, new CreatorSetupTask(ApplicationComponentCreator.class, WebCreatorRegistry.class));
    plan.add(POST_SETUP, new BeanManifestCreateTask());
    plan.add(POST_SETUP, new BeanManifestExecuteTask());
    plan.add(POST_SETUP, new JavalinSetupTask());
    plan.add(POST_SETUP, new PlatformBannerStartupTask());
    plan.add(STARTUP, new JavalinStartTask());
    plan.add(SHUTDOWN, new JavalinShutdownTask());
    plan.add(SHUTDOWN, new PersistenceShutdownTask());
}
Also used : WebCreatorRegistry(eu.okaeri.platform.web.component.WebCreatorRegistry) JavalinShutdownTask(eu.okaeri.platform.web.plan.JavalinShutdownTask) Setter(lombok.Setter) Arrays(java.util.Arrays) Getter(lombok.Getter) SneakyThrows(lombok.SneakyThrows) LoggerFactory(org.slf4j.LoggerFactory) ExecutionPlan(eu.okaeri.platform.core.plan.ExecutionPlan) Injector(eu.okaeri.injector.Injector) Javalin(io.javalin.Javalin) SerdesWeb(eu.okaeri.platform.web.meta.serdes.SerdesWeb) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) JavalinStartTask(eu.okaeri.platform.web.plan.JavalinStartTask) OkaeriPlatform(eu.okaeri.platform.core.OkaeriPlatform) SystemLocaleProvider(eu.okaeri.platform.standalone.i18n.SystemLocaleProvider) ExecutionResult(eu.okaeri.platform.core.plan.ExecutionResult) ExecutionTask(eu.okaeri.platform.core.plan.ExecutionTask) SimplePlaceholdersFactory(eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory) Logger(org.slf4j.Logger) YamlSnakeYamlConfigurer(eu.okaeri.configs.yaml.snakeyaml.YamlSnakeYamlConfigurer) NonNull(lombok.NonNull) OkaeriCommands(eu.okaeri.commands.OkaeriCommands) ApplicationComponentCreator(eu.okaeri.platform.standalone.component.ApplicationComponentCreator) File(java.io.File) Objects(java.util.Objects) Placeholders(eu.okaeri.placeholders.Placeholders) ComponentHelper(eu.okaeri.platform.core.component.ComponentHelper) ComponentCreator(eu.okaeri.platform.core.component.creator.ComponentCreator) eu.okaeri.platform.core.plan.task(eu.okaeri.platform.core.plan.task) ConfigurerProvider(eu.okaeri.persistence.document.ConfigurerProvider) JavalinSetupTask(eu.okaeri.platform.web.plan.JavalinSetupTask) ExecutionPhase(eu.okaeri.platform.core.plan.ExecutionPhase) ApplicationComponentCreator(eu.okaeri.platform.standalone.component.ApplicationComponentCreator) ConfigurerProvider(eu.okaeri.persistence.document.ConfigurerProvider) SimplePlaceholdersFactory(eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) OkaeriCommands(eu.okaeri.commands.OkaeriCommands) SystemLocaleProvider(eu.okaeri.platform.standalone.i18n.SystemLocaleProvider) SerdesWeb(eu.okaeri.platform.web.meta.serdes.SerdesWeb) JavalinStartTask(eu.okaeri.platform.web.plan.JavalinStartTask) JavalinShutdownTask(eu.okaeri.platform.web.plan.JavalinShutdownTask) JavalinSetupTask(eu.okaeri.platform.web.plan.JavalinSetupTask) YamlSnakeYamlConfigurer(eu.okaeri.configs.yaml.snakeyaml.YamlSnakeYamlConfigurer) WebCreatorRegistry(eu.okaeri.platform.web.component.WebCreatorRegistry)

Example 25 with Javalin

use of io.javalin.Javalin in project solinia3-core by mixxit.

the class Solinia3CorePlugin method startHttpListener.

private void startHttpListener() {
    // Get the current class loader.
    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    // Temporarily set this thread's class loader to the plugin's class loader.
    // Replace JavalinTestPlugin.class with your own plugin's class.
    Thread.currentThread().setContextClassLoader(Solinia3CorePlugin.class.getClassLoader());
    // Instantiate the web server (which will now load using the plugin's class
    // loader).
    Javalin app = Javalin.create(config -> {
        config.defaultContentType = "text/plain";
    }).start(4567);
    System.out.println("Listening on port 4567");
    app.before(ctx -> log.info(ctx.req.getPathInfo()));
    app.routes(() -> {
        // Routes for v1 of the API
        path(API_V1, () -> {
            // Communication
            post("discord", ServerApi::discordPost);
            get("metrics", ServerApi::metricsGet);
        });
    });
    // Default fallthrough. Just give them a 404.
    app.get("*", ctx -> {
        throw new NotFoundResponse();
    });
    // Put the original class loader back where it was.
    Thread.currentThread().setContextClassLoader(classLoader);
}
Also used : Javalin(io.javalin.Javalin) ChannelManager(com.solinia.solinia.Managers.ChannelManager) DynmapListener(com.solinia.solinia.Listeners.DynmapListener) NPCRandomChatTimer(com.solinia.solinia.Timers.NPCRandomChatTimer) PlayerTickTimer(com.solinia.solinia.Timers.PlayerTickTimer) Commands(com.solinia.solinia.Commands) StateCommitTimer(com.solinia.solinia.Timers.StateCommitTimer) EntityClientProcess(com.solinia.solinia.Timers.EntityClientProcess) Javalin(io.javalin.Javalin) SoliniaEntitySpellsRemovalEventListener(com.solinia.solinia.Listeners.SoliniaEntitySpellsRemovalEventListener) EntityManager(com.solinia.solinia.Managers.EntityManager) Solinia3CorePlayerListener(com.solinia.solinia.Listeners.Solinia3CorePlayerListener) MythicMobsNPCEntityProvider(com.solinia.solinia.Providers.MythicMobsNPCEntityProvider) SpellTickTimer(com.solinia.solinia.Timers.SpellTickTimer) SoliniaZonesDynmapTimer(com.solinia.solinia.Timers.SoliniaZonesDynmapTimer) NotFoundResponse(io.javalin.http.NotFoundResponse) ServerApi(com.solinia.solinia.Models.ServerApi) AutoCastTimer(com.solinia.solinia.Timers.AutoCastTimer) JsonLootDropRepository(com.solinia.solinia.Repositories.JsonLootDropRepository) JsonLootTableRepository(com.solinia.solinia.Repositories.JsonLootTableRepository) JsonNPCSpellListRepository(com.solinia.solinia.Repositories.JsonNPCSpellListRepository) ClientVersionTimer(com.solinia.solinia.Timers.ClientVersionTimer) CastingTimer(com.solinia.solinia.Timers.CastingTimer) JsonCraftRepository(com.solinia.solinia.Repositories.JsonCraftRepository) DynmapAPI(org.dynmap.DynmapAPI) NPCSpellCastTimer(com.solinia.solinia.Timers.NPCSpellCastTimer) Towny(com.palmergames.bukkit.towny.Towny) ProtocolManager(com.comphenix.protocol.ProtocolManager) JsonImportItemsRepository(com.solinia.solinia.Repositories.JsonImportItemsRepository) ProtocolLibrary(com.comphenix.protocol.ProtocolLibrary) MarkerSet(org.dynmap.markers.MarkerSet) AttendenceXpBonusTimer(com.solinia.solinia.Timers.AttendenceXpBonusTimer) PlayerMoveCheckTimer(com.solinia.solinia.Timers.PlayerMoveCheckTimer) JsonNPCRepository(com.solinia.solinia.Repositories.JsonNPCRepository) JsonFactionRepository(com.solinia.solinia.Repositories.JsonFactionRepository) JsonCharacterListRepository(com.solinia.solinia.Repositories.JsonCharacterListRepository) PluginMessageListener(org.bukkit.plugin.messaging.PluginMessageListener) SoliniaEntitySpellsRunEventListener(com.solinia.solinia.Listeners.SoliniaEntitySpellsRunEventListener) JsonGodRepository(com.solinia.solinia.Repositories.JsonGodRepository) Solinia3CorePlayerChatListener(com.solinia.solinia.Listeners.Solinia3CorePlayerChatListener) Solinia3CoreZoneTickListener(com.solinia.solinia.Listeners.Solinia3CoreZoneTickListener) JsonAlignmentRepository(com.solinia.solinia.Repositories.JsonAlignmentRepository) PlayerManager(com.solinia.solinia.Managers.PlayerManager) Economy(net.milkbowl.vault.economy.Economy) JsonAAAbilityRepository(com.solinia.solinia.Repositories.JsonAAAbilityRepository) JsonFellowshipRepository(com.solinia.solinia.Repositories.JsonFellowshipRepository) ZoneTickTimer(com.solinia.solinia.Timers.ZoneTickTimer) Solinia3CoreChunkListener(com.solinia.solinia.Listeners.Solinia3CoreChunkListener) Solinia3CoreNPCUpdatedListener(com.solinia.solinia.Listeners.Solinia3CoreNPCUpdatedListener) CoreStateInitException(com.solinia.solinia.Exceptions.CoreStateInitException) JsonNPCMerchantRepository(com.solinia.solinia.Repositories.JsonNPCMerchantRepository) NPCSummonAndTeleportCastTimer(com.solinia.solinia.Timers.NPCSummonAndTeleportCastTimer) PlayerTrackingTimer(com.solinia.solinia.Timers.PlayerTrackingTimer) Solinia3CoreVehicleListener(com.solinia.solinia.Listeners.Solinia3CoreVehicleListener) Solinia3UIChannelNames(com.solinia.solinia.Models.Solinia3UIChannelNames) PlayerValidatorModListener(com.solinia.solinia.Listeners.PlayerValidatorModListener) EffectManager(de.slikey.effectlib.EffectManager) RegisteredServiceProvider(org.bukkit.plugin.RegisteredServiceProvider) JsonPlayerStateRepository(com.solinia.solinia.Repositories.JsonPlayerStateRepository) JsonSpawnGroupRepository(com.solinia.solinia.Repositories.JsonSpawnGroupRepository) Plugin(org.bukkit.plugin.Plugin) Solinia3CoreEntityListener(com.solinia.solinia.Listeners.Solinia3CoreEntityListener) PetCheckTickTimer(com.solinia.solinia.Timers.PetCheckTickTimer) SoliniaLivingEntityRegenTickTimer(com.solinia.solinia.Timers.SoliniaLivingEntityRegenTickTimer) Solinia3CoreBlockListener(com.solinia.solinia.Listeners.Solinia3CoreBlockListener) PlayerEquipmentTickTimer(com.solinia.solinia.Timers.PlayerEquipmentTickTimer) Locale(java.util.Locale) PlayerTrackListener(com.solinia.solinia.Listeners.PlayerTrackListener) PlayerInventoryValidatorTimer(com.solinia.solinia.Timers.PlayerInventoryValidatorTimer) JsonItemRepository(com.solinia.solinia.Repositories.JsonItemRepository) UpdatePlayerWindowTimer(com.solinia.solinia.Timers.UpdatePlayerWindowTimer) Bukkit(org.bukkit.Bukkit) SoliniaLivingEntityPassiveEffectTimer(com.solinia.solinia.Timers.SoliniaLivingEntityPassiveEffectTimer) JsonAccountClaimRepository(com.solinia.solinia.Repositories.JsonAccountClaimRepository) JsonImportNPCsRepository(com.solinia.solinia.Repositories.JsonImportNPCsRepository) JsonWorldRepository(com.solinia.solinia.Repositories.JsonWorldRepository) Solinia3CoreVoteListener(com.solinia.solinia.Listeners.Solinia3CoreVoteListener) Logger(java.util.logging.Logger) PacketType(com.comphenix.protocol.PacketType) JsonQuestRepository(com.solinia.solinia.Repositories.JsonQuestRepository) JavaPlugin(org.bukkit.plugin.java.JavaPlugin) Solinia3CoreItemPickupListener(com.solinia.solinia.Listeners.Solinia3CoreItemPickupListener) InvalidItemCheckerTimer(com.solinia.solinia.Timers.InvalidItemCheckerTimer) PetFastCheckTimer(com.solinia.solinia.Timers.PetFastCheckTimer) NPCCheckForEnemiesTimer(com.solinia.solinia.Timers.NPCCheckForEnemiesTimer) Solinia3CoreSpawnGroupUpdatedListener(com.solinia.solinia.Listeners.Solinia3CoreSpawnGroupUpdatedListener) JsonPatchRepository(com.solinia.solinia.Repositories.JsonPatchRepository) JsonZoneRepository(com.solinia.solinia.Repositories.JsonZoneRepository) JsonClassRepository(com.solinia.solinia.Repositories.JsonClassRepository) JsonDisguiseRepository(com.solinia.solinia.Repositories.JsonDisguiseRepository) ConfigurationManager(com.solinia.solinia.Managers.ConfigurationManager) JsonRaceRepository(com.solinia.solinia.Repositories.JsonRaceRepository) StateManager(com.solinia.solinia.Managers.StateManager) JsonSpellRepository(com.solinia.solinia.Repositories.JsonSpellRepository) FileConfiguration(org.bukkit.configuration.file.FileConfiguration) ApiBuilder(io.javalin.apibuilder.ApiBuilder) PacketAdapter(com.comphenix.protocol.events.PacketAdapter) ConfigSettings(com.solinia.solinia.Models.ConfigSettings) NPCYellForAssistTimer(com.solinia.solinia.Timers.NPCYellForAssistTimer) SoliniaLivingEntityUpdateTargetWindowTimer(com.solinia.solinia.Timers.SoliniaLivingEntityUpdateTargetWindowTimer) ForgeUtils(com.solinia.solinia.Utils.ForgeUtils) ServerApi(com.solinia.solinia.Models.ServerApi) NotFoundResponse(io.javalin.http.NotFoundResponse)

Aggregations

Javalin (io.javalin.Javalin)47 Test (org.junit.jupiter.api.Test)9 ApiBuilder.get (io.javalin.apibuilder.ApiBuilder.get)4 Context (io.javalin.http.Context)4 Config (org.devocative.artemis.cfg.Config)4 Server (org.eclipse.jetty.server.Server)4 OpenApiPlugin (io.javalin.plugin.openapi.OpenApiPlugin)3 Info (io.swagger.v3.oas.models.info.Info)3 Map (java.util.Map)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 HttpServletResponse (javax.servlet.http.HttpServletResponse)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 Context (io.javalin.Context)2 Handler (io.javalin.Handler)2 ApiBuilder.path (io.javalin.apibuilder.ApiBuilder.path)2 Plugin (io.javalin.core.plugin.Plugin)2 ExceptionHandler (io.javalin.http.ExceptionHandler)2 Handler (io.javalin.http.Handler)2 HandlerEntry (io.javalin.http.HandlerEntry)2 HandlerType (io.javalin.http.HandlerType)2