icinga2/icinga/jsonrpcendpoint.cpp

31 lines
582 B
C++
Raw Normal View History

#include "i2-icinga.h"
using namespace icinga;
2012-04-16 16:27:41 +02:00
JsonRpcClient::Ptr JsonRpcEndpoint::GetClient(void)
{
return m_Client;
}
void JsonRpcEndpoint::SetClient(JsonRpcClient::Ptr client)
{
m_Client = client;
}
bool JsonRpcEndpoint::IsConnected(void) const
{
return (m_Client.get() != NULL);
}
void JsonRpcEndpoint::SendRequest(Endpoint::Ptr sender, JsonRpcRequest::Ptr message)
{
if (IsConnected())
m_Client->SendMessage(message);
}
void JsonRpcEndpoint::SendResponse(Endpoint::Ptr sender, JsonRpcResponse::Ptr message)
{
if (IsConnected())
m_Client->SendMessage(message);
}