X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=include%2Fanna%2Fdiameter.comm%2FOriginHostManager.hpp;h=905105269c2d07a6f38cd88d2a88220aeadfa44d;hp=82c0979c7bfaf70d7dd5f868f4360644ccef9681;hb=HEAD;hpb=7681cb4079366eb6908dd5d0dc0124c3fcef4b6b diff --git a/include/anna/diameter.comm/OriginHostManager.hpp b/include/anna/diameter.comm/OriginHostManager.hpp index 82c0979..9051052 100644 --- a/include/anna/diameter.comm/OriginHostManager.hpp +++ b/include/anna/diameter.comm/OriginHostManager.hpp @@ -13,6 +13,8 @@ // Project #include #include +#include // U32 + // Standard #include @@ -45,6 +47,8 @@ class OriginHostManager : public anna::Singleton { private: origin_hosts_t a_origin_hosts; + std::map a_remote_to_own_origin_hosts{}; + // private constructor OriginHostManager() {}; @@ -77,6 +81,15 @@ public: */ 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. * @@ -86,6 +99,28 @@ public: */ 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.