Rename restconf-nb-rfc8040 to restconf-nb
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / rfc8040 / RootFoundApplication.java
1 /*
2  * Copyright (c) 2020 ZTE Corp. 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.Set;
11 import javax.ws.rs.core.Application;
12 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.errors.RestconfDocumentedExceptionMapper;
13 import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RootResourceDiscoveryService;
14 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RootResourceDiscoveryServiceImpl;
15
16 public class RootFoundApplication extends Application {
17     private final RootResourceDiscoveryService rrds;
18
19     public RootFoundApplication(final String restconfRoot) {
20         rrds = new RootResourceDiscoveryServiceImpl(restconfRoot);
21     }
22
23     @Override
24     public Set<Class<?>> getClasses() {
25         return Set.of(RestconfDocumentedExceptionMapper.class);
26     }
27
28     @Override
29     public Set<Object> getSingletons() {
30         return Set.of(rrds);
31     }
32 }