/// <summary> /// The entry point for neo4j admin tool's online backup functionality. /// </summary> /// <param name="outsideWorld"> provides a way to interact with the filesystem and output streams </param> /// <param name="contextBuilder"> helper class to validate, process and return a grouped result of processing the command line arguments </param> /// <param name="backupSupportingClassesFactory"> necessary for constructing the strategy for backing up over the causal clustering transaction protocol </param> /// <param name="backupStrategyCoordinatorFactory"> class that actually handles the logic of performing a backup </param> internal OnlineBackupCommand(OutsideWorld outsideWorld, OnlineBackupContextFactory contextBuilder, BackupSupportingClassesFactory backupSupportingClassesFactory, BackupStrategyCoordinatorFactory backupStrategyCoordinatorFactory) { this._outsideWorld = outsideWorld; this._contextBuilder = contextBuilder; this._backupSupportingClassesFactory = backupSupportingClassesFactory; this._backupStrategyCoordinatorFactory = backupStrategyCoordinatorFactory; }
/// <summary> /// Dependencies that can be resolved immediately after launching the backup tool /// </summary> /// <param name="outsideWorld"> filesystem and output streams that the tool interacts with </param> /// <param name="logProvider"> made available to subsequent dependency resolution classes </param> /// <param name="monitors"> will become shared across all resolved dependencies </param> internal BackupModule(OutsideWorld outsideWorld, LogProvider logProvider, Monitors monitors) { this._outsideWorld = outsideWorld; this._logProvider = logProvider; this._monitors = monitors; this._clock = Clock.systemDefaultZone(); this._transactionLogCatchUpFactory = new TransactionLogCatchUpFactory(); this._fileSystemAbstraction = outsideWorld.FileSystem(); this._jobScheduler = createInitialisedScheduler(); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: DatabaseImporter(org.neo4j.helpers.Args args, org.neo4j.kernel.configuration.Config config, org.neo4j.commandline.admin.OutsideWorld outsideWorld) throws org.neo4j.commandline.admin.IncorrectUsage internal DatabaseImporter(Args args, Config config, OutsideWorld outsideWorld) { this._config = config; try { this._from = args.InterpretOption("from", Converters.mandatory(), Converters.toFile(), Validators.CONTAINS_EXISTING_DATABASE); } catch (System.ArgumentException e) { throw new IncorrectUsage(e.Message); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override @Nonnull public org.neo4j.commandline.admin.AdminCommand create(java.nio.file.Path homeDir, java.nio.file.Path configDir, org.neo4j.commandline.admin.OutsideWorld outsideWorld) public override AdminCommand Create(Path homeDir, Path configDir, OutsideWorld outsideWorld) { bool debug = System.getenv().get("NEO4J_DEBUG") != null; LogProvider logProvider = FormattedLogProvider.withDefaultLogLevel(debug ? Level.DEBUG : Level.NONE).toOutputStream(outsideWorld.OutStream()); Monitors monitors = new Monitors(); OnlineBackupContextFactory contextBuilder = new OnlineBackupContextFactory(homeDir, configDir); BackupModule backupModule = new BackupModule(outsideWorld, logProvider, monitors); BackupSupportingClassesFactoryProvider classesFactoryProvider = ProvidersByPriority.findFirst().orElseThrow(NoProviderException()); BackupSupportingClassesFactory supportingClassesFactory = classesFactoryProvider.GetFactory(backupModule); BackupStrategyCoordinatorFactory coordinatorFactory = new BackupStrategyCoordinatorFactory(backupModule); return(new OnlineBackupCommand(outsideWorld, contextBuilder, supportingClassesFactory, coordinatorFactory)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override @Nonnull public org.neo4j.commandline.admin.AdminCommand create(java.nio.file.Path homeDir, java.nio.file.Path configDir, org.neo4j.commandline.admin.OutsideWorld outsideWorld) public override AdminCommand Create(Path homeDir, Path configDir, OutsideWorld outsideWorld) { return(new DumpCommand(homeDir, configDir, new Dumper(outsideWorld.ErrorStream()))); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Nonnull @Override public org.neo4j.commandline.admin.AdminCommand create(java.nio.file.Path homeDir, java.nio.file.Path configDir, org.neo4j.commandline.admin.OutsideWorld outsideWorld) public override AdminCommand Create(Path homeDir, Path configDir, OutsideWorld outsideWorld) { return(new DiagnosticsReportCommand(homeDir, configDir, outsideWorld)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override @Nonnull public org.neo4j.commandline.admin.AdminCommand create(java.nio.file.Path homeDir, java.nio.file.Path configDir, org.neo4j.commandline.admin.OutsideWorld outsideWorld) public override AdminCommand Create(Path homeDir, Path configDir, OutsideWorld outsideWorld) { return(new StoreInfoCommand(outsideWorld.stdOutLine)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override @Nonnull public org.neo4j.commandline.admin.AdminCommand create(java.nio.file.Path homeDir, java.nio.file.Path configDir, org.neo4j.commandline.admin.OutsideWorld outsideWorld) public override AdminCommand Create(Path homeDir, Path configDir, OutsideWorld outsideWorld) { return(new UnbindFromClusterCommand(homeDir, configDir, outsideWorld)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Nonnull @Override public org.neo4j.commandline.admin.AdminCommand create(java.nio.file.Path homeDir, java.nio.file.Path configDir, org.neo4j.commandline.admin.OutsideWorld outsideWorld) public override AdminCommand Create(Path homeDir, Path configDir, OutsideWorld outsideWorld) { return(new MemoryRecommendationsCommand(homeDir, configDir, outsideWorld)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before public void setup() public virtual void Setup() { _outsideWorld = new ParameterisedOutsideWorld(System.console(), System.out, System.err, System.in, new DefaultFileSystemAbstraction()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override @Nonnull public org.neo4j.commandline.admin.AdminCommand create(java.nio.file.Path homeDir, java.nio.file.Path configDir, org.neo4j.commandline.admin.OutsideWorld outsideWorld) public override AdminCommand Create(Path homeDir, Path configDir, OutsideWorld outsideWorld) { return(new RestoreDatabaseCli(homeDir, configDir)); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: Importer getImporterForMode(String mode, org.neo4j.helpers.Args parsedArgs, org.neo4j.kernel.configuration.Config config, org.neo4j.commandline.admin.OutsideWorld outsideWorld) throws org.neo4j.commandline.admin.IncorrectUsage, org.neo4j.commandline.admin.CommandFailed internal virtual Importer GetImporterForMode(string mode, Args parsedArgs, Config config, OutsideWorld outsideWorld) { Importer importer; switch (mode) { case "database": importer = new DatabaseImporter(parsedArgs, config, outsideWorld); break; case "csv": importer = new CsvImporter(parsedArgs, config, outsideWorld); break; default: throw new CommandFailed("Invalid mode specified."); // This won't happen because mode is mandatory. } return(importer); }
internal BackupOutputMonitor(OutsideWorld outsideWorld) { LogProvider stdOutLogProvider = FormattedLogProvider.toOutputStream(outsideWorld.OutStream()); _log = stdOutLogProvider.GetLog(typeof(BackupOutputMonitor)); }
internal RealDumpCreator(Path homeDir, Path configDir, OutsideWorld outsideWorld) { this._homeDir = homeDir; this._configDir = configDir; this._outsideWorld = outsideWorld; }
public override AdminCommand Create(Path homeDir, Path configDir, OutsideWorld outsideWorld) { return(new PushToCloudCommand(homeDir, configDir, outsideWorld, new HttpCopier(outsideWorld), new RealDumpCreator(homeDir, configDir, outsideWorld))); }