Class ImporterDatabase

All Implemented Interfaces:
Database

public class ImporterDatabase
extends OnDiskQueryDatabase
Wrap OnDiskQueryDatabase, ensuring the user context has been set. If a user context is supplied, it will be used, otherwise default authentication will be attempted.
  • Constructor Details

    • ImporterDatabase

      public ImporterDatabase​(@NonNull com.fishlib.io.logger.Logger log)
      Create an ImporterDatabase with default rootDirectory and local TableDataService configuration, and default authentication.
      Parameters:
      log - the logger to use
    • ImporterDatabase

      public ImporterDatabase​(@NonNull com.fishlib.io.logger.Logger log, @NonNull com.fishlib.auth.UserContext userContext)
      Create an ImporterDatabase with default rootDirectory and local TableDataService configuration, and authenticate with the given user context.
      Parameters:
      log - the logger to use
      userContext - set this user context
    • ImporterDatabase

      public ImporterDatabase​(@NonNull com.fishlib.io.logger.Logger log, @Nullable com.fishlib.auth.UserContext userContext, @NonNull String tableDataServiceName)
      Create an ImporterDatabase with default rootDirectory and the named TableDataService configuration. If userContext is supplied, use it to authenticate.
      Parameters:
      log - the logger to use
      userContext - optional: set this user context
      tableDataServiceName - initialize the TableDataService with this configuration name.
    • ImporterDatabase

      @Deprecated public ImporterDatabase​(@NonNull com.fishlib.io.logger.Logger log, @NonNull File rootDirectory)
      Deprecated.
      this constructor is considered harmful, attempts to pass rootDirectory other than the default will fail. Use ImporterDatabase(Logger) or usingLocalTableDataService(Logger) instead.
      Create an ImporterDatabase with the named rootDirectory and default local TableDataService.
      Parameters:
      log - the logger to use
      rootDirectory - initialize locations with this database root directory.
    • ImporterDatabase

      @Deprecated public ImporterDatabase​(com.fishlib.io.logger.Logger log, File rootDirectory, com.fishlib.auth.UserContext userContext)
      Deprecated.
      this constructor is considered harmful, attempts to pass rootDirectory other than the default will fail. Use ImporterDatabase(Logger, UserContext) instead.
      Create an ImporterDatabase with the named rootDirectory and given userContext, and the default local TableDataService.
      Parameters:
      log - the logger to use
      rootDirectory - initialize locations with this database root directory.
      userContext - set this user context
  • Method Details

    • usingLocalTableDataService

      public static ImporterDatabase usingLocalTableDataService​(com.fishlib.io.logger.Logger log)
      Create an ImporterDatabase using the default root directory and authentication, and the default local TableDataService.
      Parameters:
      log - the logger to use
      Returns:
      the new ImporterDatabase.