Class 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.OutputStream toServer  
    • 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
      boolean connected()
      Check connection status
      void disconnect()
      Close the connection
      void send​(java.lang.String message)
      Sends a string message through the socket
      void start​(Callback messageCallback, Callback errorCallback)
      Open the connection
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • toServer

        public final java.io.OutputStream toServer
    • Constructor Detail

      • SSLConnection

        public SSLConnection​(java.lang.String address,
                             int port,
                             WappstoCerts certs)
                      throws java.lang.Exception
        Create a connection over SSL
        Parameters:
        address - socket address
        port - socket port
        certs - 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.IOException
        Close the connection
        Specified by:
        disconnect in interface Connection
        Throws:
        java.io.IOException
      • start

        public void start​(Callback messageCallback,
                          Callback errorCallback)
                   throws java.lang.Exception
        Open the connection
        Specified by:
        start in interface Connection
        Parameters:
        messageCallback - message callback passed to the input reader
        errorCallback - error callbakc passed to the input reader
        Throws:
        java.lang.Exception
      • send

        public void send​(java.lang.String message)
                  throws java.io.IOException
        Sends a string message through the socket
        Specified by:
        send in interface Connection
        Parameters:
        message - message sent
        Throws:
        java.io.IOException