use of com.linkedin.restli.server.validation.RestLiValidationFilter in project incubator-gobblin by apache.
the class EmbeddedRestliServer method startUp.
@Override
protected void startUp() throws Exception {
RestLiConfig config = new RestLiConfig();
Set<String> resourceClassNames = Sets.newHashSet();
for (Class<? extends BaseResource> resClass : this.resources) {
resourceClassNames.add(resClass.getName());
}
config.addResourceClassNames(resourceClassNames);
config.setServerNodeUri(this.serverUri);
config.setDocumentationRequestHandler(new DefaultDocumentationRequestHandler());
config.addFilter(new RestLiValidationFilter());
ResourceFactory factory = new GuiceInjectResourceFactory(this.injector);
TransportDispatcher dispatcher = new DelegatingTransportDispatcher(new RestLiServer(config, factory));
String acceptedFilters = EncodingType.SNAPPY.getHttpName() + "," + EncodingType.GZIP.getHttpName();
FilterChain filterChain = FilterChains.createRestChain(new ServerCompressionFilter(acceptedFilters));
this.httpServer = Optional.of(new HttpNettyServerFactory(filterChain).createServer(this.port, dispatcher));
this.log.info("Starting the {} embedded server at port {}.", this.name, this.port);
this.httpServer.get().start();
}
use of com.linkedin.restli.server.validation.RestLiValidationFilter in project rest.li by linkedin.
the class TestParseqBasedFluentClientApiWithProjections method setUp.
@BeforeClass
void setUp() throws Exception {
super.init(Arrays.asList(new RestLiValidationFilter()));
_parSeqUnitTestHelper = new ParSeqUnitTestHelper();
_parSeqUnitTestHelper.setUp();
_parSeqRestliClient = new ParSeqRestliClientBuilder().setClient(getClient()).setConfig(new ParSeqRestliClientConfigBuilder().build()).build();
}
use of com.linkedin.restli.server.validation.RestLiValidationFilter in project rest.li by linkedin.
the class TestParSeqBasedFluentClientApiWithExecutionGroup method setUp.
@BeforeClass
void setUp() throws Exception {
super.init(Arrays.asList(new RestLiValidationFilter()));
ParSeqRestliClientConfig config = new ParSeqRestliClientConfigBuilder().addBatchingEnabled("*.*/*.*", Boolean.TRUE).addMaxBatchSize("*.*/*.*", TEST_BATCH_SIZE).build();
BatchingSupport batchingSupport = new BatchingSupport();
_parSeqUnitTestHelper = new ParSeqUnitTestHelper(engineBuilder -> {
engineBuilder.setPlanDeactivationListener(batchingSupport);
});
_parSeqUnitTestHelper.setUp();
_parSeqRestliClient = // RestClient Registered Strategy
new ParSeqRestliClientBuilder().setBatchingSupport(batchingSupport).setClient(getClient()).setConfig(config).build();
}
Aggregations