Class StorageFactory

java.lang.Object
de.iip_ecosphere.platform.deviceMgt.storage.StorageFactory

public class StorageFactory extends Object
A StorageFactory is capable of creating different kinds of storages.
Author:
Dennis Pidun, University of Hildesheim
  • Field Details

  • Constructor Details

    • StorageFactory

      public StorageFactory()
  • Method Details

    • getInstance

      public static StorageFactory getInstance()
      Returns the instance of this factory.
      Returns:
      the instance
    • createStorage

      public Storage createStorage(PackageStorageSetup setup)
      Creates a storage based on the given setup.
      Parameters:
      setup - the setup
      Returns:
      the storage instance, may be null if no storage descriptor is available or setup is null
    • createRuntimeStorage

      public Storage createRuntimeStorage()
      Creates a runtime storage with the help of the service provider. If no service provider is found, it will fall back to the S3StorageFactoryDescriptor as a default.
      Returns:
      the runtime storage, may be null if no storage descriptor is available or setup is null
      See Also:
    • initDesc

      private void initDesc()
      Initializes the descriptors.
    • createConfigStorage

      public Storage createConfigStorage()
      Creates a config storage with the help of the service provider. If no service provider is found, it will fall back to the S3StorageFactoryDescriptor as a default.
      Returns:
      the runtime storage, may be null if no storage descriptor is available or setup is null
      See Also:
    • loadSetup

      private void loadSetup()
      Loads the setup.
    • setSetup

      public void setSetup(DeviceMgtSetup configuration)
      Sets the configuration, only used in testing. [public for testing]
      Parameters:
      configuration - the configuration
    • getSetup

      public DeviceMgtSetup getSetup()
      Returns the setup instance.
      Returns:
      the setup instance, null if none was loaded/none is available