Commit 96067e1a authored by Marco De Marco's avatar Marco De Marco
Browse files

Temporary path removed

parent cf8a9ece
Loading
Loading
Loading
Loading
+16 −18
Original line number Diff line number Diff line
@@ -25,10 +25,10 @@ private:
        std::string databaseUsername, std::string databasePassword,
        std::string databaseSchema, std::string databaseTable,
        unsigned int refreshTime, unsigned int timeout,
        std::string temporaryPath, std::string auxDatabaseHost,
        unsigned int auxDatabasePort, std::string auxDatabaseUsername,
        std::string auxDatabasePassword, std::string auxDatabaseSchema,
        std::string auxDatabaseTimestampTable, std::string auxDatabaseFailedTable) :
        std::string auxDatabaseHost, unsigned int auxDatabasePort,
        std::string auxDatabaseUsername, std::string auxDatabasePassword,
        std::string auxDatabaseSchema, std::string auxDatabaseTimestampTable,
        std::string auxDatabaseFailedTable) :
        m_certificateFile (certificateFile), m_storagePath(storagePath),
        m_remoteHost(remoteHost), m_remotePort(remotePort),
        m_remoteUsername(remoteUsername), m_remotePassword(remotePassword),
@@ -36,9 +36,10 @@ private:
        m_databaseUsername(databaseUsername), m_databasePassword(databasePassword),
        m_databaseSchema(databaseSchema), m_databaseTable(databaseTable),
        m_refreshTime(refreshTime), m_timeout(timeout),
        m_temporaryPath(temporaryPath), m_auxDatabaseHost(auxDatabaseHost),
        m_auxDatabasePort(auxDatabasePort), m_auxDatabaseUsername(auxDatabaseUsername),
        m_auxDatabasePassword(auxDatabasePassword), m_auxDatabaseSchema(auxDatabaseSchema),
        m_auxDatabaseHost(auxDatabaseHost), m_auxDatabasePort(auxDatabasePort),
        m_auxDatabaseUsername(auxDatabaseUsername),
        m_auxDatabasePassword(auxDatabasePassword),
        m_auxDatabaseSchema(auxDatabaseSchema),
        m_auxDatabaseTimestampTable(auxDatabaseTimestampTable),
        m_auxDatabaseFailedTable(auxDatabaseFailedTable) { };

@@ -63,17 +64,18 @@ public:
        std::string databaseUsername, std::string databasePassword,
        std::string databaseSchema, std::string databaseTable,
        unsigned int refreshTime, unsigned int timeout,
        std::string temporaryPath, std::string auxDatabaseHost,
        unsigned int auxDatabasePort, std::string auxDatabaseUsername,
        std::string auxDatabasePassword, std::string auxDatabaseSchema,
        std::string auxDatabaseTimestampTable, std::string auxDatabaseFailedTable)
        std::string auxDatabaseHost, unsigned int auxDatabasePort,
        std::string auxDatabaseUsername, std::string auxDatabasePassword,
        std::string auxDatabaseSchema, std::string auxDatabaseTimestampTable,
        std::string auxDatabaseFailedTable)
	{
		Configuration::SP c_sp(new Configuration(certificateFile, storagePath,
            remoteHost, remotePort, remoteUsername, remotePassword, databaseHost,
            databasePort, databaseUsername, databasePassword, databaseSchema,
            databaseTable, refreshTime, timeout, temporaryPath, auxDatabaseHost,
            auxDatabasePort, auxDatabaseUsername, auxDatabasePassword, auxDatabaseSchema,
            auxDatabaseTimestampTable, auxDatabaseFailedTable), Configuration::Deleter());
            databaseTable, refreshTime, timeout, auxDatabaseHost, auxDatabasePort,
            auxDatabaseUsername, auxDatabasePassword, auxDatabaseSchema,
            auxDatabaseTimestampTable, auxDatabaseFailedTable),
            Configuration::Deleter());

		return c_sp;
	}
@@ -95,7 +97,6 @@ public:
	std::string	getDatabaseTable() const { return m_databaseTable; }
	unsigned int getRefreshTime() const { return m_refreshTime; }
	unsigned int getTimeout() const { return m_timeout; }
    std::string getTemporaryPath() const { return m_temporaryPath; }
    std::string getAuxDatabaseHost() const { return m_auxDatabaseHost; }
    unsigned int getAuxDatabasePort() const { return m_auxDatabasePort; }
    std::string getAuxDatabaseUsername() const { return m_auxDatabaseUsername; }
@@ -150,9 +151,6 @@ private:
	//Connection timeout (seconds)
	const unsigned int m_timeout;

	//Temporary path
	const std::string m_temporaryPath;

	//Auxiliary database host
	const std::string m_auxDatabaseHost;

+7 −24
Original line number Diff line number Diff line
@@ -217,7 +217,6 @@ void DataImporter::get_device_property()
	dev_prop.push_back(Tango::DbDatum("RefreshTime"));
	dev_prop.push_back(Tango::DbDatum("Timeout"));
	dev_prop.push_back(Tango::DbDatum("AutoStart"));
	dev_prop.push_back(Tango::DbDatum("TemporaryPath"));
	dev_prop.push_back(Tango::DbDatum("AuxDatabaseHost"));
	dev_prop.push_back(Tango::DbDatum("AuxDatabasePort"));
	dev_prop.push_back(Tango::DbDatum("AuxDatabaseUsername"));
@@ -415,17 +414,6 @@ void DataImporter::get_device_property()
		//	And try to extract AutoStart value from database
		if (dev_prop[i].is_empty()==false)	dev_prop[i]  >>  autoStart;

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

		//	Try to initialize AuxDatabaseHost from class property
		cl_prop = ds_class->get_class_property(dev_prop[++i].name);
		if (cl_prop.is_empty()==false)	cl_prop  >>  auxDatabaseHost;
@@ -558,11 +546,6 @@ void DataImporter::get_device_property()
        if(timeout<1 || timeout>MAX_TIMEOUT)
            throw(invalid_argument("Timeout property out of range or not defined"));

        if(temporaryPath.empty())
            throw(invalid_argument("TemporaryPath property is empty or not defined"));

        checkIfDirectoryExists(temporaryPath);

        if(auxDatabaseHost.empty())
                throw(invalid_argument("AuxDatabaseHost property is empty or not defined"));

@@ -587,9 +570,9 @@ void DataImporter::get_device_property()
        m_configuration_sp = Configuration::create(certificateFile, storagePath,
            remoteHost, remotePort, remoteUsername, remotePassword, databaseHost,
            databasePort, databaseUsername, databasePassword, databaseSchema,
            databaseTable, refreshTime, timeout, temporaryPath, auxDatabaseHost,
            auxDatabasePort, auxDatabaseUsername, auxDatabasePassword,
            auxDatabaseSchema, auxDatabaseTimestampTable, auxDatabaseFailedTable);
            databaseTable, refreshTime, timeout, auxDatabaseHost, auxDatabasePort,
            auxDatabaseUsername, auxDatabasePassword, auxDatabaseSchema,
            auxDatabaseTimestampTable, auxDatabaseFailedTable);
    }
    catch(invalid_argument& ex)
    {
@@ -678,14 +661,14 @@ void DataImporter::on()
    }
    catch(std::exception& ex)
    {
        set_state(Tango::FAULT);
        set_state(Tango::ALARM);
        std::stringstream error_stream;
        error_stream << "DataImporter::On() " << ex.what() << std::endl;
        set_status(error_stream.str());
    }
    catch(...)
    {
        set_state(Tango::FAULT);
        set_state(Tango::ALARM);
        set_status("DataImporter::On() unknown error");
    }

@@ -711,14 +694,14 @@ void DataImporter::off()
    }
    catch(std::exception& ex)
    {
        set_state(Tango::FAULT);
        set_state(Tango::ALARM);
        std::stringstream error_stream;
        error_stream << "DataImporter::Off() " << ex.what() << std::endl;
        set_status(error_stream.str());
    }
    catch(...)
    {
        set_state(Tango::FAULT);
        set_state(Tango::ALARM);
        set_status("DataImporter::Off() unknown error");
    }

+0 −2
Original line number Diff line number Diff line
@@ -119,8 +119,6 @@ public:
	Tango::DevULong	timeout;
	//	AutoStart:	Exec On command after init if state is not fault
	Tango::DevBoolean	autoStart;
	//	TemporaryPath:	Absolute path used during file transfer
	string	temporaryPath;
	//	AuxDatabaseHost:	File transfer auxiliary database host
	string	auxDatabaseHost;
	//	AuxDatabasePort:	File transfer auxiliary database port
+0 −8
Original line number Diff line number Diff line
@@ -13,10 +13,6 @@
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </classProperties>
    <classProperties name="TemporaryPath" description="Absolute path used during file transfer">
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </classProperties>
    <classProperties name="AuxDatabaseHost" description="File transfer auxiliary database host">
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
@@ -112,10 +108,6 @@
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <DefaultPropValue>false</DefaultPropValue>
    </deviceProperties>
    <deviceProperties name="TemporaryPath" description="Absolute path used during file transfer">
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </deviceProperties>
    <deviceProperties name="AuxDatabaseHost" description="File transfer auxiliary database host">
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
+0 −39
Original line number Diff line number Diff line
@@ -259,7 +259,6 @@ void DataImporterClass::get_class_property()
	//	Read class properties from database.
	cl_prop.push_back(Tango::DbDatum("CertificateFile"));
	cl_prop.push_back(Tango::DbDatum("StoragePath"));
	cl_prop.push_back(Tango::DbDatum("TemporaryPath"));
	cl_prop.push_back(Tango::DbDatum("AuxDatabaseHost"));
	cl_prop.push_back(Tango::DbDatum("AuxDatabasePort"));
	cl_prop.push_back(Tango::DbDatum("AuxDatabaseUsername"));
@@ -298,18 +297,6 @@ void DataImporterClass::get_class_property()
			cl_prop[i]  <<  storagePath;
		}
	}
	//	Try to extract TemporaryPath value
	if (cl_prop[++i].is_empty()==false)	cl_prop[i]  >>  temporaryPath;
	else
	{
		//	Check default value for TemporaryPath
		def_prop = get_default_class_property(cl_prop[i].name);
		if (def_prop.is_empty()==false)
		{
			def_prop    >>  temporaryPath;
			cl_prop[i]  <<  temporaryPath;
		}
	}
	//	Try to extract AuxDatabaseHost value
	if (cl_prop[++i].is_empty()==false)	cl_prop[i]  >>  auxDatabaseHost;
	else
@@ -443,19 +430,6 @@ void DataImporterClass::set_default_property()
		cl_def_prop.push_back(data);
		add_wiz_class_prop(prop_name, prop_desc,  prop_def);
	}
	else
		add_wiz_class_prop(prop_name, prop_desc);
	prop_name = "TemporaryPath";
	prop_desc = "Absolute path used during file transfer";
	prop_def  = "";
	vect_data.clear();
	if (prop_def.length()>0)
	{
		Tango::DbDatum	data(prop_name);
		data << vect_data ;
		cl_def_prop.push_back(data);
		add_wiz_class_prop(prop_name, prop_desc,  prop_def);
	}
	else
		add_wiz_class_prop(prop_name, prop_desc);
	prop_name = "AuxDatabaseHost";
@@ -760,19 +734,6 @@ void DataImporterClass::set_default_property()
		dev_def_prop.push_back(data);
		add_wiz_dev_prop(prop_name, prop_desc,  prop_def);
	}
	else
		add_wiz_dev_prop(prop_name, prop_desc);
	prop_name = "TemporaryPath";
	prop_desc = "Absolute path used during file transfer";
	prop_def  = "";
	vect_data.clear();
	if (prop_def.length()>0)
	{
		Tango::DbDatum	data(prop_name);
		data << vect_data ;
		dev_def_prop.push_back(data);
		add_wiz_dev_prop(prop_name, prop_desc,  prop_def);
	}
	else
		add_wiz_dev_prop(prop_name, prop_desc);
	prop_name = "AuxDatabaseHost";
Loading