2 * Copyright (c) 2019 Red Hat, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.restconf.nb.rfc8040;
10 import javax.inject.Inject;
11 import javax.inject.Singleton;
12 import org.apache.aries.blueprint.annotation.service.Reference;
13 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
14 import org.opendaylight.restconf.nb.rfc8040.handlers.ActionServiceHandler;
15 import org.opendaylight.restconf.nb.rfc8040.handlers.DOMDataBrokerHandler;
16 import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
17 import org.opendaylight.restconf.nb.rfc8040.handlers.NotificationServiceHandler;
18 import org.opendaylight.restconf.nb.rfc8040.handlers.RpcServiceHandler;
19 import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
20 import org.opendaylight.restconf.nb.rfc8040.handlers.TransactionChainHandler;
21 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.JSONRestconfServiceRfc8040Impl;
22 import org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServicesWrapper;
23 import org.opendaylight.restconf.nb.rfc8040.web.WebInitializer;
26 * Standalone wiring for RESTCONF.
28 * <p>This wiring alone is not sufficient; there are a few other singletons which
29 * need to be bound as well, incl. {@link RestconfApplication},
30 * {@link JSONRestconfServiceRfc8040Impl} & {@link WebInitializer}; see the
31 * Rfc8040RestConfWiringTest for how to do this e.g. for Guice (this class can
32 * be used with another DI framework but needs the equivalent).
34 * @author Michael Vorburger.ch
37 public class Rfc8040RestConfWiring {
38 private final ServicesWrapper servicesWrapper;
41 public Rfc8040RestConfWiring(final SchemaContextHandler schemaCtxHandler,
42 final DOMMountPointServiceHandler domMountPointServiceHandler,
43 final TransactionChainHandler transactionChainHandler,
44 final DOMDataBrokerHandler domDataBrokerHandler, final RpcServiceHandler rpcServiceHandler,
45 final ActionServiceHandler actionServiceHandler,
46 final NotificationServiceHandler notificationServiceHandler,
47 @Reference final DOMSchemaService domSchemaService) {
48 servicesWrapper = ServicesWrapper.newInstance(schemaCtxHandler, domMountPointServiceHandler,
49 transactionChainHandler, domDataBrokerHandler, rpcServiceHandler, actionServiceHandler,
50 notificationServiceHandler, domSchemaService);
53 public ServicesWrapper getServicesWrapper() {
54 return servicesWrapper;