Apache Mesos
|
Provides an abstraction for fetching URIs. More...
#include <fetcher.hpp>
Classes | |
class | Plugin |
Represents a fetcher plugin that handles one or more URI schemes. More... | |
Public Member Functions | |
Fetcher (const std::vector< process::Owned< Plugin >> &plugins) | |
Create the Fetcher instance with the given plugins. More... | |
process::Future< Nothing > | fetch (const URI &uri, const std::string &directory, const Option< std::string > &data=None(), const Option< std::string > &outputFileName=None()) const |
Fetches a URI to the given directory. More... | |
process::Future< Nothing > | fetch (const URI &uri, const std::string &directory, const std::string &name, const Option< std::string > &data=None(), const Option< std::string > &outputFileName=None()) const |
Fetches a URI to the given directory. More... | |
Provides an abstraction for fetching URIs.
It is pluggable through plugins. Each plugin is responsible for one or more URI schemes, but there should be only one plugin associated with each URI scheme. The fetching request will be dispatched to the relevant plugin based on the scheme in the URI.
mesos::uri::Fetcher::Fetcher | ( | const std::vector< process::Owned< Plugin >> & | plugins | ) |
Create the Fetcher instance with the given plugins.
plugins | a list of plugins to register. |
process::Future<Nothing> mesos::uri::Fetcher::fetch | ( | const URI & | uri, |
const std::string & | directory, | ||
const Option< std::string > & | data = None() , |
||
const Option< std::string > & | outputFileName = None() |
||
) | const |
Fetches a URI to the given directory.
This method will dispatch the call to the corresponding plugin based on uri.scheme.
uri | the URI to fetch |
directory | the directory the URI will be downloaded to |
data | the optional user defined data |
outputFileName | the optional output file name |
process::Future<Nothing> mesos::uri::Fetcher::fetch | ( | const URI & | uri, |
const std::string & | directory, | ||
const std::string & | name, | ||
const Option< std::string > & | data = None() , |
||
const Option< std::string > & | outputFileName = None() |
||
) | const |
Fetches a URI to the given directory.
This method will dispatch the call to the plugin chosen by using its name.
uri | the URI to fetch |
directory | the directory the URI will be downloaded to |
name | of the plugin that is used to download |
data | the optional user defined data |
outputFileName | the optional output file name |