27 #include "../../dataaccess/datasource/DataSource.h" 28 #include "../../common/StringUtils.h" 29 #include "../../core/translator/Translator.h" 30 #include "../../dataaccess/datasource/DataSourceFactory.h" 31 #include "../cache/AbstractCachePolicyFactory.h" 32 #include "../drivers/datasource/DataSourceGraphMetadata.h" 33 #include "../loader/AbstractGraphLoaderStrategyFactory.h" 34 #include "../Config.h" 35 #include "../Exception.h" 68 throw Exception(
TE_TR(
"Could not find concrete factory! Check if it was initialized!"));
91 throw Exception(
TE_TR(
"Could not find concrete factory! Check if it was initialized!"));
109 std::map<std::string, std::string>::const_iterator it;
110 std::map<std::string, std::string>::const_iterator itend = gInfo.end();
113 it = gInfo.find(
"GRAPH_DATA_SOURCE_TYPE");
115 std::unique_ptr<te::da::DataSource> dsPtr;
119 if(it->second ==
"MEM")
144 std::map<std::string, std::string>::const_iterator it;
145 std::map<std::string, std::string>::const_iterator itend = gInfo.end();
147 it = gInfo.find(
"GRAPH_ID");
150 return atoi(it->second.c_str());
157 std::map<std::string, std::string>::const_iterator it;
158 std::map<std::string, std::string>::const_iterator itend = gInfo.end();
162 it = gInfo.find(
"GRAPH_CACHE_POLICY");
173 std::map<std::string, std::string>::const_iterator it;
174 std::map<std::string, std::string>::const_iterator itend = gInfo.end();
178 it = gInfo.find(
"GRAPH_STRATEGY_LOADER");
189 std::map<std::string, std::string>::const_iterator it;
190 std::map<std::string, std::string>::const_iterator itend = gInfo.end();
192 it = gInfo.find(
"GRAPH_NAME");
198 it = gInfo.find(
"GRAPH_DESCRIPTION");
204 it = gInfo.find(
"GRAPH_STORAGE_MODE");
static te::graph::AbstractGraphLoaderStrategy * getLoaderStrategy(const std::map< std::string, std::string > &gInfo, te::graph::GraphMetadata *metadata)
This method is a auxiliar function used to get the loader strategy pointer.
static AbstractGraphLoaderStrategy * make()
It creates and returns default graph loader strategy.
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
static void setMetadataInformation(const std::map< std::string, std::string > &gInfo, te::graph::GraphMetadata *metadata)
Base exception class for plugin module.
#define TE_DEFAULT_GRAPH_TYPE
This definition is used to set the default graph type.
static int getId(const std::map< std::string, std::string > &gInfo)
This method is a auxiliar function used to get the graph id.
static AbstractGraph * open(const std::string &dsInfo, const std::map< std::string, std::string > &gInfo)
It opens a graph with the given parameters and default graph type.
static dictionary_type & getDictionary()
It returns a reference to the internal dictionary of concrete factories.
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
static te::dt::Date ds(2010, 01, 01)
static te::graph::GraphMetadata * getMetadata(const std::string &dsInfo, const std::map< std::string, std::string > &gInfo)
This method is a auxiliar function used to get the metadata pointer.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
#define TE_TR(message)
It marks a string in order to get translated.
TFACTORY * find(const TFACTORYKEY &factoryKey) const
It looks for a given factory identified by a key.
virtual te::graph::GraphMetadata * getMetadata()=0
Function used to access the graph metadata.
This class is used to set the main functions of a cache policy.
virtual AbstractGraph * iOpen(const std::string &dsInfo, const std::map< std::string, std::string > &gInfo)=0
This method must be re-implemented by subclasses in order to have a finner control for the graph obje...
Abstract class used to define the main functions of graph struct. All graph implementations must used...
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
AbstractFactory(const std::string &factoryKey)
It creates the factory and automatically registers it in the dictionary.
virtual AbstractGraph * create(const std::string &dsInfo, const std::map< std::string, std::string > &gInfo)=0
This method must be implemented by subclasses (graph types).
This class define the main functions necessary to save and load the graph data and metadata informati...
static TPRODUCT * make(const TFACTORYKEY &factoryKey)
It creates an object with the appropriated factory.
This is the abstract factory for Graphs.
#define TE_GRAPH_STORAGE_MODE_BY_EDGE
This definition is used to set the edge storage mode.
AbstractGraphFactory(const std::string &factoryKey)
Constructor.
This is the abstract factory for Graphs.
#define TE_GRAPH_STORAGE_MODE_BY_VERTEX
This definition is used to set the vertex storage mode.
static AbstractGraph * make()
It creates and returns an empty graph with default graph type.
static AbstractCachePolicy * make()
It creates and returns default cache policy.
This class represents a dictionary of factories.
static te::graph::AbstractCachePolicy * getCachePolicy(const std::map< std::string, std::string > &gInfo)
This method is a auxiliar function used to get the cache policy pointer.