public Create(IEnvironmentDetails environmentDetails, IRestClient client) : base(environmentDetails, client, "Creates a new torrent from a file source.") { HasRequiredOption("n|name=", "Name of the torrent to be created.", o => Name = o); HasRequiredOption("s|sourceDirectory=", "Source directory for torrent.", o => SourceDirectory = o); HasOption("trackers=", "Trackers to add to the torrent. Comma seperation for more than one.", o => Trackers = o.Split(',')); HasOption("a|add", "Adds the torrent after it has been created.", o => Add = o != null); }
public Add(IEnvironmentDetails environmentDetails, IRestClient client) : base(environmentDetails, client, "Adds a torrent to be deployed.") { HasRequiredOption("t|torrent=", "Torrent deployment file path.", o => TorrentPath = o); HasRequiredOption("o|outputDirectory=", "Output directory path for deployment.", o => OuputDirectoryPath = o); HasOption("m|mirror", "Walks the output directory to make sure it mirrors the deployment. Any additional files will be deleted.", o => Mirror = o != null); HasOption("w|wait", "Wait for deployment to finish downloading before exiting.", o => Wait = o != null); }
public Add(IEnvironmentDetails environmentDetails, IRestClient client) : base(environmentDetails, client, "Adds a torrent to be deployed.") { HasRequiredOption ("t|torrent=", "Torrent deployment file path.", o => TorrentPath = o); HasRequiredOption ("o|outputDirectory=", "Output directory path for deployment.", o => OuputDirectoryPath = o); HasOption ("m|mirror", "Walks the output directory to make sure it mirrors the deployment. Any additional files will be deleted.", o => Mirror = o != null); HasOption ("w|wait", "Wait for deployment to finish downloading before exiting.", o => Wait = o != null); }
public Create(IEnvironmentDetails environmentDetails, IRestClient client) : base(environmentDetails, client, "Creates a new torrent from a file source.") { HasRequiredOption ("n|name=", "Name of the torrent to be created.", o => Name = o); HasRequiredOption ("s|sourceDirectory=", "Source directory for torrent.", o => SourceDirectory = o); HasOption ("trackers=", "Trackers to add to the torrent. Comma seperation for more than one.", o => Trackers = o.Split (',')); HasOption ("a|add", "Adds the torrent after it has been created.", o => Add = o != null); }
public ServicesAppHost(IEnvironmentDetails environmentDetails, ITorrentClient torrentClient) : base(Assembly.GetExecutingAssembly().FullName, typeof(ServicesAppHost).Assembly) { // Set the torrent client. TorrentClient = torrentClient; // Ask OS for port and make the endpoint. Endpoint = string.Format("http://*:{0}/", environmentDetails.ServiceDaemonPort); }
public ServicesAppHost(IEnvironmentDetails environmentDetails, ITorrentClient torrentClient) : base(Assembly.GetExecutingAssembly().FullName, typeof (ServicesAppHost).Assembly) { // Set the torrent client. TorrentClient = torrentClient; // Ask OS for port and make the endpoint. Endpoint = string.Format ("http://*:{0}/", environmentDetails.ServiceDaemonPort); }
public Admin(IEnvironmentDetails environmentDetails, IRestClient client) { IsCommand ("Admin", "Basic administration commands."); HasOption ("start", "Spawns the long lasting background daemon. This process contines downloading and/or seeding after the application has exited.", o => Start = o != null); HasOption ("stop", "Terminates the long lasting background daemon, this process would otherwise continuing downloading and/or seeding after the application has exited.", o => Stop = o != null); SkipsCommandSummaryBeforeRunning (); Client = client; EnvironmentDetails = environmentDetails; }
public Admin(IEnvironmentDetails environmentDetails, IRestClient client) { IsCommand("Admin", "Basic administration commands."); HasOption("start", "Spawns the long lasting background daemon. This process contines downloading and/or seeding after the application has exited.", o => Start = o != null); HasOption("stop", "Terminates the long lasting background daemon, this process would otherwise continuing downloading and/or seeding after the application has exited.", o => Stop = o != null); SkipsCommandSummaryBeforeRunning(); Client = client; EnvironmentDetails = environmentDetails; }
public GeneralConsoleCommandBase(IEnvironmentDetails environmentDetails, IRestClient client, string oneLineDescription) { // Set the base commands. IsCommand(this.GetType().Name, oneLineDescription); HasOption("noStart", "Prevents the long lasting process from being spawned automatically", o => Start = o == null); HasOption("noStop", "Prevents the long lasting background daemon from being killed, this process will continue downloading and/or seeding after the application has exited.", o => Kill = o == null); SkipsCommandSummaryBeforeRunning(); // Set common items. EnvironmentDetails = environmentDetails; Client = client; }
public GeneralConsoleCommandBase(IEnvironmentDetails environmentDetails, IRestClient client, string oneLineDescription) { // Set the base commands. IsCommand (this.GetType ().Name, oneLineDescription); HasOption ("noStart", "Prevents the long lasting process from being spawned automatically", o => Start = o == null); HasOption ("noStop", "Prevents the long lasting background daemon from being killed, this process will continue downloading and/or seeding after the application has exited.", o => Kill = o == null); SkipsCommandSummaryBeforeRunning (); // Set common items. EnvironmentDetails = environmentDetails; Client = client; }
protected static void RunServiceDaemon(IEnvironmentDetails environmentDetails) { // Make the torrent client. var monotTorrentClient = new MonoTorrentClient (environmentDetails.ApplicationDataDirectoryPath); monotTorrentClient.Start (); // Make torrent service app host. var servicesAppHost = new ServicesAppHost (environmentDetails, monotTorrentClient); servicesAppHost.Init (); // Never die. Thread.Sleep (Timeout.Infinite); }
protected static void RunServiceDaemon(IEnvironmentDetails environmentDetails) { // Make the torrent client. var monotTorrentClient = new MonoTorrentClient(environmentDetails.ApplicationDataDirectoryPath); monotTorrentClient.Start(); // Make torrent service app host. var servicesAppHost = new ServicesAppHost(environmentDetails, monotTorrentClient); servicesAppHost.Init(); // Never die. Thread.Sleep(Timeout.Infinite); }
public static void RunClientCommand(IEnvironmentDetails environmentDetails, string[] args) { // Make the container. var containerBuilder = new ContainerBuilder(); containerBuilder.RegisterAssemblyTypes (typeof(Program).Assembly) .Where (t => t.IsAssignableTo<ConsoleCommand> ()) .As<ConsoleCommand> () .OwnedByLifetimeScope(); containerBuilder.RegisterType<EnvironmentDetails> () .AsImplementedInterfaces () .OwnedByLifetimeScope (); containerBuilder.RegisterType<JsonServiceClient> () .WithParameter (new NamedParameter ("baseUri", environmentDetails.ServiceDaemonEndpoint)) .WithProperty ("Timeout", new TimeSpan (0, 10, 0)) .AsImplementedInterfaces () .OwnedByLifetimeScope (); var container = containerBuilder.Build (); // Get the commands and run them. var commands = container.Resolve<IEnumerable<ConsoleCommand>> ().OrderBy (c => c.Command); ConsoleCommandDispatcher.DispatchCommand (commands, args, Console.Out); }
public static void RunClientCommand(IEnvironmentDetails environmentDetails, string[] args) { // Make the container. var containerBuilder = new ContainerBuilder(); containerBuilder.RegisterAssemblyTypes(typeof(Program).Assembly) .Where(t => t.IsAssignableTo <ConsoleCommand> ()) .As <ConsoleCommand> () .OwnedByLifetimeScope(); containerBuilder.RegisterType <EnvironmentDetails> () .AsImplementedInterfaces() .OwnedByLifetimeScope(); containerBuilder.RegisterType <JsonServiceClient> () .WithParameter(new NamedParameter("baseUri", environmentDetails.ServiceDaemonEndpoint)) .WithProperty("Timeout", new TimeSpan(0, 10, 0)) .AsImplementedInterfaces() .OwnedByLifetimeScope(); var container = containerBuilder.Build(); // Get the commands and run them. var commands = container.Resolve <IEnumerable <ConsoleCommand> > ().OrderBy(c => c.Command); ConsoleCommandDispatcher.DispatchCommand(commands, args, Console.Out); }
public Remove(IEnvironmentDetails environmentDetails, IRestClient client) : base(environmentDetails, client, "Removes specified deployments. Specify deployments by providing torrent id or wildcard name pattern.") { HasOption ("d|delete", "Deletes the files along with the torrent deployment file.", o => Delete = o != null); HasAdditionalArguments (null); }
public Remove(IEnvironmentDetails environmentDetails, IRestClient client) : base(environmentDetails, client, "Removes specified deployments. Specify deployments by providing torrent id or wildcard name pattern.") { HasOption("d|delete", "Deletes the files along with the torrent deployment file.", o => Delete = o != null); HasAdditionalArguments(null); }
public List(IEnvironmentDetails environmentDetails, IRestClient client) : base(environmentDetails, client, "Lists the current deployments. Filter deployments by providing torrent id or wildcard name pattern.") { HasOption ("id", "Include torrent id in output table.", o => IncludeId = o != null); HasAdditionalArguments (null); }
public Wait(IEnvironmentDetails environmentDetails, IRestClient client) : base(environmentDetails, client, "Waits until specified deployments finishes downloading before exiting. Specify deployments by providing torrent id or wildcard name pattern.") { HasAdditionalArguments(null); }
public Wait(IEnvironmentDetails environmentDetails, IRestClient client) : base(environmentDetails, client, "Waits until specified deployments finishes downloading before exiting. Specify deployments by providing torrent id or wildcard name pattern.") { HasAdditionalArguments (null); }
public List(IEnvironmentDetails environmentDetails, IRestClient client) : base(environmentDetails, client, "Lists the current deployments. Filter deployments by providing torrent id or wildcard name pattern.") { HasOption("id", "Include torrent id in output table.", o => IncludeId = o != null); HasAdditionalArguments(null); }