2014-01-08 14:16:39 +00:00
|
|
|
namespace AsterNET.Manager.Action
|
2013-01-18 15:55:50 +00:00
|
|
|
{
|
2015-01-03 15:37:29 +00:00
|
|
|
/// <summary>
|
|
|
|
/// This class implements the ManagerAction interface
|
|
|
|
/// and can serve as base class for your concrete Action implementations.
|
|
|
|
/// </summary>
|
|
|
|
public abstract class ManagerAction
|
|
|
|
{
|
|
|
|
private string actionId;
|
|
|
|
private string proxyKey;
|
|
|
|
private string server;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Manager API Action key. Also use as ProxyAction key to <see cref="ProxyAction">ProxyAction</see> actions.
|
|
|
|
/// </summary>
|
|
|
|
public abstract string Action { get; }
|
|
|
|
|
|
|
|
#region ActionId
|
|
|
|
|
|
|
|
public string ActionId
|
|
|
|
{
|
|
|
|
get { return this.actionId; }
|
|
|
|
set { this.actionId = value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Server
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Specify a server to which to send your commands (x.x.x.x or hostname).<br />
|
|
|
|
/// This should match the server name specified in your config file's "host" entry.
|
|
|
|
/// If you do not specify a server, the proxy will pick the first one it finds -- fine in single-server configurations.
|
|
|
|
/// </summary>
|
|
|
|
public string Server
|
|
|
|
{
|
|
|
|
get { return this.server; }
|
|
|
|
set { this.server = value; }
|
|
|
|
}
|
2013-01-18 15:55:50 +00:00
|
|
|
|
2015-01-03 15:37:29 +00:00
|
|
|
#endregion
|
2013-01-18 15:55:50 +00:00
|
|
|
|
2015-01-03 15:37:29 +00:00
|
|
|
#region ProxyKey
|
2013-01-18 15:55:50 +00:00
|
|
|
|
2015-01-03 15:37:29 +00:00
|
|
|
/// <summary>
|
|
|
|
/// You can use this as a simple authentication mechanism.<br />
|
2016-10-19 07:20:23 +00:00
|
|
|
/// Rather than have to login with a username & password,
|
2015-01-03 15:37:29 +00:00
|
|
|
/// you can specify a <b>ProxyKey</b> that must be passed from
|
|
|
|
/// a client before requests are processed.<br />
|
|
|
|
/// This is helpful in situations where you would like to authenticate and
|
|
|
|
/// execute an action in a single step.
|
|
|
|
/// </summary>
|
|
|
|
public virtual string ProxyKey
|
|
|
|
{
|
|
|
|
get { return this.proxyKey; }
|
|
|
|
set { this.proxyKey = value; }
|
|
|
|
}
|
2013-01-18 15:55:50 +00:00
|
|
|
|
2015-01-03 15:37:29 +00:00
|
|
|
#endregion
|
2013-01-18 15:55:50 +00:00
|
|
|
|
2015-01-03 15:37:29 +00:00
|
|
|
public override string ToString()
|
|
|
|
{
|
|
|
|
return Helper.ToString(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|