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
7da2ddcc
Commit
7da2ddcc
authored
Jun 15, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable some log for debugging purpose
parent
4982e0da
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
src/nrf_app/nrf_app.cpp
src/nrf_app/nrf_app.cpp
+12
-8
No files found.
src/nrf_app/nrf_app.cpp
View file @
7da2ddcc
...
...
@@ -80,12 +80,15 @@ nrf_app::nrf_app(const std::string& config_file, nrf_event& ev)
Logger
::
nrf_app
().
startup
(
"Started"
);
}
//------------------------------------------------------------------------------
nrf_app
::~
nrf_app
()
{
Logger
::
nrf_app
().
debug
(
"Delete NRF_APP instance..."
);
for
(
auto
i
:
connections
)
{
if
(
i
.
connected
())
i
.
disconnect
();
}
if
(
nrf_client_inst
)
delete
nrf_client_inst
;
if
(
nrf_jwt_inst
)
delete
nrf_jwt_inst
;
}
//------------------------------------------------------------------------------
...
...
@@ -106,7 +109,7 @@ void nrf_app::handle_register_nf_instance(
// Check if nfInstanceID is a valid UUID (version 4)
if
(
!
api_conv
::
validate_uuid
(
nf_instance_id
))
{
http_code
=
HTTP_STATUS_CODE_400_BAD_REQUEST
;
Logger
::
nrf_app
().
debug
(
Logger
::
nrf_app
().
info
(
"Bad UUID format for NF Instance ID (%s)"
,
nf_instance_id
.
c_str
());
problem_details
.
setCause
(
protocol_application_error_e2str
[
MANDATORY_QUERY_PARAM_INCORRECT
]);
...
...
@@ -148,7 +151,8 @@ void nrf_app::handle_register_nf_instance(
http_code
=
HTTP_STATUS_CODE_201_CREATED
;
// add to the DB
add_nf_profile
(
nf_instance_id
,
sn
);
Logger
::
nrf_app
().
debug
(
"Added/Updated NF Profile to the DB"
);
Logger
::
nrf_app
().
info
(
"Added/Updated NF Profile (ID %s) to the DB"
,
nf_instance_id
.
c_str
());
// Heartbeart management for this NF profile
// get current time
...
...
@@ -210,7 +214,7 @@ void nrf_app::handle_update_nf_instance(
case
PATCH_OP_REPLACE
:
{
if
(
path
.
compare
(
"nfStatus"
)
==
0
)
{
is_heartbeart_procedure
=
true
;
Logger
::
nrf_app
().
debug
(
"NF Heart-Beat procedure!"
);
Logger
::
nrf_app
().
info
(
"NF Heart-Beat procedure!"
);
}
if
(
sn
.
get
()
->
replace_profile_info
(
path
,
p
.
getValue
()))
{
update_nf_profile
(
nf_instance_id
,
sn
);
...
...
@@ -352,7 +356,7 @@ void nrf_app::handle_get_nf_instance(
profile
=
find_nf_profile
(
nf_instance_id
);
if
(
profile
.
get
()
==
nullptr
)
{
Logger
::
nrf_app
().
debug
(
Logger
::
nrf_app
().
info
(
"Profile with profile ID %s not found"
,
nf_instance_id
.
c_str
());
http_code
=
HTTP_STATUS_CODE_404_NOT_FOUND
;
problem_details
.
setCause
(
...
...
@@ -383,7 +387,7 @@ void nrf_app::handle_deregister_nf_instance(
m_event_sub
.
nf_status_deregistered
(
profile
);
// from nrf_app
if
(
remove_nf_profile
(
nf_instance_id
))
{
Logger
::
nrf_app
().
debug
(
Logger
::
nrf_app
().
info
(
"Removed NF profile with profile ID %s"
,
nf_instance_id
.
c_str
());
http_code
=
HTTP_STATUS_CODE_204_NO_CONTENT
;
return
;
...
...
@@ -394,7 +398,7 @@ void nrf_app::handle_deregister_nf_instance(
return
;
}
}
else
{
Logger
::
nrf_app
().
debug
(
Logger
::
nrf_app
().
info
(
"Profile with profile ID %s not found"
,
nf_instance_id
.
c_str
());
http_code
=
HTTP_STATUS_CODE_404_NOT_FOUND
;
problem_details
.
setCause
(
...
...
@@ -1017,7 +1021,7 @@ void nrf_app::handle_nf_status_profile_changed(const std::string& profile_id) {
void
nrf_app
::
get_subscription_list
(
const
std
::
string
&
profile_id
,
const
uint8_t
&
notification_type
,
std
::
vector
<
std
::
string
>&
uris
)
const
{
Logger
::
nrf_app
().
debug
(
Logger
::
nrf_app
().
info
(
"
\t
Get the list of subscriptions related to this profile, profile id %s"
,
profile_id
.
c_str
());
...
...
@@ -1074,7 +1078,7 @@ void nrf_app::get_subscription_list(
std
::
string
nf_type
=
nf_type_e2str
[
profile
.
get
()
->
get_nf_type
()];
if
(
nf_type
.
compare
(
condition
.
nf_type
)
==
0
)
{
uris
.
push_back
(
uri
);
Logger
::
nrf_app
().
debug
(
Logger
::
nrf_app
().
info
(
"
\t
Subscription id %s, uri %s"
,
s
.
first
.
c_str
(),
uri
.
c_str
());
}
}
break
;
...
...
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