package ccf.server

import ccf.operation.Operation
import ccf.transport.{ClientId, ChannelId}
import ccf.messaging.ConcurrentOperationMessage
import collection.mutable.ArrayBuffer

class ClientState[T <: Operation](val channel: ChannelId, synchronizer: OperationSynchronizer[T]) {
  def receive(msg: ConcurrentOperationMessage[T]): T = {
    synchronizer.receiveRemoteOperation(msg)
  }
  def send(op: T): ConcurrentOperationMessage[T] = {
    synchronizer.createLocalOperation(op)
  }
}

Introduce client state to keep track of clients in server
Introduce client state to keep track of clients in server

The server needs to transform operations for each client and keep track
of their states. The state is encapsulated into this class.

Signed-off-by: Aki Saarinen <2c8035bb80cf98a391872dcbe797b269d759f6d9@reaktor.fi>
