Commit fa1bf39f authored by Oana-Eliza Alexa's avatar Oana-Eliza Alexa
Browse files

rebase

1 merge request!76Draft: Resolve "Redesign notifications class"
Pipeline #32374 failed with stages
in 16 seconds
Showing with 17 additions and 18 deletions
+17 -18
...@@ -62,7 +62,6 @@ class Notifications implements EndpointInterface ...@@ -62,7 +62,6 @@ class Notifications implements EndpointInterface
foreach ($notificationsSubTasks as $task) { foreach ($notificationsSubTasks as $task) {
// If the tasks must be treated - status and scheduled - process the sub-tasks // If the tasks must be treated - status and scheduled - process the sub-tasks
if ($this->gateway->statusAndScheduleCheck($task)) { if ($this->gateway->statusAndScheduleCheck($task)) {
// Retrieve data from the main task // Retrieve data from the main task
$notificationsMainTask = $this->getNotificationsMainTask($task['fdtasksgranularmaster'][0]); $notificationsMainTask = $this->getNotificationsMainTask($task['fdtasksgranularmaster'][0]);
$notificationsMainTaskName = $task['fdtasksgranularmaster'][0]; $notificationsMainTaskName = $task['fdtasksgranularmaster'][0];
...@@ -99,26 +98,26 @@ class Notifications implements EndpointInterface ...@@ -99,26 +98,26 @@ class Notifications implements EndpointInterface
private function getMatchingAttrs (array $notificationsMainTask, array $task): array private function getMatchingAttrs (array $notificationsMainTask, array $task): array
{ {
// Simply retrieve the list of audited attributes // Simply retrieve the list of audited attributes
$auditAttributes = $this->decodeAuditAttributes($task); $auditAttributes = $this->decodeAuditAttributes($task);
// Recovering monitored attributes list from the defined notification task. // Recovering monitored attributes list from the defined notification task.
$monitoredAttrs = $notificationsMainTask[0]['fdtasksnotificationsattributes']; $monitoredAttrs = $notificationsMainTask[0]['fdtasksnotificationsattributes'];
// Reformat supann // Reformat supann
$monitoredSupannResource = $this->getSupannResourceState($notificationsMainTask[0]); $monitoredSupannResource = $this->getSupannResourceState($notificationsMainTask[0]);
// Simply remove keys with 'count' reported by ldap. // Simply remove keys with 'count' reported by ldap.
$this->gateway->unsetCountKeys($monitoredAttrs); $this->gateway->unsetCountKeys($monitoredAttrs);
$this->gateway->unsetCountKeys($monitoredSupannResource); $this->gateway->unsetCountKeys($monitoredSupannResource);
// Find matching attributes between audited and monitored attributes // Find matching attributes between audited and monitored attributes
$matchingAttrs = Utils::findMatchingKeys($auditAttributes, $monitoredAttrs); $matchingAttrs = $this->findMatchingAttributes($auditAttributes, $monitoredAttrs);
// Verify Supann resource state if applicable // Verify Supann resource state if applicable
if ($this->shouldVerifySupannResource($monitoredSupannResource, $auditAttributes)) { if ($this->shouldVerifySupannResource($monitoredSupannResource, $auditAttributes)) {
// Adds it to the mating attrs for further notification process. // Adds it to the mating attrs for further notification process.
$matchingAttrs[] = 'supannRessourceEtat'; $matchingAttrs[] = 'supannRessourceEtat';
} }
return $matchingAttrs; return $matchingAttrs;
} }
...@@ -188,7 +187,7 @@ class Notifications implements EndpointInterface ...@@ -188,7 +187,7 @@ class Notifications implements EndpointInterface
} }
// Get all the values only of a multidimensional array. // Get all the values only of a multidimensional array.
$auditedValues = Utils::getArrayValuesRecursive($auditedAttrs); $auditedValues = $this->getArrayValuesRecursive($auditedAttrs);
return in_array($monitoredSupannState, $auditedValues); return in_array($monitoredSupannState, $auditedValues);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment