XRootD
xrdcl_proxy::ProxyFactory Class Reference

XrdCl proxy prefix plugin factory. More...

#include <ProxyPrefixPlugin.hh>

+ Inheritance diagram for xrdcl_proxy::ProxyFactory:
+ Collaboration diagram for xrdcl_proxy::ProxyFactory:

Public Member Functions

 ProxyFactory (const std::map< std::string, std::string > *config)
 
virtual ~ProxyFactory ()
 Destructor. More...
 
virtual XrdCl::FilePlugInCreateFile (const std::string &url)
 Create a file plug-in for the given URL. More...
 
virtual XrdCl::FileSystemPlugInCreateFileSystem (const std::string &url)
 Create a file system plug-in for the given URL. More...
 
- Public Member Functions inherited from XrdCl::PlugInFactory
virtual ~PlugInFactory ()
 Destructor. More...
 

Detailed Description

XrdCl proxy prefix plugin factory.

Definition at line 35 of file ProxyPrefixPlugin.hh.

Constructor & Destructor Documentation

◆ ProxyFactory()

xrdcl_proxy::ProxyFactory::ProxyFactory ( const std::map< std::string, std::string > *  config)

Construtor

Parameters
configmap containing configuration parameters

Definition at line 50 of file ProxyPrefixPlugin.cc.

51 {
53  // If any of the parameters specific to this plugin are present then export
54  // them as env variables to be used later on if not already set.
55  if (config) {
56  // When C++11 is here:
57  // std::list<std::string> lst_envs {"XROOT_PROXY", "xroot_proxy",
58  // "XROOT_PROXY_EXCL_DOMAINS",
59  // "xroot_proxy_excl_domains};
60  std::list<std::string> lst_envs;
61  lst_envs.push_back("XROOT_PROXY");
62  lst_envs.push_back("xroot_proxy");
63  lst_envs.push_back("XROOT_PROXY_EXCL_DOMAINS");
64  lst_envs.push_back("xroot_proxy_excl_domains");
65 
66  for (std::list<std::string>::iterator it_env = lst_envs.begin();
67  it_env != lst_envs.end(); ++it_env) {
68  std::map<std::string, std::string>::const_iterator it_map =
69  config->find(*it_env);
70 
71  if (it_map != config->end() && !it_map->second.empty()) {
72  if (setenv(it_map->first.c_str(), it_map->second.c_str(), 0)) {
73  log->Error(1, "Failed to set env variable %s from the configuration"
74  " file", it_map->first.c_str());
75  }
76  }
77  }
78  }
79 }
static Log * GetLog()
Get default log.
Handle diagnostics.
Definition: XrdClLog.hh:101
void Error(uint64_t topic, const char *format,...)
Report an error.
Definition: XrdClLog.cc:231

References XrdCl::Log::Error(), and XrdCl::DefaultEnv::GetLog().

+ Here is the call graph for this function:

◆ ~ProxyFactory()

xrdcl_proxy::ProxyFactory::~ProxyFactory ( )
virtual

Destructor.

Definition at line 84 of file ProxyPrefixPlugin.cc.

84 {}

Member Function Documentation

◆ CreateFile()

XrdCl::FilePlugIn * xrdcl_proxy::ProxyFactory::CreateFile ( const std::string &  url)
virtual

Create a file plug-in for the given URL.

Implements XrdCl::PlugInFactory.

Definition at line 90 of file ProxyPrefixPlugin.cc.

91 {
92  return static_cast<XrdCl::FilePlugIn*>(new ProxyPrefixFile());
93 }
An interface for file plug-ins.

◆ CreateFileSystem()

XrdCl::FileSystemPlugIn * xrdcl_proxy::ProxyFactory::CreateFileSystem ( const std::string &  url)
virtual

Create a file system plug-in for the given URL.

Implements XrdCl::PlugInFactory.

Definition at line 99 of file ProxyPrefixPlugin.cc.

100 {
102  log->Error(1, "FileSystem plugin implementation not supported");
103  return static_cast<XrdCl::FileSystemPlugIn*>(0);
104 }
An interface for file plug-ins.

References XrdCl::Log::Error(), and XrdCl::DefaultEnv::GetLog().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: