#ifndef _BACKENDCHECK_
#define _BACKENDCHECK_

#include "sys/sys"
#include "error/error"

class BackendCheck {
public:
    enum CheckType {
	c_connect,
	c_get,
	c_external,
    };
    
    BackendCheck();

    CheckType checktype() const 	 	{ return check_type; }
    void checktype(CheckType t)			{ check_type = t; }
    
    string server() const			{ return srv; }
    void server(string s)			{ srv = s; }
    
    int port() const				{ return prt; }
    void port(int p)				{ prt = p; }
    
    string uri() const				{ return geturi; }
    void uri(string u)				{ geturi = u; }

    string program() const			{ return extprog; }    
    void program(string const &p)		{ extprog = p; }

    void parse(string setting);

    string setting() const;
    string description() const;

private:
    CheckType check_type;
    string srv;
    int prt;
    string geturi;
    string extprog;
};

#endif
