ch.hevs.isi.web

## Class WebConnector

- java.lang.Object
- - ch.hevs.isi.web.WebConnector

All Implemented Interfaces:
  DataPointListener

    public class WebConnector
    extends java.lang.Object
    implements DataPointListener

### Field Summary

Fields
`org.java_websocket.server.WebSocketServer` `wss`

### Fields inherited from interface ch.hevs.isi.core.DataPointListener

`listeners`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static WebConnector` `getMySelf()` Get the singleton instance create it if it does not exist
`void` `initialize(java.lang.String host, int port)` Initialize webConnector by initializing the websocket server - define all the callbacks for the websocket server (onOpen, onClose, onMessage, onError, onStart) - start the websocket server - wait for the first connection
`void` `onNewValue(DataPoint dp)` Callback for the update of a dataPoint

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface ch.hevs.isi.core.DataPointListener

`subscribeUpdate`

### Field Detail

#### wss

    public org.java_websocket.server.WebSocketServer wss

### Method Detail

#### getMySelf

    public static WebConnector getMySelf()

Get the singleton instance create it if it does not exist

Returns:
  the singleton instance

#### initialize

    public void initialize(java.lang.String host,
                           int port)

Initialize webConnector by initializing the websocket server - define all the callbacks for the websocket server (onOpen, onClose, onMessage, onError, onStart) - start the websocket server - wait for the first connection

Parameters:
  `host` - url of the host (localhost)
  `port` - port for the websocket server (8888)

#### onNewValue

    public void onNewValue(DataPoint dp)

Callback for the update of a dataPoint

Specified by:
  `onNewValue` in interface `DataPointListener`
Parameters:
  `dp` - dataPoint updated