Refactored the ExecutionQueue: Added comments to all the methods. Moved
helper methods (private) down and public up. 
- Changed the visibility of isLoaded(), as this method should not be
interesting for other classes. As the visiblity has changed, the
ExecutionQueueManager now uses isExecuting() to check if a queue is
working.
- Added a method to get the ExperimentStatus for a experiment with the
given key. The Key is created when the experiment is added to the
execution queue and removed from the ScheduledExperiment database table.
Currently the hashCode for the ScheduledExperiment is used for the key
to access the experiment. As the ScenarioDefinition is inserted into the
hashCode function, it should work properly.
- Changed the visiblity for creating singleton constructor for the
ThreadPool to private. And call this in the constructor, as it the right
place instead of calling the contructor when executing an experiment.
- changed the name of executeNext() to execute(QueuedExperiment), as
executeNext implies to execute the next experiment in the queue. But
actually, it takes the current experiment selected and that was
confusing. Beside, it implies a side-effect which is really ugly.
- Now the MECLog is always stored in the database when a status is
incoming. This is used to always have the correct object in the
database, rather than only store the result in the database.

The ExecutionScheduler now returns a key to the added experiment. And it
has a method which returns the status of the experiment with the given
key. This method is not used yet, but can be used by the REST service.

Added an experiment key to an ExecutedExperimentDetail. This is the best
way to identify the experiment again! The MECLog is now commented out.

Renamed the RunningControllerStatus to ExperimentStatus, as it's better
for understanding. In addition, the ExperimentStatus can be queried for
experiments, which are not running yet.

Change-Id: If6f8858dc24651d20962228ca281bef47e8409af
Signed-off-by: Peter Merkert <p.merkert@sap.com>
IMPORTANT FIX!
Added a new method to the ScheduledExperiment to get the ExperimentKey
which currently just refers to the HashCode method. As the method name
implies Jackson to search for a class field the MixIn is enhanced.

Fixed the hashCode function, as using the hashCode function for the maps
and list CANNOT be used when persisting the object! The hashCode does
change afterwards and cannot be compared. Therefore the hashcode is now
calculated "manually" for lists.

Change-Id: Id32ba7dd8aeefe03d3e226cc34fda424c0a2bb0f
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Refactored the ExecutionQueue to use the new getExperimentKey method for
a ScheduledeExperiment.

Change-Id: I06f5144f32b7b02349cb0504d9274b3a83e3f4e4
Signed-off-by: Peter Merkert <p.merkert@sap.com>
The default state for a scenario should be false in the test, because
otherwise we need directly to provide the selected experiment list. But
we want to test this method.

Fixed the test to work with the key-exchange for a scenario when adding
to execution queue.

Change-Id: I85eb345f49d75bb010a1d23aba0fc717e44cbb9d
Signed-off-by: Peter Merkert <p.merkert@sap.com>
The method to get the state of the experiment in execution only checked
the ExecutionQueues. But the scenario might still be in the
ScheduledExperiment database table, because it's not fetched yet.

Now the schedulede experiment table is checked, too.

Change-Id: I2c47899cde01f96db0be7b9c28d4778a12c3ec9b
Signed-off-by: Peter Merkert <p.merkert@sap.com>
The ExecutionService now enables and disables a scenario. Via enabling
the scenario might get into the execution queue. There are a lot of
checks inserted into enabling to provide a valid ScheeduledExperiment
into the execution queue.

To set the ExperimentSeriesDefinition which is executed, two method (PUT
+ DELETE) have been added. The ServiceConfiguration is extends with the
new service URLs.

Fixed the ExecutionServiceTest to work with the new result object.

Change-Id: Ie1a4ad59989dbe301ea95c6c655a272091400863
Signed-off-by: Peter Merkert <p.merkert@sap.com>