package net.explorviz.discovery.server.main;

import net.explorviz.shared.exceptions.mapper.GeneralExceptionMapper;
import net.explorviz.shared.exceptions.mapper.WebApplicationExceptionMapper;
import net.explorviz.shared.security.filters.AuthenticationFilter;
import net.explorviz.shared.security.filters.AuthorizationFilter;
import net.explorviz.shared.security.filters.CorsResponseFilter;
import org.glassfish.jersey.server.ResourceConfig;

/**
 * Starting configuration for the backend - includes registring models, resources, exception
 * handers, providers, and embedds extensions.
 */
class Application extends ResourceConfig {
  public Application() {

    super();

    this.register(new DependencyInjectionBinder());
    // register(JacksonFeature)

    // register filters, e.g., authentication
    this.register(AuthenticationFilter.class);
    this.register(AuthorizationFilter.class);
    this.register(CorsResponseFilter.class);

    // resources
    this.packages("net.explorviz.server.resources");

    // exception handling (mind the order !)
    this.register(WebApplicationExceptionMapper.class);
    this.register(GeneralExceptionMapper.class);

    this.register(SetupApplicationListener.class);

    // easy (de-)serializing models for HTTP Requests
    this.packages("net.explorviz.server.providers");

    // register extensions (For development: read plugin structure at github docs)
    this.packages("net.explorviz.extension");
  }
}

@@ -64,263 +64,392 @@
 viz.
-shared.exceptions.mapper.GeneralExceptionMapper;%0Aimport net.explorviz.shared.exceptions.mapper.WebApplicationExceptionMapper;%0Aimport net.explorviz.shared.security.filters.AuthenticationFilter;%0Aimport net.explorviz.shared.security.filters.AuthorizationFilt
+discovery.server.providers.JsonApiListProvider;%0Aimport net.explorviz.discovery.server.providers.JsonApiProvider;%0Aimport net.explorviz.discovery.server.resources.AgentResource;%0Aimport net.explorviz.discovery.server.resources.ProcezzResource;%0Aimport net.explorviz.shared.exceptions.mapper.GeneralExceptionMapper;%0Aimport net.explorviz.shared.exceptions.mapper.WebApplicationExceptionMapp
 er;%0A
@@ -851,40 +851,8 @@
 ());
-%0A    // register(JacksonFeature)
 %0A%0A  
@@ -894,24 +894,27 @@
 tication%0A   
+ //
  this.regist
@@ -940,32 +940,35 @@
 lter.class);%0A   
+ //
  this.register(A
@@ -1070,49 +1070,78 @@
 his.
-packages(%22net.explorviz.server.r
+register(AgentResource.class);%0A    this.register(ProcezzR
 esource
+.clas
 s
-%22
 );%0A%0A
@@ -1410,68 +1410,58 @@
 his.
-packages(%22net.explorviz.server.p
+register(JsonApiP
 rovider
+.clas
 s
-%22
 );%0A
-%0A 
    
-// 
+ this.
 register
  ext
@@ -1460,119 +1460,34 @@
 ster
- extensions (For development: read plugin structure at github docs)%0A    this.packages(%22net.explorviz.extension%22
+(JsonApiListProvider.class
 );%0A 

use absolute package paths and disable auth for the moment