Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
fusiondirectory-orchestrator
Commits
fa1bf39f
Commit
fa1bf39f
authored
1 month ago
by
Oana-Eliza Alexa
Browse files
Options
Download
Patches
Plain Diff
rebase
parent
a4f9d357
80-redesign-notifications-class
1 merge request
!76
Draft: Resolve "Redesign notifications class"
Pipeline
#32374
failed with stages
in 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/tasks/Notifications.php
+17
-18
plugins/tasks/Notifications.php
with
17 additions
and
18 deletions
+17
-18
plugins/tasks/Notifications.php
+
17
−
18
View file @
fa1bf39f
...
@@ -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
::
findMatching
Key
s
(
$auditAttributes
,
$monitoredAttrs
);
$matchingAttrs
=
$this
->
findMatching
Attribute
s
(
$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
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets