diff options
Diffstat (limited to 'participant/participant-intermediary')
3 files changed, 16 insertions, 3 deletions
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java index 43ac3464c..bbafc4678 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java @@ -89,7 +89,7 @@ public class ParticipantIntermediaryApiImpl implements ParticipantIntermediaryAp @Override public void updateParticipantStatistics(ParticipantStatistics participantStatistics) { - // TODO Auto-generated method stub + participantHandler.updateParticipantStatistics(participantStatistics); } @Override diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java index d7537e3d8..89a13a84b 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java @@ -190,6 +190,19 @@ public class ParticipantHandler { } /** + * Method to update participant statistics. + * + * @param statistics participant statistics + */ + public void updateParticipantStatistics(ParticipantStatistics statistics) { + participantStatistics.setState(statistics.getState()); + participantStatistics.setHealthStatus(statistics.getHealthStatus()); + participantStatistics.setTimeStamp(statistics.getTimeStamp()); + participantStatistics.setAverageExecutionTime(statistics.getAverageExecutionTime()); + participantStatistics.setEventCount(statistics.getEventCount()); + } + + /** * Get participants as a {@link Participant} class. * * @param name the participant name to get diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandlerTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandlerTest.java index e77dd69ee..676747d04 100644 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandlerTest.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandlerTest.java @@ -132,11 +132,11 @@ class ControlLoopHandlerTest { stateChange.setTimestamp(Instant.ofEpochMilli(3000)); var clh = setTestControlLoopHandler(id, uuid); - clh.handleControlLoopStateChange(stateChange); + clh.handleControlLoopStateChange(stateChange, List.of()); var newid = new ToscaConceptIdentifier("id", "1.2.3"); stateChange.setControlLoopId(newid); stateChange.setParticipantId(newid); - assertDoesNotThrow(() -> clh.handleControlLoopStateChange(stateChange)); + assertDoesNotThrow(() -> clh.handleControlLoopStateChange(stateChange, List.of())); List<ControlLoopElementDefinition> clElementDefinitions = new ArrayList<>(); var cld = new ControlLoopElementDefinition(); |