X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Fdiameter.comm%2FEngine.hpp;h=6a7d133c7e83764f0053a0f548bca4cf7c06060b;hb=5abfe5c116fe0301935d38e7981cb20ee4ed44cc;hp=4416becb7eb5c18ff8cf572d42bafb1a6a6f5b93;hpb=bc8edd446b493d53cd351b7ed4c62dce0e305e0c;p=anna.git diff --git a/include/anna/diameter.comm/Engine.hpp b/include/anna/diameter.comm/Engine.hpp index 4416bec..6a7d133 100644 --- a/include/anna/diameter.comm/Engine.hpp +++ b/include/anna/diameter.comm/Engine.hpp @@ -103,39 +103,41 @@ public: /** Diameter application node origin realm - @param originRealm Used to configure the Origin-Realm for outgoing messages. + @param originRealmName Used to configure the Origin-Realm for outgoing messages. If not configured or empty string provided, host domainname will be set. */ - void setOriginRealm(const std::string & originRealm) throw(); + void setOriginRealmName(const std::string & originRealmName) throw(); /** Diameter application origin host - @param originHost Used to configure the Origin-Host for outgoing messages. + @param originHostName Used to configure the Origin-Host for outgoing messages. If not configured or empty string provided, hostname (system name) will be set. */ - void setOriginHost(const std::string & originHost) throw(); + void setOriginHostName(const std::string & originHostName) throw(); /** Gets the configured diameter application node origin realm @return Diameter application node origin realm */ - const std::string & getOriginRealm() const throw() { return a_originRealm; } + const std::string & getOriginRealmName() const throw() { return a_originRealm; } /** Gets the configured diameter application origin host @return Diameter application node origin host */ - const std::string & getOriginHost() const throw() { return a_originHost; } + const std::string & getOriginHostName() const throw() { return a_originHost; } /** * Propagate auto recovery configuration to entities within engine. Recovery period is configured at - * #anna::comm::Communicator::setRecoveryTime. All the client client-sessions created throught #createEntity, - * will be created based on the engine auto-recovery value (enable by default). But you could access entities, - * servers or client-sessions independently to change this behaviour. + * #anna::comm::Communicator::setRecoveryTime (5 seconds by default). All the client client-sessions + * created throught #createEntity, will be created based on the engine auto-recovery value (enabled + * by default). + * You could access entities, servers or client-sessions independently to use this method, but recovery + * time should be updated through communicator and will apply for new created connections. * * @param autoRecovery Auto recovery indicator. True by default. */ @@ -573,12 +575,20 @@ public: */ virtual void readDPA(anna::DataBlock &dpa, const anna::DataBlock & dpr) throw(); + /** + * Sets optional CEA from file, when default is not enough + * + * @param &ceaPathfile Path file for the CEA xml message provided + */ + void setCEA(const std::string &ceaPathfile) throw() { a_ceaPathfile = ceaPathfile; } + /** * Class user should implement this method in order to define Capabilities-Exchange-Answer for received CER over server socket. * Origin-Host and Origin-Realm are configured at comm::Engine with hostname and FQDN (Fully Qualified Domain Name). * Default implementation imply CEA with DIAMETER_SUCCESS Result-Code, and own domain node parameters, but application should * analyze the CER message in order to accept it or not (with apropiate non-success Result-Code). - * Any other implementation is responsible to build a valid CEA diameter message: + * If @setCEA was invoked, a message from file is used instead of default implementation. + * Any other implementation is responsible to build a valid CEA diameter message, even ignoring a possible cea from file when @setCEA is used: * * If one peer sends a CER message to another Peer and receiver does not have support for * @@ -729,6 +739,7 @@ private: anna::Millisecond a_watchdogPeriod; // // ServerSessions messages: + std::string a_ceaPathfile; // path file to optional CEA (diameter local server configuration) // anna::DataBlock a_cea; // anna::DataBlock a_dwa; @@ -762,7 +773,6 @@ private: // CLIENT FUNCTIONALITY // ////////////////////////// - //typedef int clientSession_key; // exclusiveHash('ADDR:PORT|id') typedef std::string clientSession_key; // 'ADDR:PORT|id' typedef std::map clientSession_container; typedef clientSession_container::value_type clientSession_value_type; @@ -794,7 +804,6 @@ private: const_server_iterator server_end() const throw() { return a_servers.end(); } static const Server* server(const_server_iterator ii) throw() { return ii->second; } - //typedef int entity_key; // exclusiveHash('IP1:PORT1 IP2:PORT2 IP3:PORT3 ...') typedef std::string entity_key; // 'ADDR1:PORT1 ADDR2:PORT2 ADDR3:PORT3 ...' entity_key getEntityKey(const socket_v &) const throw(); entity_key getEntityKey(const std::string & addr1, int port1, const std::string & addr2, int port2) const throw();