Search in sources :

Example 1 with BrokerFacade

use of org.opendaylight.netconf.sal.restconf.impl.BrokerFacade 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 BrokerFacade

use of org.opendaylight.netconf.sal.restconf.impl.BrokerFacade 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 3 with BrokerFacade

use of org.opendaylight.netconf.sal.restconf.impl.BrokerFacade 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 4 with BrokerFacade

use of org.opendaylight.netconf.sal.restconf.impl.BrokerFacade 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)

Example 5 with BrokerFacade

use of org.opendaylight.netconf.sal.restconf.impl.BrokerFacade in project netconf by opendaylight.

the class RestStreamTest 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());
    final ControllerContext controllerContext = TestRestconfUtils.newControllerContext(schemaContextYangsIetf);
    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) ControllerContext(org.opendaylight.netconf.sal.restconf.impl.ControllerContext) 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

BrokerFacade (org.opendaylight.netconf.sal.restconf.impl.BrokerFacade)7 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)5 JsonNormalizedNodeBodyReader (org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader)5 NormalizedNodeJsonBodyWriter (org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter)5 NormalizedNodeXmlBodyWriter (org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter)5 RestconfDocumentedExceptionMapper (org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper)5 XmlNormalizedNodeBodyReader (org.opendaylight.netconf.sal.rest.impl.XmlNormalizedNodeBodyReader)5 DOMMountPoint (org.opendaylight.mdsal.dom.api.DOMMountPoint)3 ControllerContext (org.opendaylight.netconf.sal.restconf.impl.ControllerContext)3 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)2 FluentFuture (com.google.common.util.concurrent.FluentFuture)1 Before (org.junit.Before)1 DOMMountPoint (org.opendaylight.controller.md.sal.dom.api.DOMMountPoint)1 DOMMountPointService (org.opendaylight.controller.md.sal.dom.api.DOMMountPointService)1 PutResult (org.opendaylight.netconf.sal.restconf.impl.PutResult)1 RestconfImpl (org.opendaylight.netconf.sal.restconf.impl.RestconfImpl)1 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)1 EffectiveModelContext (org.opendaylight.yangtools.yang.model.api.EffectiveModelContext)1 SchemaContext (org.opendaylight.yangtools.yang.model.api.SchemaContext)1