//******************************************************************************************************
// IFtpSessionState.cs - Gbtc
//
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may
// not use this file except in compliance with the License. You may obtain a copy of the License at:
//
// http://www.opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 09/23/2008 - J. Ritchie Carroll
// Generated original version of source code.
// 09/14/2009 - Stephen C. Wills
// Added new header and license agreement.
// 12/17/2012 - Starlynn Danyelle Gilliam
// Modified Header.
//
//******************************************************************************************************
#region [ Contributor License Agreements ]
//*******************************************************************************************************
//
// Code based on the following project:
// http://www.codeproject.com/KB/IP/net_ftp_upload.aspx
//
// Copyright Alex Kwok & Uwe Keim
//
// The Code Project Open License (CPOL):
// http://www.codeproject.com/info/cpol10.aspx
//
//*******************************************************************************************************
#endregion
using System;
using System.Net;
namespace GSF.Net.Ftp
{
///
/// Abstract representation of a FTP session state (e.g., connected or disconnected).
///
internal interface IFtpSessionState : IDisposable
{
///
/// Gets or sets FTP server name (DNS name or IP).
///
string Server { get; set; }
///
/// Gets or sets FTP server port to use, defaults to 21.
///
int Port { get; set; }
///
/// Gets or sets the timeout, in milliseconds, for
/// read and write operations, defaults to 30 seconds.
///
int Timeout { get; set; }
///
/// Gets or sets the passive/active mode of the FTP server.
///
bool Passive { get; set; }
///
/// Gets or sets the IP address to send with the PORT command.
///
IPAddress ActiveAddress { get; set; }
///
/// Gets or sets the minimum value in the range of ports
/// used when listening for connections in active mode.
///
int MinActivePort { get; set; }
///
/// Gets or sets the maximum value in the range of ports
/// used when listening for connections in active mode.
///
int MaxActivePort { get; set; }
///
/// Gets or sets current FTP session directory.
///
FtpDirectory CurrentDirectory { get; set; }
///
/// Gets FTP session root directory entry.
///
FtpDirectory RootDirectory { get; }
///
/// Gets the current FTP control channel.
///
FtpControlChannel ControlChannel { get; }
///
/// Returns true if FTP session is currently busy.
///
bool IsBusy { get; }
///
/// Aborts current file transfer.
///
void AbortTransfer();
///
/// Connects to FTP server using specified credentials.
///
/// User name used to authenticate to FTP server.
/// Password used to authenticate to FTP server.
void Connect(string userName, string password);
///
/// Closes current FTP session.
///
void Close();
}
}