Search in sources :

Example 1 with JsonParseExceptionMapper

use of gov.cms.dpc.api.exceptions.JsonParseExceptionMapper in project dpc-app by CMSgov.

the class DPCAPIService method run.

@Override
public void run(final DPCAPIConfiguration configuration, final Environment environment) {
    EnvironmentParser.getEnvironment("API");
    final var listener = new InstrumentedResourceMethodApplicationListener(environment.metrics());
    environment.jersey().getResourceConfig().register(listener);
    environment.jersey().register(new AuthValueFactoryProvider.Binder<>(OrganizationPrincipal.class));
    environment.jersey().register(new JsonParseExceptionMapper());
    environment.jersey().register(new GenerateRequestIdFilter(false));
    environment.jersey().register(new LogResponseFilter());
}
Also used : OrganizationPrincipal(gov.cms.dpc.api.auth.OrganizationPrincipal) GenerateRequestIdFilter(gov.cms.dpc.common.logging.filters.GenerateRequestIdFilter) InstrumentedResourceMethodApplicationListener(com.codahale.metrics.jersey2.InstrumentedResourceMethodApplicationListener) AuthValueFactoryProvider(io.dropwizard.auth.AuthValueFactoryProvider) LogResponseFilter(gov.cms.dpc.common.logging.filters.LogResponseFilter) JsonParseExceptionMapper(gov.cms.dpc.api.exceptions.JsonParseExceptionMapper)

Aggregations

InstrumentedResourceMethodApplicationListener (com.codahale.metrics.jersey2.InstrumentedResourceMethodApplicationListener)1 OrganizationPrincipal (gov.cms.dpc.api.auth.OrganizationPrincipal)1 JsonParseExceptionMapper (gov.cms.dpc.api.exceptions.JsonParseExceptionMapper)1 GenerateRequestIdFilter (gov.cms.dpc.common.logging.filters.GenerateRequestIdFilter)1 LogResponseFilter (gov.cms.dpc.common.logging.filters.LogResponseFilter)1 AuthValueFactoryProvider (io.dropwizard.auth.AuthValueFactoryProvider)1