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>
Added a test to the ExecutionService for adding scenarios only with a
valid list of selected experiments.
Removed an unecessary System.out.println when adding a new experiment
series to execution.

Fixed the corresponding JerseyTest.

Change-Id: Ib9ae7c1ea30f16887337116e990b633f43997e17
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Fixed the HashCode method to be null-safe. This means, the method does
never fail! The method is important for the application and hashCode
must not fail.

Change-Id: Ia81187c2fc5d80354bdab91cc9f3ef086d4f2223
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Removed unecessary DELETE url when the servlet already listened to
@delete. Only effected the single scenario deletion service.

Change-Id: Iba3c09c85b7834bda0f002f6d6f325112aed5e12
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Refactored the ExperimentStatus with comments and changed some names of
variables to better fit their idea.
The changed method has been refactored in the classes which creates
ExperimentStatus objects.

Added a method to return the status of an experiment with a given key.
The method has been added to the ExecutionTest test case.

Change-Id: If13726684f5719aa06de82112757d46e5763d6de
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Updated the pom.xml to build a jar and put it into the local repository.
In addition all the maven.build version are now put to the top of the
file.

Change-Id: I41e639f5173ee607a0f36ceb8ec20efb5d297d22
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Added an example project to interact with the SoPeCo service layer. The
example is minimalistic and only has a login example.

Change-Id: I46d7c041fca6b893992862c5d7985a0fbe6c6907
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Added service method to create a new account with custom database
credentials. Needed to the WebUI.

Change-Id: I22d10f96d42621a085c20f7cc7c5e901acf5a213
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Fixed name of parameter from db password to db port.

Change-Id: I728b01de5dee0820a022d747abf9937a918b00cc
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Added comment to the Users class, why the class has the name Users and
not User. Added comment to the isExpired method and annotation to the
toString method.

Change-Id: I6400e880f3790b9d5fcdac8879d88300b3c9e932
Signed-off-by: Peter Merkert <p.merkert@sap.com>
The AccountServiceTest now works with the correct service parameter
names.

Change-Id: Ic6c18639c1639f7041f10c01bdf5ef13264c33a8
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Removed now the unused SVC_ACCOUNT_ACCOUNTNAME, but added a CHECK option
to the account service.

The AccountService now has a method to check the usertoken for
expiration.

Change-Id: Ic1ec8a00c95ecbfeb49e3e9c3a1f5c609ad89b80
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Added a token check to the services. It's checks if a given token can be
mapped to a user.

Change-Id: Id541ccf6a2ed51fb8824507e535df5bad62aeead
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Added a method to set the account details and to logout. The account
details can only be modified if a valid token is passed, too. The logout
just removes the user with the given token from the database.

Change-Id: I4498f2ee454a0e99ead6bacaaca3ee8f9c1d7baf
Signed-off-by: Peter Merkert <p.merkert@sap.com>
Added a logout functionality to the SL.

Changed the param at the method to get the account info to the token
(before: account name).

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