2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.mielecloud.internal.webservice.request;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jetty.client.api.Request;
19 * Factory for {@link Request} objects.
21 * @author Björn Lange - Initial contribution
24 public interface RequestFactory extends AutoCloseable {
26 * Creates a GET {@link Request} for the given URL decorated with all required headers to interact with the Miele
29 * @param url The URL to GET.
30 * @param accessToken The OAuth2 access token for bearer authentication.
31 * @return The {@link Request}.
33 Request createGetRequest(String url, String accessToken);
36 * Creates a PUT {@link Request} for the given URL decorated with all required headers to interact with the Miele
39 * @param url The URL to PUT.
40 * @param accessToken The OAuth2 access token for bearer authentication.
41 * @param jsonContent Json content to send in the body of the request.
42 * @return The {@link Request}.
44 Request createPutRequest(String url, String accessToken, String jsonContent);
47 * Creates a POST {@link Request} for the given URL decorated with all required headers to interact with the Miele
50 * @param url The URL to POST.
51 * @param accessToken The OAuth2 access token for bearer authentication.
52 * @return The {@link Request}.
54 Request createPostRequest(String url, String accessToken);
57 * Creates a GET request prepared for HTTP event stream data (also referred to as Server Sent Events, SSE).
59 * @param url The URL to subscribe to.
60 * @param accessToken The OAuth2 access token for bearer authentication.
61 * @return The {@link Request}.
63 Request createSseRequest(String url, String accessToken);