2 * Copyright (c) 2010-2022 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.ipcamera.internal;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
17 import io.netty.channel.Channel;
18 import io.netty.channel.ChannelFuture;
21 * The {@link ChannelTracking} Can be used to find the handle for a HTTP channel if you know the URL. The reply can
22 * optionally be stored for later use.
25 * @author Matthew Skinner - Initial contribution
29 public class ChannelTracking {
30 private String storedReply = "";
31 private String requestUrl = "";
32 private Channel channel;
34 public ChannelTracking(Channel channel, String requestUrl) {
35 this.channel = channel;
36 this.requestUrl = requestUrl;
39 public String getRequestUrl() {
43 public Channel getChannel() {
48 * Closes the channel, but keeps the HTTP reply stored in the tracker.
50 * @return ChannelFuture
52 public ChannelFuture closeChannel() {
53 return channel.close();
56 public String getReply() {
60 public void setReply(String replyToStore) {
61 storedReply = replyToStore;
64 public void setChannel(Channel ch) {