27 #include "../../dataaccess/datasource/DataSource.h"
28 #include "../../common/StringUtils.h"
29 #include "../../common/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!"));
101 : te::common::AbstractFactory<te::graph::
AbstractGraph, std::string>(factoryKey)
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::auto_ptr<te::da::DataSource> dsPtr;
119 if(it->second ==
"MEM")
128 dsPtr->setConnectionInfo(dsInfo);
145 std::map<std::string, std::string>::const_iterator it;
146 std::map<std::string, std::string>::const_iterator itend = gInfo.end();
148 it = gInfo.find(
"GRAPH_ID");
151 return atoi(it->second.c_str());
158 std::map<std::string, std::string>::const_iterator it;
159 std::map<std::string, std::string>::const_iterator itend = gInfo.end();
163 it = gInfo.find(
"GRAPH_CACHE_POLICY");
174 std::map<std::string, std::string>::const_iterator it;
175 std::map<std::string, std::string>::const_iterator itend = gInfo.end();
179 it = gInfo.find(
"GRAPH_STRATEGY_LOADER");
190 std::map<std::string, std::string>::const_iterator it;
191 std::map<std::string, std::string>::const_iterator itend = gInfo.end();
193 it = gInfo.find(
"GRAPH_NAME");
199 it = gInfo.find(
"GRAPH_DESCRIPTION");
205 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 void setMetadataInformation(const std::map< std::string, std::string > &gInfo, te::graph::GraphMetadata *metadata)
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.
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.
virtual AbstractGraph * iOpen(const std::map< std::string, 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...
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.
static std::auto_ptr< DataSource > make(const std::string &dsType)
Abstract class used to define the main functions of graph struct. All graph implementations must used...
#define TE_DEFAULT_GRAPH_TYPE
This definition is used to set the default graph type.
This class define the main functions necessary to save and load the graph data and metadata informati...
virtual AbstractGraph * create(const std::map< std::string, std::string > &dsInfo, const std::map< std::string, std::string > &gInfo)=0
This method must be implemented by subclasses (graph types).
static TPRODUCT * make(const TFACTORYKEY &factoryKey)
It creates an object with the appropriated factory.
static AbstractGraph * open(const std::map< std::string, std::string > &dsInfo, const std::map< std::string, std::string > &gInfo)
It opens a graph with the given parameters and default graph type.
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.
static te::graph::GraphMetadata * getMetadata(const std::map< std::string, std::string > &dsInfo, const std::map< std::string, std::string > &gInfo)
This method is a auxiliar function used to get the metadata pointer.
This is the abstract factory for Graphs.
static AbstractGraph * make()
It creates and returns an empty graph with default graph type.
#define TE_GRAPH_STORAGE_MODE_BY_VERTEX
This definition is used to set the vertex storage mode.
static int getId(const std::map< std::string, std::string > &dsInfo, const std::map< std::string, std::string > &gInfo)
This method is a auxiliar function used to get the graph id.
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.