Introduce restconf.server.{api,spi,mdsal}
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / rfc8040 / streams / SSEApplication.java
1 /*
2  * Copyright (c) 2020 Lumina Networks, Inc. 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.streams;
9
10 import java.util.Set;
11 import javax.ws.rs.core.Application;
12 import org.opendaylight.restconf.server.spi.RestconfStream;
13
14 /**
15  * JAX-RS binding for Server-Sent Events.
16  */
17 final class SSEApplication extends Application {
18     private final SSEStreamService singleton;
19
20     SSEApplication(final RestconfStream.Registry streamRegistry, final PingExecutor pingExecutor,
21             final StreamsConfiguration configuration) {
22         singleton = new SSEStreamService(streamRegistry, pingExecutor, configuration);
23     }
24
25     @Override
26     public Set<Object> getSingletons() {
27         return Set.of(singleton);
28     }
29 }