Class StorageLocationMapping

java.lang.Object
com.broadleafcommerce.asset.domain.StorageLocationMapping
All Implemented Interfaces:
Serializable

public class StorageLocationMapping extends Object implements Serializable

Certain StorageProvider implementations may store data at a different location than the original path/'URL' provided to them. This entity can be used by those providers to keep track of the mappings between the original location and the real path/location used to store binary data. Each mapping record corresponds to one file.

As mentioned above, this entity is expected to be managed/used internally by the system and is not intended to be exposed to outside callers.

See Also:
  • Constructor Details

    • StorageLocationMapping

      public StorageLocationMapping()
  • Method Details

    • getId

      public String getId()
      Unique identifier for this record.
    • getStorageProviderType

      public String getStorageProviderType()
      Each StorageProvider implementation should correspond to a different type value here. There is currently no support for any more than one active StorageProvider implementation at a time, but tracking which provider this mapping is for may be useful in the event of a migration (or auditing in general).
    • getOriginalLocation

      public String getOriginalLocation()

      The original location that a caller gave to the StorageProvider to associate with the binary data. Typically, this is a 'URL' value obtained by prepending context-specific information to the Asset.getUrl(), as done in AssetStorageUtils.getContextAwareUrl(Asset, ContextInfo).

      This is the value callers will give to the StorageProvider to store/read/delete the resource.

      This is already expected to be globally unique, but for correctness, queries should be done against a combination of getOriginalLocation() and getStorageProviderType().

    • getStorageProviderLocation

      public String getStorageProviderLocation()

      The actual location within the StorageProvider backing datastore that holds the binary data of the file.

      The contained value here may look different depending on the StorageProvider. For example, in the case of FilesystemStorageProvider, this will just be another file path. In other cases, it may be a cloud object identifier, or something else. Ultimately, it should be something that the StorageProvider can use to reliably resolve/manage the file.

    • setId

      public void setId(String id)
      Unique identifier for this record.
    • setStorageProviderType

      public void setStorageProviderType(String storageProviderType)
      Each StorageProvider implementation should correspond to a different type value here. There is currently no support for any more than one active StorageProvider implementation at a time, but tracking which provider this mapping is for may be useful in the event of a migration (or auditing in general).
    • setOriginalLocation

      public void setOriginalLocation(String originalLocation)

      The original location that a caller gave to the StorageProvider to associate with the binary data. Typically, this is a 'URL' value obtained by prepending context-specific information to the Asset.getUrl(), as done in AssetStorageUtils.getContextAwareUrl(Asset, ContextInfo).

      This is the value callers will give to the StorageProvider to store/read/delete the resource.

      This is already expected to be globally unique, but for correctness, queries should be done against a combination of getOriginalLocation() and getStorageProviderType().

    • setStorageProviderLocation

      public void setStorageProviderLocation(String storageProviderLocation)

      The actual location within the StorageProvider backing datastore that holds the binary data of the file.

      The contained value here may look different depending on the StorageProvider. For example, in the case of FilesystemStorageProvider, this will just be another file path. In other cases, it may be a cloud object identifier, or something else. Ultimately, it should be something that the StorageProvider can use to reliably resolve/manage the file.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object