]> git.basschouten.com Git - openhab-addons.git/blob
6487f9285100bfef2b4ff03f8e02e5ceba748639
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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 /*
14  * This file is based on URLServiceSubscription:
15  *
16  * Connect SDK
17  *
18  * Copyright (c) 2014 LG Electronics.
19  * Created by Hyun Kook Khang on 19 Jan 2014
20  *
21  * Licensed under the Apache License, Version 2.0 (the "License");
22  * you may not use this file except in compliance with the License.
23  * You may obtain a copy of the License at
24  *
25  *     http://www.apache.org/licenses/LICENSE-2.0
26  *
27  * Unless required by applicable law or agreed to in writing, software
28  * distributed under the License is distributed on an "AS IS" BASIS,
29  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30  * See the License for the specific language governing permissions and
31  * limitations under the License.
32  */
33
34 package org.openhab.binding.lgwebos.internal.handler.command;
35
36 import java.util.function.Function;
37
38 import org.eclipse.jdt.annotation.Nullable;
39 import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener;
40
41 import com.google.gson.JsonObject;
42
43 /**
44  * Internal implementation of ServiceSubscription for URL-based commands.
45  *
46  *
47  * @author Hyun Kook Khang - Connect SDK initial contribution
48  * @author Sebastian Prehn - Adoption for openHAB
49  */
50 public class ServiceSubscription<T> extends ServiceCommand<T> {
51
52     public ServiceSubscription(String uri, JsonObject payload, Function<JsonObject, @Nullable T> converter,
53             ResponseListener<T> listener) {
54         super(uri, payload, converter, listener);
55         type = Type.subscribe;
56     }
57 }