using System.Security;
namespace IIS
{
internal interface IIISManager
{
/// <summary>
/// Create new web site node on IIS.
/// </summary>
/// <param name="webSite">New web site name.</param>
/// <param name="hostname">Used host name or IP address associated with web site..</param>
/// <param name="port">Used web site port.</param>
/// <param name="webSitePath">Path to web site on disk.</param>
void CreateWebSiteNode(string webSite, string hostname, int port, string webSitePath);
/// <summary>
/// Create new application pool for web site on IIS.
/// </summary>
/// <param name="applicationPool">Application pool name.</param>
void CreateApplicationPool(string applicationPool);
/// <summary>
/// Create new virtual directory for web site on IIS.
/// </summary>
/// <param name="virtualDirectory">New virtual directory name.</param>
/// <param name="webSite">Web site name.</param>
/// <param name="webSitePath">Path to web site on disk.</param>
void CreateVirtualDirectory(string virtualDirectory, string webSite, string webSitePath);
/// <summary>
/// Switch framework version to 2.0 for selected web site.
/// </summary>
/// <param name="webSite">Web site name.</param>
/// <param name="virtualDirirectory">Virtual directory.</param>
/// <exception cref="FrameworkSwitchException">If failed to switch framework for specified web site.</exception>
/// <exception cref="SecurityException">Thrown if current user has no permissions to read from windows directory.</exception>
/// <exception cref="FrameworkNotFoundException">Thrown if there is no suitable framework on current machine.</exception>
/// <exception cref="WebSiteNotFoundException">Thrown in specified web site not found on IIS server.</exception>
void SwitchNodeFramework(string webSite, string virtualDirirectory);
/// <summary>
/// Set application pool for selected virtual directory.
/// </summary>
/// <param name="virtualDirectory">Virtual directory name.</param>
/// <param name="webSite">Web site name.</param>
/// <param name="applicationPool">New application pool name.</param>
void SetApplicationPool(string virtualDirectory, string webSite, string applicationPool);
/// <summary>
/// Check if virtual directory exists.
/// </summary>
/// <param name="virtualDirectory">Virtual directory name.</param>
/// <param name="webSite">Web site name.</param>
/// <returns>Returns true if virtual directory exists, otherwise returns false.</returns>
bool IsVirtualDirectoryExists(string virtualDirectory, string webSite);
/// <summary>
/// Check if web site with specified name already exists.
/// </summary>
/// <param name="webSite">Web site name.</param>
/// <returns>Returns true if web site exists, otherwise returns false.</returns>
bool IsWebSiteExists(string webSite);
/// <summary>
/// Check if application pool with specified name already exists.
/// </summary>
/// <param name="applicationPool">Application pool name.</param>
/// <returns>Returns true if application pool exists, otherwise returns false.</returns>
bool IsApplicationPoolExists(string applicationPool);
/// <summary>
/// Check if specified port already in use.
/// </summary>
/// <param name="port">Port.</param>
/// <returns>Returns true if specified port already in use, otherwise returns false.</returns>
bool IsPortInUse(int port);
/// <summary>
/// Check if current user has enough rights for temporary asp.net files directory.
/// </summary>
/// <returns>Returns true if user has enough rights, otherwise returns false.</returns>
bool CheckTemporaryDirectoryAccessRights();
/// <summary>
/// Retrieves host name and port for specified web site.
/// </summary>
/// <param name="webSite">Web site name.</param>
/// <param name="hostname">Used host name or IP address.</param>
/// <param name="port">Used port.</param>
/// <exception cref="WebSiteNotFoundException">Thrown in specified web site not found on IIS server.</exception>
void GetWebSiteIpAndPort(string webSite, out string hostname, out int port);
/// <summary>
/// Get Application Pool List
/// </summary>
/// <returns>Application Pool List</returns>
string[] GetApplicationPoolsList();
/// <summary>
/// Get IIS Server Root Web sites List
/// </summary>
/// <returns>IIS Server Root Web List</returns>
string[] GetWebSitesList();
}
}