// Project
#include <anna/core/Singleton.hpp>
#include <anna/diameter/defines.hpp>
+#include <anna/core/util/defines.hpp> // U32
+
// Standard
#include <map>
private:
origin_hosts_t a_origin_hosts;
+ std::map<std::string /* remove OH name */, std::string /* own OH name */> a_remote_to_own_origin_hosts{};
+
// private constructor
OriginHostManager() {};
*/
void registerOriginHost(const std::string &name, OriginHost* originHost) ;
+ /**
+ * Registers the relation between Origin Host for incoming request and
+ * own origin host.
+ *
+ * @param remoteName origin host name for the received CER
+ * @param ownName Own origin host name
+ */
+ void registerRemoteOriginHost(const std::string &remoteName, const std::string &ownName);
+
/**
* Get the associated origin host node for a provided name.
*
*/
OriginHost *getOriginHost(const std::string &name) const ;
+ /**
+ * Get the associated origin host name for a provided remote origin host name.
+ * This relation was established on CER reception.
+ *
+ * @param name remote origin host name
+ *
+ * @return own origin host, NULL if not found
+ */
+ OriginHost * getOriginHostForRemoteOriginHost(const std::string &name) const;
+
+ /**
+ * Get the associated origin host node for a specific application id
+ * No indexed map by application id, so this search is sequential, but
+ * performance is not required as this is used when receiving CER.
+ *
+ * @applicationId application id to search
+ *
+ * @return Found origin host node, NULL if not found
+ */
+ OriginHost *getOriginHost(const anna::U32 &applicationId) const;
+
+
/**
Class XML representation.
\param parent XML node over which we will put instance information.