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.DOMMountPointService;
13 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
14 import org.opendaylight.restconf.nb.rfc8040.databind.DatabindProvider;
15 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.JsonNormalizedNodeBodyWriter;
16 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.JsonPatchStatusBodyWriter;
17 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.XmlNormalizedNodeBodyWriter;
18 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.XmlPatchStatusBodyWriter;
19 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.YangSchemaExportBodyWriter;
20 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.YinSchemaExportBodyWriter;
21 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.errors.RestconfDocumentedExceptionMapper;
22 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.MdsalRestconfServer;
23 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfDataServiceImpl;
24 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfImpl;
25 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfSchemaServiceImpl;
27 final class RestconfApplication extends Application {
28 private final Set<Object> singletons;
30 RestconfApplication(final DatabindProvider databindProvider, final MdsalRestconfServer server,
31 final DOMMountPointService mountPointService, final DOMSchemaService domSchemaService) {
33 new RestconfDocumentedExceptionMapper(databindProvider),
34 new RestconfDataServiceImpl(databindProvider, server),
35 new RestconfImpl(server),
36 new RestconfSchemaServiceImpl(domSchemaService, mountPointService));
40 public Set<Class<?>> getClasses() {
42 JsonNormalizedNodeBodyWriter.class, XmlNormalizedNodeBodyWriter.class,
43 YinSchemaExportBodyWriter.class, YangSchemaExportBodyWriter.class,
44 JsonPatchStatusBodyWriter.class, XmlPatchStatusBodyWriter.class);
48 public Set<Object> getSingletons() {