Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-NRF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-NRF
Commits
d4678312
Commit
d4678312
authored
Sep 22, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sending notification for NF Status profile change
parent
722fe5e7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
2 deletions
+35
-2
src/nrf_app/nrf_client.cpp
src/nrf_app/nrf_client.cpp
+2
-0
src/nrf_app/nrf_profile.cpp
src/nrf_app/nrf_profile.cpp
+19
-2
src/nrf_app/nrf_profile.hpp
src/nrf_app/nrf_profile.hpp
+14
-0
No files found.
src/nrf_app/nrf_client.cpp
View file @
d4678312
...
...
@@ -269,6 +269,8 @@ void nrf_client::notify_subscribed_event(
json_data
[
"nfProfile"
]
=
json_profile
;
}
// TODO: profileChanges in case of "NF_PROFILE_CHANGED" instead of NF Profile
std
::
string
body
=
json_data
.
dump
();
for
(
auto
uri
:
uris
)
{
...
...
src/nrf_app/nrf_profile.cpp
View file @
d4678312
...
...
@@ -90,11 +90,13 @@ void nrf_profile::set_nf_status(const std::string& status) {
//------------------------------------------------------------------------------
void
nrf_profile
::
get_nf_status
(
std
::
string
&
status
)
const
{
std
::
shared_lock
lock
(
heartbeart_mutex
);
status
=
nf_status
;
}
//------------------------------------------------------------------------------
std
::
string
nrf_profile
::
get_nf_status
()
const
{
std
::
shared_lock
lock
(
heartbeart_mutex
);
return
nf_status
;
}
...
...
@@ -723,7 +725,7 @@ void nrf_profile::handle_heartbeart_timeout_nfregistration(uint64_t ms) {
"%d"
,
nf_instance_id
.
c_str
(),
ms
);
// Set status to SUSPENDED and unsubscribe to the HBT
if
(
!
is_updated
)
{
if
(
!
get_status_updated
()
)
{
set_nf_status
(
"SUSPENDED"
);
}
...
...
@@ -741,8 +743,11 @@ void nrf_profile::handle_heartbeart_timeout_nfupdate(uint64_t ms) {
"current "
"ms %ld"
,
nf_instance_id
.
c_str
(),
ms
,
current_ms
);
if
(
!
is_updated
)
{
if
(
!
get_status_updated
()
)
{
set_nf_status
(
"SUSPENDED"
);
// TODO: Notify to the subscribers
// notifCondition with ["monitoredAttributes": [ "/nfStatus""]
m_event_sub
.
nf_status_profile_changed
(
nf_instance_id
);
}
set_status_updated
(
false
);
}
...
...
@@ -753,6 +758,18 @@ void nrf_profile::set_status_updated(bool status) {
is_updated
=
status
;
}
//------------------------------------------------------------------------------
void
nrf_profile
::
get_status_updated
(
bool
&
status
)
{
std
::
shared_lock
lock
(
heartbeart_mutex
);
status
=
is_updated
;
}
//------------------------------------------------------------------------------
bool
nrf_profile
::
get_status_updated
()
{
std
::
shared_lock
lock
(
heartbeart_mutex
);
return
is_updated
;
}
//------------------------------------------------------------------------------
void
amf_profile
::
add_amf_info
(
const
amf_info_t
&
info
)
{
amf_info
=
info
;
...
...
src/nrf_app/nrf_profile.hpp
View file @
d4678312
...
...
@@ -497,6 +497,20 @@ class nrf_profile : public std::enable_shared_from_this<nrf_profile> {
*/
void
set_status_updated
(
bool
status
);
/*
* Get status updated
* @param void
* @return status
*/
bool
get_status_updated
();
/*
* Get status updated
* @param status
* @return void
*/
void
get_status_updated
(
bool
&
status
);
protected:
nrf_event
&
m_event_sub
;
bs2
::
connection
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment