This function processes the update of the DIS_DNS/SERVER_LIST update. After this function the server list should be up-to-date again.
For each new server a SERVER/SERVICE_LIST service subscription is created and stored in the fServerList. For each removed server the corresponding object are deleted, as well as the corresponding entries from the fServiceList.
Definition at line 149 of file ServiceList.cc.
References buffer, CreateFMT(), CreateSL(), fDimServers, fServerList, fServiceList, Time::GetAsStr(), DimInfo::getString(), i, kRed, str, and wout.
Referenced by CreateFMT(), and infoHandler().
155 if (str[0]!=
'-' && str[0]!=
'+')
161 delete i->second.first;
162 delete i->second.second;
173 stringstream stream(str);
177 while (getline(stream, buffer,
'|'))
180 const string server = buffer.substr(0, buffer.find_first_of(
'@'));
187 const string trunc = server.substr(1);
191 const ServerMap::iterator v =
fServerList.find(trunc);
194 wout <<
kRed <<
"Server '" << trunc <<
"' not in list as it ought to be." << endl;
199 delete v->second.first;
200 delete v->second.second;
207 wout <<
" -> " <<
Time().
GetAsStr() <<
" - " << trunc <<
"/SERVICE_LIST: Disconnected." << endl;
215 const string trunc = server.substr(1);
219 const ServerMap::iterator v =
fServerList.find(trunc);
222 wout <<
kRed <<
"Server '" << trunc <<
"' in list not as it ought to be." << endl;
229 wout <<
" -> " <<
Time().
GetAsStr() <<
" - " << trunc <<
"/SERVICE_LIST: Connected." << endl;
ServerMap fServerList
A filter for the type of the services to be collected, e.g. CMD.
Adds some functionality to boost::posix_time::ptime for our needs.
ServiceMap fServiceList
A map storing server names and a DimInfo for their SERVICE_LIST.
DimInfo fDimServers
stream for redirection of the output
DimInfo * CreateFMT(const std::string &str) const
DimInfo * CreateSL(const std::string &str) const
std::string GetAsStr(const char *fmt="%Y-%m-%d %H:%M:%S") const