Interface AMImageConfigurationHelper


@ProviderType public interface AMImageConfigurationHelper
Manages and fetches an AMImageConfigurationEntry. This interface is the preferred mechanism to interact with image configuration entries.
  • Method Details

    • addAMImageConfigurationEntry

      AMImageConfigurationEntry addAMImageConfigurationEntry(long companyId, String name, String description, String uuid, Map<String,String> properties) throws com.liferay.adaptive.media.exception.AMImageConfigurationException, IOException
      Adds a new image configuration entry.
      Parameters:
      companyId - the primary key of the company
      name - the image configuration entry's unique name
      description - the image configuration entry's description
      uuid - the image configuration entry's UUID
      properties - a set of properties with additional information about how the adaptive media image will be generated
      Returns:
      the image configuration entry
      Throws:
      com.liferay.adaptive.media.exception.AMImageConfigurationException - if there was an issue with the values of the new configuration entry
      IOException - if there was an issue when persisting the new image configuration entry in the store
    • deleteAMImageConfigurationEntry

      void deleteAMImageConfigurationEntry(long companyId, String uuid) throws com.liferay.adaptive.media.exception.AMImageConfigurationException.InvalidStateAMImageConfigurationException, IOException
      Deletes an existing and disabled image configuration entry. If no image configuration entry matches the specified UUID, no operation is performed.
      Parameters:
      companyId - the primary key of the company
      uuid - the image configuration entry's UUID
      Throws:
      com.liferay.adaptive.media.exception.AMImageConfigurationException.InvalidStateAMImageConfigurationException - if the image configuration entry to delete was not disabled
      IOException - if there was an issue when deleting the image configuration entry from the store
    • disableAMImageConfigurationEntry

      void disableAMImageConfigurationEntry(long companyId, String uuid) throws IOException
      Disables an existing and enabled image configuration entry. If there is no image configuration entry with the specified UUID or it is already disabled, no operation is performed.
      Parameters:
      companyId - the primary key of the company
      uuid - the image configuration entry's UUID
      Throws:
      IOException - if there was an issue when updating the image configuration entry from the store
    • enableAMImageConfigurationEntry

      void enableAMImageConfigurationEntry(long companyId, String uuid) throws IOException
      Enables an existing and disabled image configuration entry. If there is no image configuration entry with the specified UUID or it is already enabled, no operation is performed.
      Parameters:
      companyId - the primary key of the company
      uuid - the image configuration entry's UUID
      Throws:
      IOException - if there was an issue when updating the image configuration entry from the store
    • forceDeleteAMImageConfigurationEntry

      void forceDeleteAMImageConfigurationEntry(long companyId, String uuid) throws IOException
      Deletes an existing image configuration entry, even if it is enabled. This should be a last resort. If possible, an image configuration should be disabled before deleting. If there is no image configuration entry with the specified UUID, no operation is performed.
      Parameters:
      companyId - the primary key of the company
      uuid - the image configuration entry's UUID
      Throws:
      IOException - if there was an issue when deleting the image configuration entry from the store
    • getAMImageConfigurationEntries

      Collection<AMImageConfigurationEntry> getAMImageConfigurationEntries(long companyId)
      Returns a collection of the enabled image configuration entries for a company.
      Parameters:
      companyId - the primary key of the company
      Returns:
      the collection of enabled image configuration entries
    • getAMImageConfigurationEntries

      Collection<AMImageConfigurationEntry> getAMImageConfigurationEntries(long companyId, Predicate<? super AMImageConfigurationEntry> predicate)
      Returns a collection of image configuration entries filtered by the given predicate for a company.
      Parameters:
      companyId - the primary key of the company
      predicate - the predicate used to filter the collection
      Returns:
      the filtered collection of image configuration entries
    • getAMImageConfigurationEntry

      AMImageConfigurationEntry getAMImageConfigurationEntry(long companyId, String configurationEntryUUID)
      Returns an image configuration entry for the given company and image configuration entry UUID or null.
      Parameters:
      companyId - the primary key of the company
      configurationEntryUUID - the image configuration entry's UUID
      Returns:
      an image configuration entry
    • updateAMImageConfigurationEntry

      AMImageConfigurationEntry updateAMImageConfigurationEntry(long companyId, String oldUuid, String name, String description, String newUuid, Map<String,String> properties) throws com.liferay.adaptive.media.exception.AMImageConfigurationException, IOException
      Updates an existing image configuration entry.
      Parameters:
      companyId - the primary key of the company
      oldUuid - the image configuration entry's UUID to update
      name - the new image configuration entry's name
      description - the new image configuration entry's description
      newUuid - the new image configuration entry's UUID
      properties - the new set of properties with additional information about how the adaptive media image will be generated
      Returns:
      the updated image configuration entry
      Throws:
      com.liferay.adaptive.media.exception.AMImageConfigurationException - if there was an issue with the values of the new configuration entry
      IOException - if there was an issue when persisting the new image configuration entry in the store