Feature extend system management resource with custom data (#423)

* Added map to system management and mgmt resource to extend the the rest resource with custom data

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Lazy initialization of hash map and typo fix

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Renamed the map to usageData

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Adapted hashcode and equals and now returning empty map

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Reduced duplicated code

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Removed the if statement

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Added separated method for lazy initialization 

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>
This commit is contained in:
Jonathan Knoblauch
2017-01-27 16:42:25 +01:00
committed by Michael Hirsch
parent a00ea49e47
commit d553716cda
3 changed files with 51 additions and 38 deletions

View File

@@ -87,7 +87,9 @@ public class MgmtSystemManagementResource implements MgmtSystemManagementRestApi
result.setArtifacts(tenant.getArtifacts());
result.setOverallArtifactVolumeInBytes(tenant.getOverallArtifactVolumeInBytes());
result.setTargets(tenant.getTargets());
if (!tenant.getUsageData().isEmpty()) {
result.setUsageData(tenant.getUsageData());
}
return result;
}