58 CommandMap::iterator it = pCommands.find( name );
59 if( it != pCommands.end() )
61 log->
Error(
AppMsg,
"Unable to register command %s. Already exists.",
65 pCommands.insert( std::make_pair( name, command ) );
71 std::stringstream cmdline;
72 std::ostream_iterator<std::string> oit(cmdline,
" ");
73 std::copy(args.begin(), args.end(), oit);
76 log->
Debug(
AppMsg,
"Executing: %s", cmdline.str().c_str() );
84 CommandParams::const_iterator parIt;
86 for( parIt = args.begin(); parIt != args.end(); ++parIt, ++i )
87 log->
Dump(
AppMsg,
" Param #%02d: '%s'", i, parIt->c_str() );
92 std::string commandName = args.front();
93 CommandMap::iterator it = pCommands.find( commandName );
94 if( it == pCommands.end() )
96 log->
Error(
AppMsg,
"Unknown command: %s", commandName.c_str() );
100 return it->second( pFS, pEnv, args );
static Log * GetLog()
Get default log.
bool PutString(const std::string &key, const std::string &value)
std::vector< std::string > CommandParams
Definition of command argument list.
FSExecutor(const URL &url, Env *env=0)
XRootDStatus Execute(const CommandParams &args)
bool AddCommand(const std::string &name, Command command)
Send file/filesystem queries to an XRootD cluster.
void Error(uint64_t topic, const char *format,...)
Report an error.
void Dump(uint64_t topic, const char *format,...)
Print a dump message.
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
std::string GetURL() const
Get the URL.
const uint16_t errUnknownCommand
const uint16_t stError
An error occurred that could potentially be retried.