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
ccacddcf
Commit
ccacddcf
authored
1 month ago
by
Oana-Eliza Alexa
Browse files
Options
Download
Patches
Plain Diff
Refactor libraries
parent
ac6c657c
80-redesign-notifications-class
1 merge request
!76
Draft: Resolve "Redesign notifications class"
This commit is part of merge request
!76
. Comments created here will be created in the context of that merge request.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/tasks/Notifications.php
+17
-16
plugins/tasks/Notifications.php
with
17 additions
and
16 deletions
+17
-16
plugins/tasks/Notifications.php
+
17
−
16
Edit
View file @
ccacddcf
...
@@ -64,6 +64,7 @@ class Notifications implements EndpointInterface
...
@@ -64,6 +64,7 @@ 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
];
...
@@ -100,26 +101,26 @@ class Notifications implements EndpointInterface
...
@@ -100,26 +101,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
=
$this
->
findMatching
Attribute
s
(
$auditAttributes
,
$monitoredAttrs
);
$matchingAttrs
=
Utils
::
findMatching
Key
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
;
}
}
...
...
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