9 : initialized_(false), prefix_(prefix)
22 endpoints_.set_settings(settings);
23 endpoints_.set_name(prefix_, vars);
27 endpoints_.sync_keys();
30 "EndpointClear::filter:"
31 " Processing a new update from %s with %d records\n",
35 if (trusted_originators_.size() != 0 &&
37 trusted_originators_.end()))
40 "EndpointClear::filter:"
41 " Sender is trusted. Clearing endpoints.\n");
59 for (knowledge::KnowledgeMap::const_iterator i = records.begin();
60 i != records.end() && !found; ++i)
66 "EndpointClear::filter:"
67 " Prefix is match. Clearing endpoints.\n");
79 else if (prefix[0] < i->first[0])
82 "EndpointClear::filter:"
83 " Prefix is not a match. Not clearing endpoints.\n");
93 const std::vector<std::string>& originators)
95 for (std::vector<std::string>::const_iterator i = originators.begin();
96 i != originators.end(); ++i)
98 trusted_originators_[*i] =
true;
105 trusted_originators_[originator] =
true;
110 trusted_originators_.clear();
madara::knowledge::KnowledgeRecord::Integer Integer
#define madara_logger_log(loggering, level,...)
Fast version of the madara::logger::log method.
virtual ~EndpointClear()
Destructor.
EndpointClear(const std::string &prefix=".endpoints")
Constructor.
void clear_trusted_originators(void)
Clears all trusted originators who can prompt deleting.
virtual void filter(knowledge::KnowledgeMap &records, const transport::TransportContext &transport_context, knowledge::Variables &vars)
Calls the main logic of the filter.
void add_trusted_originator(const std::vector< std::string > &originators)
Adds trusted originators who will be able to prompt deleting.
void set_prefix(const std::string &prefix)
Sets the prefix to use.
Settings for applying knowledge updates.
logger::Logger & get_logger(void) const
Gets the logger used for information printing.
Provides an interface for external functions into the MADARA KaRL variable settings.
void print(unsigned int level=0) const
Prints all variables and values in the context.
ThreadSafeContext * get_context(void)
Returns the ThreadSafeContext associated with this Variables facade.
int get_level(void)
Gets the maximum logging detail level.
Provides context about the transport.
const std::string & get_originator(void) const
Returns the current message originator.
::std::map< std::string, KnowledgeRecord > KnowledgeMap
Provides utility functions and classes for common tasks and needs.
MADARA_EXPORT bool begins_with(const std::string &input, const std::string &prefix)
Check if input contains prefix at the beginning.