Package wappsto.iot.ssl
Class SSLConnection
- java.lang.Object
-
- wappsto.iot.ssl.SSLConnection
-
- All Implemented Interfaces:
Connection
public class SSLConnection extends java.lang.Object implements Connection
Adapter class for the SSL socket
-
-
Field Summary
Fields Modifier and Type Field Description java.io.OutputStreamtoServer
-
Constructor Summary
Constructors Constructor Description SSLConnection(java.lang.String address, int port, WappstoCerts certs)Create a connection over SSL
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanconnected()Check connection statusvoiddisconnect()Close the connectionvoidsend(java.lang.String message)Sends a string message through the socketvoidstart(Callback messageCallback, Callback errorCallback)Open the connection
-
-
-
Constructor Detail
-
SSLConnection
public SSLConnection(java.lang.String address, int port, WappstoCerts certs) throws java.lang.ExceptionCreate a connection over SSL- Parameters:
address- socket addressport- socket portcerts- certificates to use with the connection- Throws:
java.lang.Exception
-
-
Method Detail
-
connected
public boolean connected()
Check connection status- Returns:
- is connected
-
disconnect
public void disconnect() throws java.io.IOExceptionClose the connection- Specified by:
disconnectin interfaceConnection- Throws:
java.io.IOException
-
start
public void start(Callback messageCallback, Callback errorCallback) throws java.lang.Exception
Open the connection- Specified by:
startin interfaceConnection- Parameters:
messageCallback- message callback passed to the input readererrorCallback- error callbakc passed to the input reader- Throws:
java.lang.Exception
-
send
public void send(java.lang.String message) throws java.io.IOExceptionSends a string message through the socket- Specified by:
sendin interfaceConnection- Parameters:
message- message sent- Throws:
java.io.IOException
-
-