Class HttpServerConnection

java.lang.Object
org.sblim.cimclient.internal.http.HttpServerConnection
All Implemented Interfaces:
java.lang.Runnable

public class HttpServerConnection extends java.lang.Object implements java.lang.Runnable
Class HttpServerConnection implements the outer shell of a HTTP server. It accepts incoming connections and puts them in a queue to be serviced by an independent thread
  • Constructor Summary

    Constructors
    Constructor
    Description
    HttpServerConnection(HttpConnectionHandler pHandler, java.lang.String pLocalAddress, int pPort, boolean pSsl, WBEMConfiguration pProperties)
    Ctor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the socket and shuts down the listening threads
    java.lang.String
    Returns the local hostname the socket is bound to
    java.lang.String
    Returns the local ip address the socket is bound to
    int
    Returns the port
    boolean
    Return whether this connection is SSL secured
    void
    run()
     
    void
    setName(java.lang.String pName)
    Set the name of the thread
    void
    Starts a thread that waits for incoming connections

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HttpServerConnection

      public HttpServerConnection(HttpConnectionHandler pHandler, java.lang.String pLocalAddress, int pPort, boolean pSsl, WBEMConfiguration pProperties) throws java.io.IOException
      Ctor.
      Parameters:
      pHandler - The connection handler
      pLocalAddress - The local address to bind the port to. If null the port is bound to all local addresses. For use on multi-homed systems
      pPort - The local port. If zero any free port will be chosen.
      pSsl - SSL secured connection ?
      pProperties - The configuration context
      Throws:
      java.io.IOException
  • Method Details

    • setName

      public void setName(java.lang.String pName)
      Set the name of the thread
      Parameters:
      pName - The new value
    • getPort

      public int getPort()
      Returns the port
      Returns:
      The port
    • getLocalIp

      public java.lang.String getLocalIp() throws java.net.UnknownHostException
      Returns the local ip address the socket is bound to
      Returns:
      The ip address
      Throws:
      java.net.UnknownHostException
    • getLocalHostName

      public java.lang.String getLocalHostName() throws java.net.UnknownHostException
      Returns the local hostname the socket is bound to
      Returns:
      The host name
      Throws:
      java.net.UnknownHostException
    • isSSL

      public boolean isSSL()
      Return whether this connection is SSL secured
      Returns:
      true if SSL is enabled, false otherwise
    • start

      public void start()
      Starts a thread that waits for incoming connections
    • run

      public void run()
      Specified by:
      run in interface java.lang.Runnable
    • close

      public void close()
      Closes the socket and shuts down the listening threads