Search in sources :

Example 1 with JsonNormalizedNodeBodyReader

use of org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader in project netconf by opendaylight.

the class RestGetOperationTest method configure.

@Override
protected Application configure() {
    /* enable/disable Jersey logs to console */
    // enable(TestProperties.LOG_TRAFFIC);
    // enable(TestProperties.DUMP_ENTITY);
    // enable(TestProperties.RECORD_LOG_LEVEL);
    // set(TestProperties.RECORD_LOG_LEVEL, Level.ALL.intValue());
    mountInstance = mock(DOMMountPoint.class);
    controllerContext = TestRestconfUtils.newControllerContext(schemaContextYangsIetf, mountInstance);
    brokerFacade = mock(BrokerFacade.class);
    restconfImpl = RestconfImpl.newInstance(brokerFacade, controllerContext);
    ResourceConfig resourceConfig = new ResourceConfig();
    resourceConfig = resourceConfig.registerInstances(restconfImpl, new NormalizedNodeJsonBodyWriter(), new NormalizedNodeXmlBodyWriter(), new XmlNormalizedNodeBodyReader(controllerContext), new JsonNormalizedNodeBodyReader(controllerContext), new RestconfDocumentedExceptionMapper(controllerContext));
    return resourceConfig;
}
Also used : NormalizedNodeXmlBodyWriter(org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter) NormalizedNodeJsonBodyWriter(org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter) DOMMountPoint(org.opendaylight.mdsal.dom.api.DOMMountPoint) XmlNormalizedNodeBodyReader(org.opendaylight.netconf.sal.rest.impl.XmlNormalizedNodeBodyReader) ResourceConfig(org.glassfish.jersey.server.ResourceConfig) RestconfDocumentedExceptionMapper(org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper) BrokerFacade(org.opendaylight.netconf.sal.restconf.impl.BrokerFacade) JsonNormalizedNodeBodyReader(org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader)

Example 2 with JsonNormalizedNodeBodyReader

use of org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader in project netconf by opendaylight.

the class CodecsExceptionsCatchingTest method configure.

@Override
protected Application configure() {
    /* enable/disable Jersey logs to console */
    // enable(TestProperties.LOG_TRAFFIC);
    // enable(TestProperties.DUMP_ENTITY);
    // enable(TestProperties.RECORD_LOG_LEVEL);
    // set(TestProperties.RECORD_LOG_LEVEL, Level.ALL.intValue());
    ResourceConfig resourceConfig = new ResourceConfig();
    resourceConfig = resourceConfig.registerInstances(restConf, new NormalizedNodeJsonBodyWriter(), new NormalizedNodeXmlBodyWriter(), new XmlNormalizedNodeBodyReader(controllerContext), new JsonNormalizedNodeBodyReader(controllerContext));
    return resourceConfig;
}
Also used : NormalizedNodeXmlBodyWriter(org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter) NormalizedNodeJsonBodyWriter(org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter) XmlNormalizedNodeBodyReader(org.opendaylight.netconf.sal.rest.impl.XmlNormalizedNodeBodyReader) ResourceConfig(org.glassfish.jersey.server.ResourceConfig) JsonNormalizedNodeBodyReader(org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader)

Example 3 with JsonNormalizedNodeBodyReader

use of org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader in project netconf by opendaylight.

the class RestPostOperationTest method configure.

@Override
protected Application configure() {
    /* enable/disable Jersey logs to console */
    // enable(TestProperties.LOG_TRAFFIC);
    // enable(TestProperties.DUMP_ENTITY);
    // enable(TestProperties.RECORD_LOG_LEVEL);
    // set(TestProperties.RECORD_LOG_LEVEL, Level.ALL.intValue());
    mountInstance = mock(DOMMountPoint.class);
    controllerContext = TestRestconfUtils.newControllerContext(schemaContext, mountInstance);
    brokerFacade = mock(BrokerFacade.class);
    restconfImpl = RestconfImpl.newInstance(brokerFacade, controllerContext);
    ResourceConfig resourceConfig = new ResourceConfig();
    resourceConfig = resourceConfig.registerInstances(restconfImpl, new XmlNormalizedNodeBodyReader(controllerContext), new NormalizedNodeXmlBodyWriter(), new JsonNormalizedNodeBodyReader(controllerContext), new NormalizedNodeJsonBodyWriter(), new RestconfDocumentedExceptionMapper(controllerContext));
    return resourceConfig;
}
Also used : NormalizedNodeXmlBodyWriter(org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter) NormalizedNodeJsonBodyWriter(org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter) DOMMountPoint(org.opendaylight.mdsal.dom.api.DOMMountPoint) XmlNormalizedNodeBodyReader(org.opendaylight.netconf.sal.rest.impl.XmlNormalizedNodeBodyReader) ResourceConfig(org.glassfish.jersey.server.ResourceConfig) RestconfDocumentedExceptionMapper(org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper) BrokerFacade(org.opendaylight.netconf.sal.restconf.impl.BrokerFacade) JsonNormalizedNodeBodyReader(org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader)

