Interface PriintStorageServiceLocal


public interface PriintStorageServiceLocal
Local interface for managing storage operations in the Priint system.
  • Method Details

    • getPriintStorage

      com.priint.storage.PriintStorage getPriintStorage()
      Retrieves the primary Priint storage instance.
      Returns:
      the PriintStorage instance.
    • getDocumentObjectType

      Optional<com.priint.storage.DocumentObjectType> getDocumentObjectType(com.priint.storage.StorageContext storageContext, String documentId, boolean isDocumentTemplate)
      Retrieves the document object type based on the provided context and document ID.
      Parameters:
      storageContext - the context of the storage operation.
      documentId - the ID of the document.
      isDocumentTemplate - true if the document is a template, false otherwise.
      Returns:
      an Optional containing the DocumentObjectType if found, or empty otherwise.
    • duplicateDocument

      void duplicateDocument(com.priint.storage.DocumentDescriptor sourceDocumentDescriptor, com.priint.storage.DocumentDescriptor destinationDocumentDescriptor)
      Duplicates a document from a source descriptor to a destination descriptor.
      Parameters:
      sourceDocumentDescriptor - the descriptor of the source document.
      destinationDocumentDescriptor - the descriptor of the destination document.
    • uploadMediaAsset

      void uploadMediaAsset(File sourceFile, String tenant, String destinationPath, String destinationFileName)
      Uploads a media asset to the storage using a source file.
      Parameters:
      sourceFile - the source file to upload.
      tenant - the tenant owning the media asset.
      destinationPath - the destination path for the media asset.
      destinationFileName - the name of the file at the destination.
    • uploadMediaAsset

      void uploadMediaAsset(InputStream sourceStream, String tenant, String destinationPath, String destinationFileName)
      Uploads a media asset to the storage using an input stream.
      Parameters:
      sourceStream - the input stream of the source data.
      tenant - the tenant owning the media asset.
      destinationPath - the destination path for the media asset.
      destinationFileName - the name of the file at the destination.
    • uploadMediaAsset

      void uploadMediaAsset(byte[] sourceData, String tenant, String destinationPath, String destinationFileName)
      Uploads a media asset to the storage using a byte array.
      Parameters:
      sourceData - the byte array containing the source data.
      tenant - the tenant owning the media asset.
      destinationPath - the destination path for the media asset.
      destinationFileName - the name of the file at the destination.
    • listMediaAssets

      com.priint.objectstorage.FileListing listMediaAssets(String tenant, String path)
      Lists the media assets in a specific path for a tenant.
      Parameters:
      tenant - the tenant owning the media assets.
      path - the path to list the media assets.
      Returns:
      a FileListing containing the list of media assets.
    • downloadMediaAssetStream

      InputStream downloadMediaAssetStream(String tenant, String path, String fileName)
      Downloads a media asset as an input stream.
      Parameters:
      tenant - the tenant owning the media asset.
      path - the path to the media asset.
      fileName - the name of the file to download.
      Returns:
      an InputStream for the media asset.
    • downloadMediaAssetData

      byte[] downloadMediaAssetData(String tenant, String path, String fileName)
      Downloads a media asset as a byte array.
      Parameters:
      tenant - the tenant owning the media asset.
      path - the path to the media asset.
      fileName - the name of the file to download.
      Returns:
      a byte array containing the media asset data.
    • deleteMediaAsset

      void deleteMediaAsset(String tenant, String path, String fileName)
      Deletes a media asset from the storage.
      Parameters:
      tenant - the tenant owning the media asset.
      path - the path to the media asset.
      fileName - the name of the file to delete.
    • getConfiguredMaxUploadAttempts

      int getConfiguredMaxUploadAttempts()
      This returns configured number of upload attempts that should occur if file upload fails. It is always a positive, non-zero integer value that you can pass in UploadOptions when uploading a file through PriintStorage.
      Returns:
      a configured non-zero max number of upload attempts to take when uploading a file. 1 otherwise.