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
a51d819e
Commit
a51d819e
authored
6 years ago
by
Auke Klazema
Browse files
Options
Downloads
Plain Diff
SW-596
: Merge task branch back to release branch
parents
ec072fd4
e26ad0c2
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
MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
+64
-7
64 additions, 7 deletions
MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
with
64 additions
and
7 deletions
MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
+
64
−
7
View file @
a51d819e
...
@@ -252,17 +252,74 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
...
@@ -252,17 +252,74 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
// Try to connect to the SAS database.
// Try to connect to the SAS database.
ParameterSet
*
pParamSet
=
globalParameterSet
();
ParameterSet
*
pParamSet
=
globalParameterSet
();
string
username
=
pParamSet
->
getString
(
"OTDBusername"
);
std
::
string
username
;
string
DBname
=
pParamSet
->
getString
(
"OTDBdatabasename"
);
try
string
password
=
pParamSet
->
getString
(
"OTDBpassword"
);
{
string
hostname
=
pParamSet
->
getString
(
"OTDBhostname"
);
username
=
pParamSet
->
getString
(
"OTDBusername"
);
}
catch
(
LOFAR
::
APSException
&
ex
)
{
LOG_ERROR_STR
(
"MACScheduler code caught an exception while trying to "
"read the OTDB database user name from its configuration file: "
<<
ex
.
what
());
throw
(
ex
);
}
std
::
string
DBname
;
try
{
DBname
=
pParamSet
->
getString
(
"OTDBdatabasename"
);
}
catch
(
LOFAR
::
APSException
&
ex
)
{
LOG_ERROR_STR
(
"MACScheduler code caught an exception while trying to "
"read the OTDB database name from its configuration file: "
<<
ex
.
what
());
throw
(
ex
);
}
std
::
string
password
;
try
{
password
=
pParamSet
->
getString
(
"OTDBpassword"
);
}
catch
(
LOFAR
::
APSException
&
ex
)
{
LOG_ERROR_STR
(
"MACScheduler code caught an exception while trying to "
"read the OTDB database password from its configuration file: "
<<
ex
.
what
());
throw
(
ex
);
}
std
::
string
hostname
;
try
{
hostname
=
pParamSet
->
getString
(
"OTDBhostname"
);
}
catch
(
LOFAR
::
APSException
&
ex
)
{
LOG_ERROR_STR
(
"MACScheduler code caught an exception while trying to "
"read the OTDB database server host name from its configuration file: "
<<
ex
.
what
());
throw
(
ex
);
}
std
::
string
port
;
try
{
port
=
pParamSet
->
getString
(
"OTDBport"
);
}
catch
(
LOFAR
::
APSException
&
ex
)
{
LOG_ERROR_STR
(
"MACScheduler code caught an exception while trying to "
"read the OTDB database server port from its configuration file: "
<<
ex
.
what
());
throw
(
ex
);
}
LOG_INFO_STR
(
"Trying to connect to the OTDB on "
<<
hostname
);
LOG_INFO_STR
(
"Trying to connect to the OTDB on "
<<
hostname
);
itsOTDBconnection
=
new
OTDBconnection
(
username
,
password
,
DBname
,
hostname
);
itsOTDBconnection
=
new
OTDBconnection
(
username
,
password
,
DBname
,
hostname
,
port
);
ASSERTSTR
(
itsOTDBconnection
,
"Memory allocation error (OTDB)"
);
ASSERTSTR
(
itsOTDBconnection
,
"Memory allocation error (OTDB)"
);
ASSERTSTR
(
itsOTDBconnection
->
connect
(),
ASSERTSTR
(
itsOTDBconnection
->
connect
(),
"Unable to connect to database "
<<
DBname
<<
" on "
<<
hostname
<<
"Unable to connect to database "
<<
DBname
<<
" on "
<<
hostname
<<
" using "
<<
username
<<
","
<<
password
);
" port: "
<<
port
<<
" using "
<<
username
<<
","
<<
password
);
LOG_INFO
(
"Connected to the OTDB"
);
LOG_INFO
(
"Connected to the OTDB"
);
itsPropertySet
->
setValue
(
PN_MS_OTDB_CONNECTED
,
GCFPVBool
(
true
));
itsPropertySet
->
setValue
(
PN_MS_OTDB_CONNECTED
,
GCFPVBool
(
true
));
...
...
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