text: // Copyright @2012 JDSU Xtreme
  
  #include "xtreme/config/csparam_pubsub.h"
  
  #include <log4cxx/logger.h>
  
  namespace xtreme {
    namespace config {
      static log4cxx::LoggerPtr loggerCSConfig(log4cxx::Logger::getLogger("xtreme.CS.Config"));
  
      bool CSParamCriteria::Match(EventPtr& p_event) {
        LOG4CXX_DEBUG(loggerCSConfig,
            "CSParamCriteria (Match) : Event Type" << p_event->type() << "at Time, " << p_event->timestamp());
        // 'this' CSParamCriteria is a 'MATCH' for given input-event, IF ....
        // the source-config-name of the input event [getSrcConfigName()] begins with
        // the m_ConfigName [the monitored config name (XPath)] of 'this' criteria
        try {
          if ((nullptr != p_event.get()) && (kEVENT_CONFIGURATION == p_event.get()->type())) {
            CSParamEvent * p_ParamEvent = static_cast<CSParamEvent *> (p_event.get());
            LOG4CXX_DEBUG(loggerCSConfig, "CSParamCriteria (Match) : Criteria [" << m_ConfigName <<
                "] matched against CSParamEvent [" << p_ParamEvent->getSrcConfigName() << "]");
            int beginsWith = p_ParamEvent->getSrcConfigName().compare(0, m_ConfigName.length(), m_ConfigName);
            return(0 == beginsWith);
          }
          return false;
        } catch(...) {
          return false;
        }
      }
    }
  }  // end namespace xtreme
  