using Duplicati.Server;
using System;
using System.Collections.Generic;
namespace Duplicati.Library.RestAPI
{
/**
* In the absense of dependancy injection, there is a significant amount of variables exposed through Program as globals.
* This causes a problem decoupling classes and leads to circular dependancies.
*/
public static class FIXMEGlobal
{
///
/// This is the only access to the database
///
public static Server.Database.Connection DataConnection;
///
/// The controller interface for pause/resume and throttle options
///
public static LiveControls LiveControl;
///
/// A delegate method for creating a copy of the current progress state
///
public static Func GenerateProgressState;
///
/// The status event signaler, used to control long polling of status updates
///
public static readonly EventPollNotify StatusEventNotifyer = new EventPollNotify();
///
/// This is the working thread
///
public static Duplicati.Library.Utility.WorkerThread WorkThread;
public static Func PeekLastDataUpdateID;
public static Func PeekLastNotificationUpdateID;
public static Action IncrementLastDataUpdateID;
public static Action IncrementLastNotificationUpdateID;
public static Action StartOrStopUsageReporter;
public static Action UpdateThrottleSpeeds;
///
/// Gets the folder where Duplicati data is stored
///
public static string DataFolder;
///
/// This is the scheduling thread
///
public static Scheduler Scheduler;
///
/// The log redirect handler
///
public static readonly LogWriteHandler LogHandler = new LogWriteHandler();
public static Func, Server.Database.Connection> GetDatabaseConnection;
///
/// The update poll thread.
///
public static UpdatePollThread UpdatePoller;
///
/// Used to check the origin of the web server (e.g. Tray icon or a stand alone Server)
///
public static string Origin = "Server";
///
/// The application exit event
///
public static System.Threading.ManualResetEvent ApplicationExitEvent;
///
/// List of completed task results
///
public static readonly List> TaskResultCache = new List>();
///
/// This is the lock to be used before manipulating the shared resources
///
public static readonly object MainLock = new object();
}
}