forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[neohub] Add support for WebSocket connection to hub (openhab#12915)
* [neohub] add support for secure web socket connection * [neohub] clean code * [neohub] synchronize api calls * [neohub] rename classes, fix compiler errors, remove SuppressWarnings Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
- Loading branch information
Showing
14 changed files
with
521 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...ab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubSocketBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* Copyright (c) 2010-2022 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.neohub.internal; | ||
|
||
import java.io.Closeable; | ||
import java.io.IOException; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* Base abstract class for ASCII based communication between openHAB and NeoHub | ||
* | ||
* @author Andrew Fiddian-Green - Initial contribution | ||
* | ||
*/ | ||
@NonNullByDefault | ||
public abstract class NeoHubSocketBase implements Closeable { | ||
|
||
protected final NeoHubConfiguration config; | ||
|
||
public NeoHubSocketBase(NeoHubConfiguration config) { | ||
this.config = config; | ||
} | ||
|
||
/** | ||
* Sends the message over the network to the NeoHub and returns its response | ||
* | ||
* @param requestJson the message to be sent to the NeoHub | ||
* @return responseJson received from NeoHub | ||
* @throws NeoHubException, IOException | ||
* | ||
*/ | ||
public abstract String sendMessage(final String requestJson) throws IOException, NeoHubException; | ||
} |
Oops, something went wrong.