2013-01-18 15:55:50 +00:00
|
|
|
using System;
|
2015-01-03 15:37:29 +00:00
|
|
|
using AsterNET.Manager.Event;
|
|
|
|
|
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>
|
|
|
|
/// Retrieves an entry in the Asterisk database for a given family and key.<br />
|
|
|
|
/// If an entry is found a DBGetResponseEvent is sent by Asterisk containing the
|
|
|
|
/// value, otherwise a ManagerError indicates that no entry matches.
|
|
|
|
/// </summary>
|
|
|
|
/// <seealso cref="AsterNET.Manager.Event.DBGetResponseEvent" />
|
|
|
|
public class DBGetAction : ManagerActionEvent
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Creates a new empty DBGetAction.
|
|
|
|
/// </summary>
|
|
|
|
public DBGetAction()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Creates a new DBGetAction that retrieves the value of the database entry
|
|
|
|
/// with the given key in the given family.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="family">the family of the key</param>
|
|
|
|
/// <param name="key">the key of the entry to retrieve</param>
|
|
|
|
public DBGetAction(string family, string key)
|
|
|
|
{
|
|
|
|
Family = family;
|
|
|
|
Key = key;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override string Action
|
|
|
|
{
|
|
|
|
get { return "DBGet"; }
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Returns the family of the key.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>
|
|
|
|
/// the family of the key.
|
|
|
|
/// </returns>
|
|
|
|
/// <param name="family">
|
|
|
|
/// the family of the key.
|
|
|
|
/// </param>
|
|
|
|
public string Family { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get/Set the the key of the entry to retrieve.
|
|
|
|
/// </summary>
|
|
|
|
public string Key { get; set; }
|
2013-01-18 15:55:50 +00:00
|
|
|
|
2015-01-03 15:37:29 +00:00
|
|
|
public override Type ActionCompleteEventClass()
|
|
|
|
{
|
|
|
|
return typeof (DBGetResponseEvent);
|
|
|
|
}
|
|
|
|
}
|
2013-01-18 15:55:50 +00:00
|
|
|
}
|