#include "Service.hpp"
#include <stdlib.h>
#include <string>

using namespace mole;
using namespace serv;

Service::Service(mole::ctx::Request * req):request(req), response(NULL){
}

Service::Service():request(NULL), response(NULL){}

Service::~Service(){
    if (request) delete request;
    if (response) delete response;
}

Response *
Service::getResponse(){
	return response;
}


bool
Service::execute(mole::ctx::Client * client){
    Response * r = request->execute(client);
    if (r){
	setResponse(r);
	return true;
    }
    return false;
}

mole::ctx::Request *
Service::getRequest(){
    return request;
}


Service *
Service::newInvocableService(mole::ctx::Request * r){
    return NULL;
}
