void eventResponse(const anna::diameter::comm::Response&) throw(anna::RuntimeException);
void eventRequest(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException);
void eventUnknownResponse(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException);
+ void eventDPA(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException);
// Reimplementation
int readSocketId(const anna::diameter::comm::Message* message, int maxClientSessions) const throw();
void eventResponse(const anna::diameter::comm::Response&) throw(anna::RuntimeException);
void eventRequest(anna::diameter::comm::ServerSession *, const anna::DataBlock&) throw(anna::RuntimeException);
void eventUnknownResponse(anna::diameter::comm::ServerSession *, const anna::DataBlock&) throw(anna::RuntimeException);
+ void eventDPA(anna::diameter::comm::ServerSession *, const anna::DataBlock&) throw(anna::RuntimeException);
};
class MyDiameterEngine : public anna::diameter::comm::Engine {
if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfe-ans-unknown", clientSession->asString());
}
+void MyDiameterEntity::eventDPA(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message)
+throw(anna::RuntimeException) {
+ LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventDPA", ANNA_FILE_LOCATION));
+ // Performance stats:
+ Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
+ // CommandId:
+ anna::diameter::CommandId cid = anna::diameter::codec::functions::getCommandId(message);
+ LOGDEBUG
+ (
+ std::string msg = "Disconnect-Peer-Answer received from entity: ";
+ msg += anna::diameter::functions::commandIdAsPairString(cid);
+ msg += " | DiameterServer: ";
+ msg += anna::functions::socketLiteralAsString(clientSession->getAddress(), clientSession->getPort());
+ msg += " | EventTime: ";
+ msg += anna::time::functions::currentTimeAsString();
+ anna::Logger::debug(msg, ANNA_FILE_LOCATION);
+ );
-
+ // Write reception
+ if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfe", clientSession->asString());
+}
void MyLocalServer::eventRequest(anna::diameter::comm::ServerSession *serverSession, const anna::DataBlock &message)
throw(anna::RuntimeException) {
if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfc-ans-unknown", serverSession->asString());
}
+void MyLocalServer::eventDPA(anna::diameter::comm::ServerSession *serverSession, const anna::DataBlock &message)
+throw(anna::RuntimeException) {
+ LOGMETHOD(anna::TraceMethod tm("launcher::MyLocalServer", "eventDPA", ANNA_FILE_LOCATION));
+ // Performance stats:
+ Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
+ // CommandId:
+ anna::diameter::CommandId cid = anna::diameter::codec::functions::getCommandId(message);
+ LOGDEBUG
+ (
+ std::string msg = "Disconnect-Peer-Answer response received from client: ";
+ msg += anna::diameter::functions::commandIdAsPairString(cid);
+ msg += " | DiameterServer: ";
+ msg += anna::functions::socketLiteralAsString(serverSession->getAddress(), serverSession->getPort());
+ msg += " | EventTime: ";
+ msg += anna::time::functions::currentTimeAsString();
+ anna::Logger::debug(msg, ANNA_FILE_LOCATION);
+ );
+
+ if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfc", serverSession->asString());
+}
anna::xml::Node* Launcher::asXML(anna::xml::Node* parent) const
throw() {
*/
void eventUnknownResponse(const anna::DataBlock& response) throw(anna::RuntimeException);
+ /**
+ Handler for diameter server (client-session) Disconnect-Peer-Answer messages
+
+ \param response Answer data block object without context match
+ */
+ void eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException);
+
+
/**
* Handlers for receptions
*/
virtual void eventUnknownResponse(ClientSession *clientSession, const anna::DataBlock& response) throw(anna::RuntimeException) = 0;
+ /**
+ Handler for diameter session Disconnect-Peer-Answer messages
+
+ \param clientSession ClientSession from which request has been received
+ \param response Answer data block object without context match
+ */
+ virtual void eventDPA(ClientSession *clientSession, const anna::DataBlock& response) throw(anna::RuntimeException) = 0;
+
+
+
friend class Engine;
friend class Server;
*/
virtual void eventUnknownResponse(ServerSession* serverSession, const anna::DataBlock& response) throw(anna::RuntimeException) = 0;
+ /**
+ Handler for diameter client Disconnect-Peer-Answer messages
+
+ \param serverSession ServerSession from which request has been received
+ \param response Answer data block object without context match
+ */
+ virtual void eventDPA(ServerSession* serverSession, const anna::DataBlock& response) throw(anna::RuntimeException) = 0;
+
friend class anna::diameter::comm::Timer;
friend class Engine;
*/
virtual void eventUnknownResponse(ClientSession *clientSession, const anna::DataBlock& response) throw(anna::RuntimeException);
+ /**
+ Handler for diameter server (client-session) Disconnect-Peer-Answer messages
+
+ \param clientSession ClientSession from which request has been received
+ \param response Answer data block object without context match
+ */
+ virtual void eventDPA(ClientSession *clientSession, const anna::DataBlock& response) throw(anna::RuntimeException);
+
+
friend class Engine;
friend class ClientSession;
*/
void eventUnknownResponse(const anna::DataBlock& response) throw(anna::RuntimeException);
+ /**
+ Handler for diameter client Disconnect-Peer-Answer messages
+
+ \param response Answer data block object without context match
+ */
+ void eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException);
+
+
/**
* Handlers for receptions
*/
virtual void eventUnknownResponse(const anna::DataBlock& response) throw(anna::RuntimeException) = 0;
+ /**
+ Handler for diameter session Disconnect-Peer-Answer messages
+
+ \param response Answer data block object without context match
+ */
+ virtual void eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException) = 0;
+
/**
a_parent->eventUnknownResponse(this, response);
}
+void ClientSession::eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException) {
+ // Inform father server:
+ a_parent->eventDPA(this, response);
+}
+
//------------------------------------------------------------------------------------------
requestMessage->setRequestServerSessionKey(response->getRequest()->getRequestServerSessionKey()); // -1 means unkown/unset
if(cid != helpers::base::COMMANDID__Disconnect_Peer_Answer) {
- // don't progress DPA: unbind is automatically performed and not open to any application decision
try {
response->setMessage(&db);
// Restore received datablock
ex.trace();
}
}
+ else { // DPA
+ // unbind is automatically performed, anyway we can inform to the application just in case some additional
+ // procedure could be issued:
+ eventDPA(db);
+ }
response_erase(response);
a_parent->eventUnknownResponse(clientSession, response);
}
+void Server::eventDPA(ClientSession *clientSession, const anna::DataBlock & response) throw(anna::RuntimeException) {
+ // Inform father server:
+ a_parent->eventDPA(clientSession, response);
+}
+
+
void Server::availabilityLost() throw() {
a_available = false;
std::string socket = anna::functions::socketLiteralAsString(a_socket.first, a_socket.second);
a_parent->eventUnknownResponse(this, response);
}
+void ServerSession::eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException) {
+ // Inform father server:
+ a_parent->eventDPA(this, response);
+}
//------------------------------------------------------------------------------------------
// Se invoca desde el diameter::comm::Receiver
doUnbind = true;
}
}
+
+ eventDPA(db);
+
} else if(cid == helpers::base::COMMANDID__Device_Watchdog_Answer) { // non usual (server should not send DWR's)
oamModule.count(OamModule::Counter::DWAReceived);
}