So, I wrote a server for specific needs on C#, and now I looking for comfortable methods to manage this server. At first it was a simple web-based manager, but this is not scalable solution, 'cause architecture of my server is changing every day. So now I understand, that the most comfortable and scalable solution is the Command Line Interface. However, I don't wanna use primitive IF\CASE (Command line interface inside your C# application) structure at all. So there is my question:
For example I have a Server class:
public class Server
{
private int succes_interval;
private int fail_interval;
private int threshold;
private int failed_requests;
private int request_timeout;
private int update_timer;
private string updt_path;
private DateTime start_time;
private bool snmp_enabled;
private int snmp_port;
[XmlIgnore()]
public string Version { get { return Assembly.GetEntryAssembly().GetName().Version.ToString(); } }
[XmlIgnore()]
public string Path { get { return Assembly.GetEntryAssembly().Location; } }
[XmlIgnore()]
public string ServerName { get { return System.Environment.MachineName.ToLower(); } }
[XmlIgnore()]
public int SuccessInterval { get { return succes_interval; } }
public void SetSuccessInterval(int interval) { succes_interval = interval; }
[XmlIgnore()]
public int FailInterval { get { return fail_interval; } }
public void SetFailInterval(int interval) { fail_interval = interval; }
[XmlIgnore()]
public int FailThreshold { get { return threshold; } }
public void SetFailThreshold(int thresh) { threshold = thresh; }
[XmlIgnore()]
public int FailedRequests { get { return failed_requests; } }
public void SetFailedRequests(int value) { threshold = value; }
[XmlElement("RequestTimeout")]
public int RequestTimeout { get { return request_timeout; } set { request_timeout = value; } }
[XmlIgnore()]
public int UpdateCheckInterval { get { return update_timer; } set { update_timer = value; } }
[XmlElement("UpdatePath")]
public string UpdatePath { get { return updt_path; } set { updt_path = value; } }
[XmlElement("SNMPEnabled")]
public bool SNMPEnabled { get { return snmp_enabled; } set { snmp_enabled = value; } }
[XmlElement("SNMPPort")]
public int SNMPPort { get { return snmp_port; } set { snmp_port = value; } }
}
and I want to pass command "server threshold 50" to set this variable in runtime. It's no matter how to pass the command in (Telnet\ssh\http\whateverprotocol). Or for example command "show server" lists all variables in this object.
I understand it must be a tree approach, but can somebody give me a some direction to implement this.