Use random UUIDs for stream names
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / rfc8040 / ServerSentEventsApplication.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;
9
10 import java.util.Set;
11 import javax.ws.rs.core.Application;
12 import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
13 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfDataStreamServiceImpl;
14 import org.opendaylight.restconf.nb.rfc8040.streams.ListenersBroker;
15 import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
16
17 /**
18  * JAX-RS binding for Server-Sent Events.
19  */
20 final class ServerSentEventsApplication extends Application {
21     private final RestconfDataStreamServiceImpl singleton;
22
23     ServerSentEventsApplication(final ScheduledThreadPool scheduledThreadPool, final ListenersBroker listenersBroker,
24             final StreamsConfiguration configuration) {
25         singleton = new RestconfDataStreamServiceImpl(scheduledThreadPool, listenersBroker, configuration);
26     }
27
28     @Override
29     public Set<Object> getSingletons() {
30         return Set.of(singleton);
31     }
32 }