Simplify RestconfInvokeOperationsServiceImpl
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / rfc8040 / RestconfApplication.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.restconf.nb.rfc8040;
9
10 import java.util.List;
11 import javax.inject.Inject;
12 import javax.inject.Singleton;
13 import org.opendaylight.mdsal.dom.api.DOMActionService;
14 import org.opendaylight.mdsal.dom.api.DOMDataBroker;
15 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
16 import org.opendaylight.mdsal.dom.api.DOMNotificationService;
17 import org.opendaylight.mdsal.dom.api.DOMRpcService;
18 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
19 import org.opendaylight.mdsal.dom.api.DOMYangTextSourceProvider;
20 import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
21 import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfStreamsSubscriptionService;
22 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfDataServiceImpl;
23 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfImpl;
24 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfInvokeOperationsServiceImpl;
25 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfOperationsServiceImpl;
26 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfSchemaServiceImpl;
27 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfStreamsSubscriptionServiceImpl;
28 import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
29
30 @Singleton
31 public class RestconfApplication extends AbstractRestconfApplication {
32     private RestconfApplication(final SchemaContextHandler schemaContextHandler,
33             final DOMMountPointService mountPointService, final RestconfStreamsSubscriptionService streamSubscription,
34             final DOMDataBroker dataBroker, final DOMRpcService rpcService, final DOMActionService actionService,
35             final DOMNotificationService notificationService, final DOMSchemaService domSchemaService,
36             final Configuration configuration) {
37         super(schemaContextHandler, mountPointService, List.of(
38             streamSubscription,
39             new RestconfDataServiceImpl(schemaContextHandler, dataBroker, mountPointService, streamSubscription,
40                 actionService, configuration),
41             new RestconfInvokeOperationsServiceImpl(rpcService),
42             new RestconfOperationsServiceImpl(schemaContextHandler, mountPointService),
43             new RestconfSchemaServiceImpl(schemaContextHandler, mountPointService,
44                 domSchemaService.getExtensions().getInstance(DOMYangTextSourceProvider.class)),
45             new RestconfImpl(schemaContextHandler)));
46
47     }
48
49     @Inject
50     public RestconfApplication(final SchemaContextHandler schemaContextHandler,
51             final DOMMountPointService mountPointService, final DOMDataBroker dataBroker,
52             final DOMRpcService rpcService, final DOMActionService actionService,
53             final DOMNotificationService notificationService,
54             final DOMSchemaService domSchemaService, final Configuration configuration) {
55         this(schemaContextHandler, mountPointService,
56             new RestconfStreamsSubscriptionServiceImpl(dataBroker, notificationService, schemaContextHandler,
57                 configuration),
58             dataBroker, rpcService, actionService, notificationService, domSchemaService, configuration);
59     }
60 }