Class PluginDriver

java.lang.Object
de.julianweinelt.datacat.dbx.api.drivers.PluginDriver

public abstract class PluginDriver extends Object
  • Constructor Details

    • PluginDriver

      public PluginDriver(String internalName)
  • Method Details

    • latestVersion

      public abstract CompletableFuture<String> latestVersion()
      Gets the latest version of the driver by looking it up on the internet.
      Returns:
      The latest version as String, mostly in a semantic version
    • downloadURL

      public abstract String downloadURL(String version)
      Defines the url to download the driver jar from depending on the given version.
      Parameters:
      version - The version String which will be used in the download
      Returns:
      A String containing the url to download the file from
    • isZippedFile

      public boolean isZippedFile()
      Defines if the downloaded driver files are usually compressed in e.g. zip or tar.
      Returns:
      true if the driver files are usually compressed, otherwise false
      See Also:
    • archiveType

      @Nullable public @Nullable String archiveType()
      Defines which type of archive this driver is.
      Returns:
      A String containing the file extension of the compressed files, null if isZippedFile() is false
    • defineVersions

      public abstract void defineVersions()
      Define every version available for this driver here.
      You may use addVersion(String) in this method to define versions.
      See Also:
    • defineVersionsASync

      public abstract CompletableFuture<Void> defineVersionsASync()
    • addVersion

      protected void addVersion(String versionName)
      Registers a new version for this driver, giving just the name.
      The version will therefore be registered as semantic version of type VersionStatus.RELEASE.
      Parameters:
      versionName - The name of the version as a String, e.g. 1.4.2 (semantic) or 1.7.542.3-beta-1 (non-semantic)
      See Also:
    • addVersion

      protected void addVersion(String versionName, boolean semantic)
      Registers a new version for this driver, giving just the name.
      The version will therefore be registered as a version of type VersionStatus.RELEASE.
      Parameters:
      versionName - The name of the version as a String, e.g. 1.4.2 (semantic) or 1.7.542.3-beta-1 (non-semantic)
      semantic - Defines if this is a semantic version
      See Also:
    • addVersion

      protected void addVersion(String versionName, boolean semantic, VersionStatus status)
      Registers a new version for this driver, giving just the name.
      Parameters:
      versionName - The name of the version as a String, e.g. 1.4.2 (semantic) or 1.7.542.3-beta-1 (non-semantic)
      semantic - Defines if this is a semantic version
      status - The type of version, see VersionStatus for more.
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object