Example 4 with JsonNormalizedNodeBodyReader

use of org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader in project netconf by opendaylight.

the class RestPutOperationTest method configure.

@Override
protected Application configure() {
    /* enable/disable Jersey logs to console */
    // enable(TestProperties.LOG_TRAFFIC);
    // enable(TestProperties.DUMP_ENTITY);
    // enable(TestProperties.RECORD_LOG_LEVEL);
    // set(TestProperties.RECORD_LOG_LEVEL, Level.ALL.intValue());
    mountInstance = mock(DOMMountPoint.class);
    final ControllerContext controllerContext = TestRestconfUtils.newControllerContext(schemaContextYangsIetf, mountInstance);
    brokerFacade = mock(BrokerFacade.class);
    restconfImpl = RestconfImpl.newInstance(brokerFacade, controllerContext);
    ResourceConfig resourceConfig = new ResourceConfig();
    resourceConfig = resourceConfig.registerInstances(restconfImpl, new XmlNormalizedNodeBodyReader(controllerContext), new NormalizedNodeXmlBodyWriter(), new JsonNormalizedNodeBodyReader(controllerContext), new NormalizedNodeJsonBodyWriter(), new RestconfDocumentedExceptionMapper(controllerContext));
    return resourceConfig;
}
Also used : NormalizedNodeXmlBodyWriter(org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter) ControllerContext(org.opendaylight.netconf.sal.restconf.impl.ControllerContext) NormalizedNodeJsonBodyWriter(org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter) DOMMountPoint(org.opendaylight.mdsal.dom.api.DOMMountPoint) XmlNormalizedNodeBodyReader(org.opendaylight.netconf.sal.rest.impl.XmlNormalizedNodeBodyReader) ResourceConfig(org.glassfish.jersey.server.ResourceConfig) RestconfDocumentedExceptionMapper(org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper) BrokerFacade(org.opendaylight.netconf.sal.restconf.impl.BrokerFacade) JsonNormalizedNodeBodyReader(org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader)

Example 5 with JsonNormalizedNodeBodyReader

use of org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader in project netconf by opendaylight.

the class RestDeleteOperationTest method configure.

@Override
protected Application configure() {
    /* enable/disable Jersey logs to console */
    // enable(TestProperties.LOG_TRAFFIC);
    // enable(TestProperties.DUMP_ENTITY);
    // enable(TestProperties.RECORD_LOG_LEVEL);
    // set(TestProperties.RECORD_LOG_LEVEL, Level.ALL.intValue());
    controllerContext = TestRestconfUtils.newControllerContext(schemaContext);
    controllerContext.setSchemas(schemaContext);
    brokerFacade = mock(BrokerFacade.class);
    restconfImpl = RestconfImpl.newInstance(brokerFacade, controllerContext);
    ResourceConfig resourceConfig = new ResourceConfig();
    resourceConfig = resourceConfig.registerInstances(restconfImpl, new NormalizedNodeJsonBodyWriter(), new NormalizedNodeXmlBodyWriter(), new XmlNormalizedNodeBodyReader(controllerContext), new JsonNormalizedNodeBodyReader(controllerContext), new RestconfDocumentedExceptionMapper(controllerContext));
    return resourceConfig;
}
Also used : NormalizedNodeXmlBodyWriter(org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter) NormalizedNodeJsonBodyWriter(org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter) XmlNormalizedNodeBodyReader(org.opendaylight.netconf.sal.rest.impl.XmlNormalizedNodeBodyReader) ResourceConfig(org.glassfish.jersey.server.ResourceConfig) RestconfDocumentedExceptionMapper(org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper) BrokerFacade(org.opendaylight.netconf.sal.restconf.impl.BrokerFacade) JsonNormalizedNodeBodyReader(org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader)

Aggregations

ResourceConfig (org.glassfish.jersey.server.ResourceConfig)7 JsonNormalizedNodeBodyReader (org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader)7 NormalizedNodeJsonBodyWriter (org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter)7 NormalizedNodeXmlBodyWriter (org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter)7 XmlNormalizedNodeBodyReader (org.opendaylight.netconf.sal.rest.impl.XmlNormalizedNodeBodyReader)7 RestconfDocumentedExceptionMapper (org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper)6 BrokerFacade (org.opendaylight.netconf.sal.restconf.impl.BrokerFacade)5 DOMMountPoint (org.opendaylight.mdsal.dom.api.DOMMountPoint)3 ControllerContext (org.opendaylight.netconf.sal.restconf.impl.ControllerContext)3