Search in sources :

Example 1 with XacmlPdpResource

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();
}
Also used : PdpEngineConfiguration(org.ow2.authzforce.core.pdp.impl.PdpEngineConfiguration) JsonRiJaxrsProvider(org.ow2.authzforce.jaxrs.util.JsonRiJaxrsProvider) XacmlPdpResource(org.ow2.authzforce.rest.pdp.jaxrs.XacmlPdpResource) LoggingFeature(org.apache.cxf.ext.logging.LoggingFeature) JAXRSServerFactoryBean(org.apache.cxf.jaxrs.JAXRSServerFactoryBean) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)

Aggregations

LoggingFeature (org.apache.cxf.ext.logging.LoggingFeature)1 JAXRSServerFactoryBean (org.apache.cxf.jaxrs.JAXRSServerFactoryBean)1 SingletonResourceProvider (org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)1 PdpEngineConfiguration (org.ow2.authzforce.core.pdp.impl.PdpEngineConfiguration)1 JsonRiJaxrsProvider (org.ow2.authzforce.jaxrs.util.JsonRiJaxrsProvider)1 XacmlPdpResource (org.ow2.authzforce.rest.pdp.jaxrs.XacmlPdpResource)1