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;
10 import com.google.common.collect.ImmutableSet;
11 import java.util.HashSet;
13 import javax.ws.rs.core.Application;
14 import org.opendaylight.netconf.md.sal.rest.schema.SchemaExportContentYangBodyWriter;
15 import org.opendaylight.netconf.md.sal.rest.schema.SchemaExportContentYinBodyWriter;
16 import org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader;
17 import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter;
18 import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter;
19 import org.opendaylight.netconf.sal.rest.impl.PATCHJsonBodyWriter;
20 import org.opendaylight.netconf.sal.rest.impl.PATCHXmlBodyWriter;
21 import org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper;
22 import org.opendaylight.netconf.sal.rest.impl.XmlNormalizedNodeBodyReader;
23 import org.opendaylight.restconf.common.wrapper.services.Draft16ServicesWrapperImpl;
24 import org.opendaylight.restconf.utils.patch.Draft16JsonToPATCHBodyReader;
25 import org.opendaylight.restconf.utils.patch.Draft16XmlToPATCHBodyReader;
27 public class RestconfApplication extends Application {
30 public Set<Class<?>> getClasses() {
31 return ImmutableSet.<Class<?>> builder().add(NormalizedNodeJsonBodyWriter.class)
32 .add(NormalizedNodeXmlBodyWriter.class).add(JsonNormalizedNodeBodyReader.class)
33 .add(XmlNormalizedNodeBodyReader.class).add(SchemaExportContentYinBodyWriter.class)
34 .add(Draft16JsonToPATCHBodyReader.class).add(Draft16XmlToPATCHBodyReader.class)
35 .add(PATCHJsonBodyWriter.class).add(PATCHXmlBodyWriter.class)
36 .add(SchemaExportContentYangBodyWriter.class).add(RestconfDocumentedExceptionMapper.class)
41 public Set<Object> getSingletons() {
42 final Set<Object> singletons = new HashSet<>();
43 singletons.add(Draft16ServicesWrapperImpl.getInstance());