]> git.basschouten.com Git - openhab-addons.git/blob
1c18b86b24b7c2853be2ebbd2e03f782235489b7
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.mielecloud.internal.webservice.sse;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.eclipse.jetty.client.api.Request;
18
19 /**
20  * Factory that produces configured {@link Request} instances for usage with SSE.
21  *
22  * @author Björn Lange - Initial Contribution
23  */
24 @NonNullByDefault
25 @FunctionalInterface
26 public interface SseRequestFactory {
27     /**
28      * Produces a {@link Request} which is decorated with all required headers.
29      *
30      * @param endpoint The endpoint to connect to.
31      * @return The created {@link Request} or {@code null} if no request can be created due to lacking request
32      *         information. If this method returns {@code null} then all connection attempts will be cancelled.
33      */
34     @Nullable
35     Request createSseRequest(String endpoint);
36 }