Bug 5900 - Jenkins RaceContiditions - problem between Jersey and RestconfProvider
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / restconf / rest / 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.rest;
9
10 import com.google.common.collect.ImmutableSet;
11 import java.util.HashSet;
12 import java.util.Set;
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.NormalizedNodeJsonBodyWriter;
17 import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter;
18 import org.opendaylight.restconf.rest.impl.services.Draft11ServicesWrapperImpl;
19
20 public class RestconfApplication extends Application {
21
22     @Override
23     public Set<Class<?>> getClasses() {
24         return ImmutableSet.<Class<?>> builder().add(NormalizedNodeJsonBodyWriter.class)
25                 .add(NormalizedNodeXmlBodyWriter.class).add(SchemaExportContentYinBodyWriter.class)
26                 .add(SchemaExportContentYangBodyWriter.class)
27                 .build();
28     }
29
30     @Override
31     public Set<Object> getSingletons() {
32         final Set<Object> singletons = new HashSet<>();
33         singletons.add(Draft11ServicesWrapperImpl.getInstance());
34         return singletons;
35     }
36 }