Hide ParserIdentifier
[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.impl.RootResourceDiscoveryServiceImpl;
14
15 public class RootFoundApplication extends Application {
16     private final RootResourceDiscoveryServiceImpl rrds;
17
18     public RootFoundApplication(final String restconfRoot) {
19         rrds = new RootResourceDiscoveryServiceImpl(restconfRoot);
20     }
21
22     @Override
23     public Set<Class<?>> getClasses() {
24         return Set.of(RestconfDocumentedExceptionMapper.class);
25     }
26
27     @Override
28     public Set<Object> getSingletons() {
29         return Set.of(rrds);
30     }
31 }