#include "Server.hpp"

using namespace mole;
using namespace ctx;

Server::Server(std::string i, unsigned int p, std::string pa):
	ip(i), port(p), path(pa), serviceFactory(new mole::serv::ServiceFactory()){}

Server::Server():ip(""), port(0), path(""), 
		serviceFactory(new mole::serv::ServiceFactory()){}

Server::~Server(){
		delete serviceFactory;
};

void
Server::setIp(std::string i){
	ip = i;
}

void
Server::setPort(unsigned int p){
	port = p;
}

void
Server::setPath(std::string s){
	path = s;
}


mole::serv::Service *
Server::getService(std::string name){
  return serviceFactory->getService(name);
}

mole::serv::ServiceFactory *
Server::getServiceFactory(){
  return serviceFactory;
}

void
Server::addService(std::string name, mole::serv::Service * service){
		serviceFactory->addService(name, service);
}
