Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
67c5efed
Commit
67c5efed
authored
6 years ago
by
Auke Klazema
Browse files
Options
Downloads
Plain Diff
SW-597
: Merge task branch back to release branch
parents
a51d819e
f29b6843
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/Feedback_Service/src/Feedback.cc
+64
-5
64 additions, 5 deletions
SAS/Feedback_Service/src/Feedback.cc
with
64 additions
and
5 deletions
SAS/Feedback_Service/src/Feedback.cc
+
64
−
5
View file @
67c5efed
...
@@ -128,15 +128,74 @@ GCFEvent::TResult Feedback::connect2OTDB_state(GCFEvent& event, GCFPortInterface
...
@@ -128,15 +128,74 @@ GCFEvent::TResult Feedback::connect2OTDB_state(GCFEvent& event, GCFPortInterface
LOG_DEBUG_STR
(
"Trying to read database information from file "
<<
filename
);
LOG_DEBUG_STR
(
"Trying to read database information from file "
<<
filename
);
ParameterSet
otdbconf
;
ParameterSet
otdbconf
;
otdbconf
.
adoptFile
(
filename
);
otdbconf
.
adoptFile
(
filename
);
string
database
=
otdbconf
.
getString
(
"SASGateway.OTDBdatabase"
);
string
database
;
string
dbhost
=
otdbconf
.
getString
(
"SASGateway.OTDBhostname"
);
try
itsOTDBconn
=
new
OTDBconnection
(
"paulus"
,
"boskabouter"
,
database
,
dbhost
);
{
database
=
otdbconf
.
getString
(
"SASGateway.OTDBdatabase"
);
}
catch
(
LOFAR
::
APSException
&
ex
)
{
LOG_ERROR_STR
(
"FeedbackService code caught an exception while trying to "
"read the OTDB database name from its configuration file: "
<<
ex
.
what
());
throw
(
ex
);
}
string
dbhost
;
try
{
dbhost
=
otdbconf
.
getString
(
"SASGateway.OTDBhostname"
);
}
catch
(
LOFAR
::
APSException
&
ex
)
{
LOG_ERROR_STR
(
"FeedbackService code caught an exception while trying to "
"read the OTDB database server host name from its configuration file: "
<<
ex
.
what
());
throw
(
ex
);
}
string
username
;
try
{
username
=
otdbconf
.
getString
(
"SASGateway.OTDBusername"
);
}
catch
(
LOFAR
::
APSException
&
ex
)
{
LOG_ERROR_STR
(
"FeedbackService code caught an exception while trying to "
"read the OTDB database user name from its configuration file: "
<<
ex
.
what
());
throw
(
ex
);
}
string
password
;
try
{
password
=
otdbconf
.
getString
(
"SASGateway.OTDBpassword"
);
}
catch
(
LOFAR
::
APSException
&
ex
)
{
LOG_ERROR_STR
(
"FeedbackService code caught an exception while trying to "
"read the OTDB database password from its configuration file: "
<<
ex
.
what
());
throw
(
ex
);
}
string
port
;
try
{
port
=
otdbconf
.
getString
(
"SASGateway.OTDBport"
);
}
catch
(
LOFAR
::
APSException
&
ex
)
{
LOG_ERROR_STR
(
"FeedbackService code caught an exception while trying to "
"read the OTDB database server port from its configuration file: "
<<
ex
.
what
());
throw
(
ex
);
}
itsOTDBconn
=
new
OTDBconnection
(
username
,
password
,
database
,
dbhost
,
port
);
if
(
!
itsOTDBconn
->
connect
())
{
if
(
!
itsOTDBconn
->
connect
())
{
LOG_FATAL_STR
(
"Cannot connect to database "
<<
database
<<
" on machine "
<<
dbhost
<<
", retry in 10 seconds"
);
LOG_FATAL_STR
(
"Cannot connect to database "
<<
database
<<
" on machine "
<<
dbhost
<<
" on port "
<<
port
<<
", retry in 10 seconds"
);
itsTimer
->
setTimer
(
10.0
);
itsTimer
->
setTimer
(
10.0
);
return
(
GCFEvent
::
HANDLED
);
return
(
GCFEvent
::
HANDLED
);
}
}
LOG_INFO_STR
(
"Connected to database "
<<
database
<<
" on machine "
<<
dbhost
);
LOG_INFO_STR
(
"Connected to database "
<<
database
<<
" on machine "
<<
dbhost
<<
" on port "
<<
port
);
TRAN
(
Feedback
::
operational_state
);
TRAN
(
Feedback
::
operational_state
);
}
break
;
}
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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