Turn streams.Configuration into a record
[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.restconf.nb.rfc8040.databind.DatabindProvider;
20 import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfStreamsSubscriptionService;
21 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfDataServiceImpl;
22 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfImpl;
23 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfInvokeOperationsServiceImpl;
24 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfOperationsServiceImpl;
25 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfSchemaServiceImpl;
26 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfStreamsSubscriptionServiceImpl;
27 import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
28
29 @Singleton
30 public class RestconfApplication extends AbstractRestconfApplication {
31     private RestconfApplication(final DatabindProvider databindProvider, final DOMMountPointService mountPointService,
32             final RestconfStreamsSubscriptionService streamSubscription, final DOMDataBroker dataBroker,
33             final DOMRpcService rpcService, final DOMActionService actionService,
34             final DOMNotificationService notificationService, final DOMSchemaService domSchemaService,
35             final StreamsConfiguration configuration) {
36         super(databindProvider, mountPointService, List.of(
37             streamSubscription,
38             new RestconfDataServiceImpl(databindProvider, dataBroker, mountPointService, streamSubscription,
39                 actionService, configuration),
40             new RestconfInvokeOperationsServiceImpl(rpcService, mountPointService, configuration),
41             new RestconfOperationsServiceImpl(databindProvider, mountPointService),
42             new RestconfSchemaServiceImpl(domSchemaService, mountPointService),
43             new RestconfImpl(databindProvider)));
44     }
45
46     @Inject
47     public RestconfApplication(final DatabindProvider databindProvider, final DOMMountPointService mountPointService,
48             final DOMDataBroker dataBroker, final DOMRpcService rpcService, final DOMActionService actionService,
49             final DOMNotificationService notificationService, final DOMSchemaService domSchemaService,
50             final StreamsConfiguration configuration) {
51         this(databindProvider, mountPointService,
52             new RestconfStreamsSubscriptionServiceImpl(dataBroker, notificationService, databindProvider,
53                 configuration),
54             dataBroker, rpcService, actionService, notificationService, domSchemaService, configuration);
55     }
56 }