use of org.ow2.authzforce.rest.pdp.jaxrs.XacmlPdpResource in project restful-pdp by authzforce.
the class XacmlRestProfileJaxRsTest method startServer.
private static void startServer(String pdpConfigLocation) throws Exception {
final PdpEngineConfiguration pdpConf = PdpEngineConfiguration.getInstance(pdpConfigLocation, "src/test/resources/catalog.xml", "src/test/resources/pdp-ext.xsd");
/*
* See also http://cxf.apache.org/docs/secure-jax-rs-services.html
*/
final JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(XacmlPdpResource.class);
sf.setResourceProvider(XacmlPdpResource.class, new SingletonResourceProvider(new XacmlPdpResource(pdpConf)));
// add custom providers if any
sf.setProviders(Collections.singletonList(new JsonRiJaxrsProvider()));
final LoggingFeature loggingFeature = new LoggingFeature();
loggingFeature.setPrettyLogging(true);
loggingFeature.setVerbose(true);
sf.setFeatures(Collections.singletonList(loggingFeature));
sf.setAddress(ENDPOINT_ADDRESS);
server = sf.create();
}
Aggregations