Commit bba24a8b authored by Andrea Bignamini's avatar Andrea Bignamini
Browse files

Merge branch 'release/v1.1.0'

parents 0d8d7fd3 3ecc4879
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -3,6 +3,8 @@ EXEC_NAME=dataImporter-srv
INST_NAME=test
INST_NAME=test
DEBUG_LEV=-v3
DEBUG_LEV=-v3
INSTALL_DIR=/usr/local/bin
INSTALL_DIR=/usr/local/bin
VERSION := `git describe --tags`
TAR_NAME := `basename $(PWD)`
#================================================================================
#================================================================================
INC_DIR=/usr/local/omniORB/include \
INC_DIR=/usr/local/omniORB/include \
	   /usr/local/zeromq/include/zmq \
	   /usr/local/zeromq/include/zmq \
@@ -29,7 +31,7 @@ LDFLAGS=-Wall -lomniORB4 -lomniDynamic4 -lCOS4 -lomnithread -ltango -llog4tango
	-lboost_filesystem -lboost_date_time -lprotobuf -lssl -lcrypto -lpthread
	-lboost_filesystem -lboost_date_time -lprotobuf -lssl -lcrypto -lpthread
INC_PARM=$(foreach d, $(INC_DIR), -I$d)
INC_PARM=$(foreach d, $(INC_DIR), -I$d)
LIB_PARM=$(foreach d, $(LIB_DIR), -L$d)
LIB_PARM=$(foreach d, $(LIB_DIR), -L$d)
PROTOC :=/usr/local/protobuf-2.5.0/bin/protoc
PROTOC :=/usr/local/protobuf/bin/protoc
#================================================================================
#================================================================================
SRC_DIR=./src
SRC_DIR=./src
OBJ_DIR=./obj
OBJ_DIR=./obj
@@ -91,6 +93,10 @@ deepclean:
install:
install:
	-cp $(EXECUTABLE) $(INSTALL_DIR)
	-cp $(EXECUTABLE) $(INSTALL_DIR)


.PHONY: tar
tar:
	-tar -czvf $(TAR_NAME)_$(VERSION).tar.gz --transform="s|^.|$(TAR_NAME)_$(VERSION)/|" $(PROTO_DIR) $(SRC_DIR) ./Makefile

.PHONY: echo
.PHONY: echo
echo:
echo:
	@echo EXECUTABLE:
	@echo EXECUTABLE:
+12 −1
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ private:
	Configuration(std::string certificateFile, std::string storagePath,
	Configuration(std::string certificateFile, std::string storagePath,
        std::string remoteHost, unsigned int remotePort,
        std::string remoteHost, unsigned int remotePort,
        std::string remoteUsername, std::string remotePassword,
        std::string remoteUsername, std::string remotePassword,
        std::string remoteSchema, std::string remoteTable,
        std::string databaseHost, unsigned int databasePort,
        std::string databaseHost, unsigned int databasePort,
        std::string databaseUsername, std::string databasePassword,
        std::string databaseUsername, std::string databasePassword,
        std::string databaseSchema, std::string databaseTable,
        std::string databaseSchema, std::string databaseTable,
@@ -32,6 +33,7 @@ private:
        m_certificateFile (certificateFile), m_storagePath(storagePath),
        m_certificateFile (certificateFile), m_storagePath(storagePath),
        m_remoteHost(remoteHost), m_remotePort(remotePort),
        m_remoteHost(remoteHost), m_remotePort(remotePort),
        m_remoteUsername(remoteUsername), m_remotePassword(remotePassword),
        m_remoteUsername(remoteUsername), m_remotePassword(remotePassword),
	  m_remoteSchema(remoteSchema), m_remoteTable(remoteTable),
        m_databaseHost(databaseHost), m_databasePort(databasePort),
        m_databaseHost(databaseHost), m_databasePort(databasePort),
        m_databaseUsername(databaseUsername),
        m_databaseUsername(databaseUsername),
        m_databasePassword(databasePassword), m_databaseSchema(databaseSchema),
        m_databasePassword(databasePassword), m_databaseSchema(databaseSchema),
@@ -62,6 +64,7 @@ public:
	static Configuration::SP create(std::string certificateFile,
	static Configuration::SP create(std::string certificateFile,
        std::string storagePath, std::string remoteHost, unsigned int remotePort,
        std::string storagePath, std::string remoteHost, unsigned int remotePort,
        std::string remoteUsername, std::string remotePassword,
        std::string remoteUsername, std::string remotePassword,
	std::string remoteSchema, std::string remoteTable,
        std::string databaseHost, unsigned int databasePort,
        std::string databaseHost, unsigned int databasePort,
        std::string databaseUsername, std::string databasePassword,
        std::string databaseUsername, std::string databasePassword,
        std::string databaseSchema, std::string databaseTable,
        std::string databaseSchema, std::string databaseTable,
@@ -72,7 +75,7 @@ public:
        std::string auxDatabaseFailedTable, std::string whereCondition)
        std::string auxDatabaseFailedTable, std::string whereCondition)
	{
	{
		Configuration::SP c_sp(new Configuration(certificateFile, storagePath,
		Configuration::SP c_sp(new Configuration(certificateFile, storagePath,
            remoteHost, remotePort, remoteUsername, remotePassword, databaseHost,
            remoteHost, remotePort, remoteUsername, remotePassword, remoteSchema, remoteTable, databaseHost,
            databasePort, databaseUsername, databasePassword, databaseSchema,
            databasePort, databaseUsername, databasePassword, databaseSchema,
            databaseTable, refreshTime, timeout, recoveryTime, auxDatabaseHost,
            databaseTable, refreshTime, timeout, recoveryTime, auxDatabaseHost,
            auxDatabasePort, auxDatabaseUsername, auxDatabasePassword,
            auxDatabasePort, auxDatabaseUsername, auxDatabasePassword,
@@ -91,6 +94,8 @@ public:
	unsigned int getRemotePort() const { return m_remotePort; }
	unsigned int getRemotePort() const { return m_remotePort; }
	std::string	getRemoteUsername() const { return m_remoteUsername; }
	std::string	getRemoteUsername() const { return m_remoteUsername; }
	std::string	getRemotePassword() const { return m_remotePassword; }
	std::string	getRemotePassword() const { return m_remotePassword; }
	std::string	getRemoteSchema() const { return m_remoteSchema; }
	std::string	getRemoteTable() const { return m_remoteTable; }
	std::string	getDatabaseHost() const { return m_databaseHost; }
	std::string	getDatabaseHost() const { return m_databaseHost; }
	unsigned int getDatabasePort() const { return m_databasePort; }
	unsigned int getDatabasePort() const { return m_databasePort; }
	std::string	getDatabaseUsername() const { return m_databaseUsername; }
	std::string	getDatabaseUsername() const { return m_databaseUsername; }
@@ -131,6 +136,12 @@ private:
    //Metadata exporter remote password
    //Metadata exporter remote password
	const std::string	m_remotePassword;
	const std::string	m_remotePassword;


    //Metadata remote database schema
	const std::string	m_remoteSchema;

    //Metadata remote database table
	const std::string	m_remoteTable;

    //Metadata local database host
    //Metadata local database host
	const std::string	m_databaseHost;
	const std::string	m_databaseHost;


+33 −1
Original line number Original line Diff line number Diff line
@@ -220,6 +220,8 @@ void DataImporter::get_device_property()
	dev_prop.push_back(Tango::DbDatum("RemotePort"));
	dev_prop.push_back(Tango::DbDatum("RemotePort"));
	dev_prop.push_back(Tango::DbDatum("RemoteUsername"));
	dev_prop.push_back(Tango::DbDatum("RemoteUsername"));
	dev_prop.push_back(Tango::DbDatum("RemotePassword"));
	dev_prop.push_back(Tango::DbDatum("RemotePassword"));
	dev_prop.push_back(Tango::DbDatum("RemoteSchema"));
	dev_prop.push_back(Tango::DbDatum("RemoteTable"));
	dev_prop.push_back(Tango::DbDatum("EnableSSL"));
	dev_prop.push_back(Tango::DbDatum("EnableSSL"));
	dev_prop.push_back(Tango::DbDatum("DatabaseHost"));
	dev_prop.push_back(Tango::DbDatum("DatabaseHost"));
	dev_prop.push_back(Tango::DbDatum("DatabasePort"));
	dev_prop.push_back(Tango::DbDatum("DatabasePort"));
@@ -319,6 +321,28 @@ void DataImporter::get_device_property()
		//	And try to extract RemotePassword value from database
		//	And try to extract RemotePassword value from database
		if (dev_prop[i].is_empty()==false)	dev_prop[i]  >>  remotePassword;
		if (dev_prop[i].is_empty()==false)	dev_prop[i]  >>  remotePassword;


		//	Try to initialize RemoteSchema from class property
		cl_prop = ds_class->get_class_property(dev_prop[++i].name);
		if (cl_prop.is_empty()==false)	cl_prop  >>  remoteSchema;
		else {
			//	Try to initialize RemoteSchema from default device value
			def_prop = ds_class->get_default_device_property(dev_prop[i].name);
			if (def_prop.is_empty()==false)	def_prop  >>  remoteSchema;
		}
		//	And try to extract RemoteSchema value from database
		if (dev_prop[i].is_empty()==false)	dev_prop[i]  >>  remoteSchema;

		//	Try to initialize RemoteTable from class property
		cl_prop = ds_class->get_class_property(dev_prop[++i].name);
		if (cl_prop.is_empty()==false)	cl_prop  >>  remoteTable;
		else {
			//	Try to initialize RemoteTable from default device value
			def_prop = ds_class->get_default_device_property(dev_prop[i].name);
			if (def_prop.is_empty()==false)	def_prop  >>  remoteTable;
		}
		//	And try to extract RemoteTable value from database
		if (dev_prop[i].is_empty()==false)	dev_prop[i]  >>  remoteTable;

		//	Try to initialize EnableSSL from class property
		//	Try to initialize EnableSSL from class property
		cl_prop = ds_class->get_class_property(dev_prop[++i].name);
		cl_prop = ds_class->get_class_property(dev_prop[++i].name);
		if (cl_prop.is_empty()==false)	cl_prop  >>  enableSSL;
		if (cl_prop.is_empty()==false)	cl_prop  >>  enableSSL;
@@ -559,6 +583,14 @@ void DataImporter::get_device_property()
        if(remotePassword.empty())
        if(remotePassword.empty())
            throw(invalid_argument("RemotePassword property is empty or not defined"));
            throw(invalid_argument("RemotePassword property is empty or not defined"));


        // If remoteSchema is not set, use databaseSchema
        if(remoteSchema.empty())
	  remoteSchema=databaseSchema;

        // If remoteTable is not set, use databaseTable
        if(remoteTable.empty())
	  remoteTable=databaseTable;

        if(databaseHost.empty())
        if(databaseHost.empty())
                throw(invalid_argument("DatabaseHost property is empty or not defined"));
                throw(invalid_argument("DatabaseHost property is empty or not defined"));


@@ -608,7 +640,7 @@ void DataImporter::get_device_property()
            throw(invalid_argument("AuxDatabaseFailedTable property is empty or not defined"));
            throw(invalid_argument("AuxDatabaseFailedTable property is empty or not defined"));


        m_configuration_sp = Configuration::create(certificateFile, storagePath,
        m_configuration_sp = Configuration::create(certificateFile, storagePath,
            remoteHost, remotePort, remoteUsername, remotePassword, databaseHost,
            remoteHost, remotePort, remoteUsername, remotePassword, remoteSchema, remoteTable, databaseHost,
            databasePort, databaseUsername, databasePassword, databaseSchema,
            databasePort, databaseUsername, databasePassword, databaseSchema,
            databaseTable, refreshTime, timeout, recoveryTime, auxDatabaseHost,
            databaseTable, refreshTime, timeout, recoveryTime, auxDatabaseHost,
            auxDatabasePort, auxDatabaseUsername, auxDatabasePassword,
            auxDatabasePort, auxDatabaseUsername, auxDatabasePassword,
+4 −0
Original line number Original line Diff line number Diff line
@@ -107,6 +107,10 @@ public:
	string	remoteUsername;
	string	remoteUsername;
	//	RemotePassword:	Metadata exporter remote password
	//	RemotePassword:	Metadata exporter remote password
	string	remotePassword;
	string	remotePassword;
	//	RemoteSchema:	Metadata remote database schema
	string	remoteSchema;
	//	RemoteTable:	Metadata remote database table
	string	remoteTable;
	//	EnableSSL:	Enable or disable SSL connections
	//	EnableSSL:	Enable or disable SSL connections
	Tango::DevBoolean	enableSSL;
	Tango::DevBoolean	enableSSL;
	//	DatabaseHost:	Metadata local database host
	//	DatabaseHost:	Metadata local database host
+8 −0
Original line number Original line Diff line number Diff line
@@ -65,6 +65,14 @@
      <type xsi:type="pogoDsl:StringType"/>
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </deviceProperties>
    </deviceProperties>
    <deviceProperties name="RemoteSchema" description="Metadata remote database schema">
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </deviceProperties>
    <deviceProperties name="RemoteTable" description="Metadata remote database table">
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </deviceProperties>
    <deviceProperties name="EnableSSL" description="Enable or disable SSL connections">
    <deviceProperties name="EnableSSL" description="Enable or disable SSL connections">
      <type xsi:type="pogoDsl:BooleanType"/>
      <type xsi:type="pogoDsl:BooleanType"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
Loading