2 * Copyright (c) 2014 Cisco Systems, 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;
11 import javax.ws.rs.core.Application;
12 import org.opendaylight.mdsal.dom.api.DOMActionService;
13 import org.opendaylight.mdsal.dom.api.DOMDataBroker;
14 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
15 import org.opendaylight.mdsal.dom.api.DOMNotificationService;
16 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
17 import org.opendaylight.restconf.nb.rfc8040.databind.DatabindProvider;
18 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.JsonNormalizedNodeBodyWriter;
19 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.JsonPatchStatusBodyWriter;
20 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.XmlNormalizedNodeBodyWriter;
21 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.XmlPatchStatusBodyWriter;
22 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.YangSchemaExportBodyWriter;
23 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.YinSchemaExportBodyWriter;
24 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.errors.RestconfDocumentedExceptionMapper;
25 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.MdsalRestconfServer;
26 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfDataServiceImpl;
27 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfImpl;
28 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfInvokeOperationsServiceImpl;
29 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfOperationsServiceImpl;
30 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfSchemaServiceImpl;
31 import org.opendaylight.restconf.nb.rfc8040.streams.ListenersBroker;
33 final class RestconfApplication extends Application {
34 private final Set<Object> singletons;
36 RestconfApplication(final DatabindProvider databindProvider, final MdsalRestconfServer server,
37 final DOMMountPointService mountPointService, final DOMDataBroker dataBroker,
38 final DOMActionService actionService, final DOMNotificationService notificationService,
39 final DOMSchemaService domSchemaService, final ListenersBroker listenersBroker) {
41 new RestconfDocumentedExceptionMapper(databindProvider),
42 new RestconfDataServiceImpl(databindProvider, server, actionService),
43 new RestconfInvokeOperationsServiceImpl(databindProvider, server, listenersBroker),
44 new RestconfOperationsServiceImpl(databindProvider, server),
45 new RestconfSchemaServiceImpl(domSchemaService, mountPointService),
46 new RestconfImpl(databindProvider));
50 public Set<Class<?>> getClasses() {
52 JsonNormalizedNodeBodyWriter.class, XmlNormalizedNodeBodyWriter.class,
53 YinSchemaExportBodyWriter.class, YangSchemaExportBodyWriter.class,
54 JsonPatchStatusBodyWriter.class, XmlPatchStatusBodyWriter.class);
58 public Set<Object> getSingletons() {