Some refactoring of Importer classes for clarity

After trying to add a new translator and enhance the Neutron translation
I found the code a bit complex to follow. I'm proposing some
modifications here reducing some of the indirections, model hierarchies,
and naming trying to make the thing a bit more obvious for newcomers.

It also moves some of the classes from cluster to brain, following the
standard criteria that cluster hosts all stuff that is relevant to
interfaces exposed by the cluster to the rest of MidoNet services; brain
hosts the actual service implementations. This is increasingly important
to control the dependency graph accross modules.

Change-Id: If782ebfaa9a37ae2cb0815684d9f16adea4299c1
Signed-off-by: Galo Navarro <galo@midokura.com>
Skeleton impls for remaining translators.

This patch provides NeutronTranslator boiler-plates for for ther
remaining Neutron elements, which are:

- FloatingIp
- VIP
- HealthMonitor
- Pool
- Member
- PoolHealthMonitor

The following are already included in the SecurityGroup Translator
patch (https://review.gerrithub.io/#/c/14194/):

- SecurityGroup
- Port
- Router
- Subnet

Change-Id: I47474418d1c5372f9a61b1064db9e2b62221e2f2
Tests C3PO Daemon with SQLite/ZK test server.

This patch runs an end-to-end test for C3PO Daemon with SQLite as the
sql DB and the in-memory ZooKeeper as a test server. It starts the
Cluster Daemon from inside a Scala Test by providing a test Minion
configuration for C3PO and running C3PO properly as a Minion. Sets up
the MidoNet Tasks DB table on SQLite with a mock DataSource adaptor
for SQLite as SQLite doesn't seem to provide JDBC 2.0 API. Uses
Curator's in-memory ZooKeeper testing server as a ZK backend.

Fix MN-2999
Change-Id: I57c966dee31214670793ddc601e7a8d5dba6f4e3
Implements await with FutureOps.

Waiting on a future such as one returned by Storage is a very common
operation. This implements "await()" method with FutureOps that waits
on a FutureOp to complete for a specified amount of time, 1 second by
default. Used with org.midonet.util.concurrent.toFutureOps, scala
Future is implicitly converted to FutureOp, and a client can wait for
its completion by simply calling await().

Change-Id: I6518ae82b0a0137d83dca1a1130be2ba61ed5663
Fixes NeutronPort.device_owner proto definition.

Neutron's Port object's "device_owner" attribute is an enum field, but
corresponding NeutronPort's device_owner is a string field even though
DeviceOwner enum has been defined. Changed the proto field to an enum
field.

Change-Id: Id01afa38bb52fec729219aa6c1d2e629e4fc1ba0
Utility additions and fixes

1. IPSubnetUtil changed to value class, and String -> Protobuf conversion added.
2. UUIDUtil changed to value class, and nextUuid operation added.
3. StringUtil added with indent method.

Change-Id: Ieb5e2cf71eec6f7f7ffc4aa747099944182e0499
Signed-off-by: Brandon Berg <bberg@midokura.com>
Merge "Utility additions and fixes"
Allow setting port id

Allows the user to specify the port id when creating a port through
the midonet API.

Converter.java: copys over the id of the port to the config
PortZkManager.java: only generate a new UUID for the port id if it is
    not already set.

Change-Id: I229df492b4b9368214abd97ba0d9e41882f48d9c
Signed-off-by: Joe Mills <joe@midokura.com>
Allow setting of the port id

Change-Id: I312c982e0850fcf9d800433d9b6705b36fb4d884
Signed-off-by: Joe Mills <joe@midokura.com>
More translator stubs, plus refactoring.

Add more translators stubs, move pattern matching on NeutronOp into
base NeutronTranslator trait, and move all translators into
translators package.

Change-Id: Ib3c4cddf3c58389615d3b97860f94ff987b1c9bc
Signed-off-by: Brandon Berg <bberg@midokura.com>
Bump version to 1.8

Change-Id: I77242895cf7b03eda7ff26b756200e4431f2ae50
Signed-off-by: Joe Mills <joe@midokura.com>
Merge "Allow setting port id"
Merge "More translator stubs, plus refactoring."
Merge "Fixes NeutronPort.device_owner proto definition."
Merge "Bump version to 1.8"
Merge "Allow setting of the port id"
Keeps a dummy SQLite in-memory DB connection.

In order to maintain an SQLite in-memory DB state over multiple
connections, we need to create one first and maintain a reference to
it throughout the test. Otherwise, the DB state is lost each time the
conneciton is closed.

Change-Id: I185e12ef50611b37b1270920304ac8e960249e5a
Merge "Keeps a dummy SQLite in-memory DB connection."
WildcardMatch: Make the datapath port an Int

Change-Id: Ie56567b63754222aca4742aac676eda0b7258df3
Signed-off-by: Duarte Nunes <duarte@midokura.com>
Various fixes for Neutron importation.

Change-Id: Iede9ad171157bd8443ccfee7877155131b74f7ce
Signed-off-by: Brandon Berg <bberg@midokura.com>