Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
metadata_exporter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IA2
metadata_exporter
Commits
eb7ff621
Commit
eb7ff621
authored
11 years ago
by
Marco De Marco
Browse files
Options
Downloads
Patches
Plain Diff
Empty schema, table, user and password fix, not exported table fix
parent
5d2bfdd2
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/Configuration.h
+19
-11
19 additions, 11 deletions
src/Configuration.h
src/MetadataExporter.cpp
+34
-1
34 additions, 1 deletion
src/MetadataExporter.cpp
src/MetadataExporter.h
+1
-0
1 addition, 0 deletions
src/MetadataExporter.h
src/ProtocolManager.cpp
+41
-30
41 additions, 30 deletions
src/ProtocolManager.cpp
with
95 additions
and
42 deletions
src/Configuration.h
+
19
−
11
View file @
eb7ff621
...
@@ -55,7 +55,7 @@ protected:
...
@@ -55,7 +55,7 @@ protected:
public
:
public
:
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// [Public]
User
method
s
// [Public]
Create class
method
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
static
Configuration
::
SP
create
(
std
::
string
certificateFile
,
static
Configuration
::
SP
create
(
std
::
string
certificateFile
,
std
::
string
privateKeyFile
,
std
::
string
dHTempFile
,
std
::
string
privateKeyFile
,
std
::
string
dHTempFile
,
...
@@ -73,19 +73,27 @@ public:
...
@@ -73,19 +73,27 @@ public:
return
c_sp
;
return
c_sp
;
}
}
std
::
string
getCertificateFile
()
const
{
return
m_certificateFile
;
};
//------------------------------------------------------------------------------
std
::
string
getPrivateKeyFile
()
const
{
return
m_privateKeyFile
;
};
// [Public] Getter methods
std
::
string
getDHTempFile
()
const
{
return
m_dHTempFile
;
};
//------------------------------------------------------------------------------
std
::
string
getLocalHost
()
const
{
return
m_localHost
;
};
std
::
string
getCertificateFile
()
const
{
return
m_certificateFile
;
}
unsigned
int
getLocalPort
()
const
{
return
m_localPort
;
};
std
::
string
getPrivateKeyFile
()
const
{
return
m_privateKeyFile
;
}
unsigned
int
getWorkerNumber
()
const
{
return
m_workerNumber
;
};
std
::
string
getDHTempFile
()
const
{
return
m_dHTempFile
;
}
std
::
string
getDatabaseHost
()
const
{
return
m_databaseHost
;
};
std
::
string
getLocalHost
()
const
{
return
m_localHost
;
}
unsigned
int
getDatabasePort
()
const
{
return
m_databasePort
;
};
unsigned
int
getLocalPort
()
const
{
return
m_localPort
;
}
std
::
string
getDatabaseUsername
()
const
{
return
m_databaseUsername
;
};
unsigned
int
getWorkerNumber
()
const
{
return
m_workerNumber
;
}
std
::
string
getDatabasePassword
()
const
{
return
m_databasePassword
;
};
std
::
string
getDatabaseHost
()
const
{
return
m_databaseHost
;
}
unsigned
int
getDatabasePort
()
const
{
return
m_databasePort
;
}
std
::
string
getDatabaseUsername
()
const
{
return
m_databaseUsername
;
}
std
::
string
getDatabasePassword
()
const
{
return
m_databasePassword
;
}
unsigned
int
getDatabaseConnectionNumber
()
const
{
return
m_databaseConnectionNumber
;
}
unsigned
int
getDatabaseConnectionNumber
()
const
{
return
m_databaseConnectionNumber
;
}
ExportedTablesMap
&
getExportedTablesMap
()
const
{
return
m_exportedTablesMap
;
}
ExportedTablesMap
&
getExportedTablesMap
()
const
{
return
m_exportedTablesMap
;
}
AuthorisedUsersMap
&
getAuthorisedUsersMap
()
const
{
return
m_authorisedUsersMap
;
}
//------------------------------------------------------------------------------
// [Public] Utilities methods
//------------------------------------------------------------------------------
bool
isTableExported
(
const
std
::
string
schema
,
const
std
::
string
table
)
bool
isTableExported
(
const
std
::
string
schema
,
const
std
::
string
table
)
{
{
std
::
pair
<
ExportedTablesMap
::
const_iterator
,
ExportedTablesMap
::
const_iterator
>
ret
;
std
::
pair
<
ExportedTablesMap
::
const_iterator
,
ExportedTablesMap
::
const_iterator
>
ret
;
...
...
This diff is collapsed.
Click to expand it.
src/MetadataExporter.cpp
+
34
−
1
View file @
eb7ff621
...
@@ -41,7 +41,6 @@
...
@@ -41,7 +41,6 @@
#include
<MetadataExporter.h>
#include
<MetadataExporter.h>
#include
<MetadataExporterClass.h>
#include
<MetadataExporterClass.h>
#include
<Configuration.h>
#include
<PlainServer.h>
#include
<PlainServer.h>
#include
<SSLServer.h>
#include
<SSLServer.h>
...
@@ -601,8 +600,25 @@ void MetadataExporter::importExportedTables(std::vector<std::string>& exportedTa
...
@@ -601,8 +600,25 @@ void MetadataExporter::importExportedTables(std::vector<std::string>& exportedTa
}
}
std
::
string
schema
=
exportedTables
.
at
(
i
).
substr
(
0
,
found
);
std
::
string
schema
=
exportedTables
.
at
(
i
).
substr
(
0
,
found
);
if
(
schema
.
empty
())
{
std
::
stringstream
errorStream
;
errorStream
<<
"ExportedTables property has empty schema at "
<<
i
<<
" position"
<<
std
::
endl
;
throw
std
::
invalid_argument
(
errorStream
.
str
());
}
std
::
string
table
=
exportedTables
.
at
(
i
).
substr
(
found
+
1
,
std
::
string
::
npos
);
std
::
string
table
=
exportedTables
.
at
(
i
).
substr
(
found
+
1
,
std
::
string
::
npos
);
if
(
table
.
empty
())
{
std
::
stringstream
errorStream
;
errorStream
<<
"ExportedTables property has empty table at "
<<
i
<<
" position"
<<
std
::
endl
;
throw
std
::
invalid_argument
(
errorStream
.
str
());
}
INFO_STREAM
<<
"MetadataExporter::importExportedTables() schema "
INFO_STREAM
<<
"MetadataExporter::importExportedTables() schema "
<<
schema
<<
" table "
<<
table
<<
endl
;
<<
schema
<<
" table "
<<
table
<<
endl
;
...
@@ -632,8 +648,25 @@ void MetadataExporter::importAuthorisedUsers(std::vector<std::string>& authorise
...
@@ -632,8 +648,25 @@ void MetadataExporter::importAuthorisedUsers(std::vector<std::string>& authorise
}
}
std
::
string
user
=
authorisedUsers
.
at
(
i
).
substr
(
0
,
found
);
std
::
string
user
=
authorisedUsers
.
at
(
i
).
substr
(
0
,
found
);
if
(
user
.
empty
())
{
std
::
stringstream
errorStream
;
errorStream
<<
"AuthorisedUsers property has empty user at "
<<
i
<<
" position"
<<
std
::
endl
;
throw
std
::
invalid_argument
(
errorStream
.
str
());
}
std
::
string
password
=
authorisedUsers
.
at
(
i
).
substr
(
found
+
1
,
std
::
string
::
npos
);
std
::
string
password
=
authorisedUsers
.
at
(
i
).
substr
(
found
+
1
,
std
::
string
::
npos
);
if
(
password
.
empty
())
{
std
::
stringstream
errorStream
;
errorStream
<<
"AuthorisedUsers property has empty password at "
<<
i
<<
" position"
<<
std
::
endl
;
throw
std
::
invalid_argument
(
errorStream
.
str
());
}
#ifdef VERBOSE_DEBUG
#ifdef VERBOSE_DEBUG
INFO_STREAM
<<
"MetadataExporter::importAuthorisedUsers() user "
INFO_STREAM
<<
"MetadataExporter::importAuthorisedUsers() user "
<<
user
<<
" password "
<<
password
<<
endl
;
<<
user
<<
" password "
<<
password
<<
endl
;
...
...
This diff is collapsed.
Click to expand it.
src/MetadataExporter.h
+
1
−
0
View file @
eb7ff621
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#ifndef MetadataExporter_H
#ifndef MetadataExporter_H
#define MetadataExporter_H
#define MetadataExporter_H
#include
<Configuration.h>
#include
<Server.h>
#include
<Server.h>
#include
<tango.h>
#include
<tango.h>
...
...
This diff is collapsed.
Click to expand it.
src/ProtocolManager.cpp
+
41
−
30
View file @
eb7ff621
...
@@ -163,6 +163,8 @@ ResponseSP ProtocolManager::prepareValidation(RequestSP request_sp)
...
@@ -163,6 +163,8 @@ ResponseSP ProtocolManager::prepareValidation(RequestSP request_sp)
m_validatedSchema
=
validationReq
.
schema
();
m_validatedSchema
=
validationReq
.
schema
();
m_validatedTable
=
validationReq
.
table
();
m_validatedTable
=
validationReq
.
table
();
if
(
m_configuration_sp
->
isTableExported
(
m_validatedSchema
,
m_validatedTable
))
{
try
try
{
{
DBManager
::
InformationList
informationList
=
DBManager
::
InformationList
informationList
=
...
@@ -206,6 +208,15 @@ ResponseSP ProtocolManager::prepareValidation(RequestSP request_sp)
...
@@ -206,6 +208,15 @@ ResponseSP ProtocolManager::prepareValidation(RequestSP request_sp)
}
}
}
}
else
else
{
WARN_STREAM
<<
"ProtocolManager::prepareValidation() "
<<
"Not exported table from "
<<
m_remoteEndpoint
<<
endl
;
validationRes
->
set_state
(
Response
::
Validation
::
REJECTED
);
validationRes
->
set_status
(
"Not exported table"
);
}
}
else
{
{
WARN_STREAM
<<
"ProtocolManager::prepareValidation() "
WARN_STREAM
<<
"ProtocolManager::prepareValidation() "
<<
"Already validated from "
<<
m_remoteEndpoint
<<
endl
;
<<
"Already validated from "
<<
m_remoteEndpoint
<<
endl
;
...
...
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