FACT++  1.0
bool DataLogger::ShouldSubscribe ( const string &  server,
const string &  service 
)
private

Check whether service is in black and/or white list.

Create a new dim subscription to a given server and service

Parameters
serverthe server name
servicethe service name Check whether a service should be subscribed to, based on the black/white list entries
serverthe server name associated with the service being checked
servicethe service name associated with the service being checked

Definition at line 808 of file datalogger.cc.

References Debug.

809 {
810  if ((fBlackList.find(server + "/") != fBlackList.end()) ||
811  (fBlackList.find(server + "/" + service) != fBlackList.end()) ||
812  (fBlackList.find("/" + service) != fBlackList.end()))
813  {
814  if (fWhiteList.size()>0 &&
815  (fWhiteList.find(server + "/" + service) != fWhiteList.end()))
816  {
817  if (fDebugIsOn)
818  Debug("White list saved service " + server + "/" + service + " from blacklisting");
819  return true;
820  }
821  if (fDebugIsOn)
822  Debug("Blacklist banned service " + server + "/" + service);
823  return false;
824  }
825  return true;
826 }
int Debug(const std::string &str)
Definition: MessageImp.h:45
bool fDebugIsOn
configuration flags
Definition: datalogger.cc:315
set< string > fBlackList
black/white listing
Definition: datalogger.cc:310
set< string > fWhiteList
Definition: datalogger.cc:311