Interface AMImageConfigurationHelper
@ProviderType
public interface AMImageConfigurationHelper
Manages and fetches an
AMImageConfigurationEntry. This interface is
the preferred mechanism to interact with image configuration entries.-
Method Summary
Modifier and TypeMethodDescriptionaddAMImageConfigurationEntry(long companyId, String name, String description, String uuid, Map<String, String> properties) Adds a new image configuration entry.voiddeleteAMImageConfigurationEntry(long companyId, String uuid) Deletes an existing and disabled image configuration entry.voiddisableAMImageConfigurationEntry(long companyId, String uuid) Disables an existing and enabled image configuration entry.voidenableAMImageConfigurationEntry(long companyId, String uuid) Enables an existing and disabled image configuration entry.voidforceDeleteAMImageConfigurationEntry(long companyId, String uuid) Deletes an existing image configuration entry, even if it is enabled.getAMImageConfigurationEntries(long companyId) Returns a collection of the enabled image configuration entries for a company.getAMImageConfigurationEntries(long companyId, Predicate<? super AMImageConfigurationEntry> predicate) Returns a collection of image configuration entries filtered by the given predicate for a company.getAMImageConfigurationEntry(long companyId, String configurationEntryUUID) Returns an image configuration entry for the given company and image configuration entry UUID or null.updateAMImageConfigurationEntry(long companyId, String oldUuid, String name, String description, String newUuid, Map<String, String> properties) Updates an existing image configuration entry.
-
Method Details
-
addAMImageConfigurationEntry
AMImageConfigurationEntry addAMImageConfigurationEntry(long companyId, String name, String description, String uuid, Map<String, String> properties) throws com.liferay.adaptive.media.exception.AMImageConfigurationException, IOExceptionAdds a new image configuration entry.- Parameters:
companyId- the primary key of the companyname- the image configuration entry's unique namedescription- the image configuration entry's descriptionuuid- the image configuration entry's UUIDproperties- 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 entryIOException- 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 companyuuid- the image configuration entry's UUID- Throws:
com.liferay.adaptive.media.exception.AMImageConfigurationException.InvalidStateAMImageConfigurationException- if the image configuration entry to delete was not disabledIOException- if there was an issue when deleting the image configuration entry from the store
-
disableAMImageConfigurationEntry
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 companyuuid- the image configuration entry's UUID- Throws:
IOException- if there was an issue when updating the image configuration entry from the store
-
enableAMImageConfigurationEntry
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 companyuuid- the image configuration entry's UUID- Throws:
IOException- if there was an issue when updating the image configuration entry from the store
-
forceDeleteAMImageConfigurationEntry
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 companyuuid- the image configuration entry's UUID- Throws:
IOException- if there was an issue when deleting the image configuration entry from the store
-
getAMImageConfigurationEntries
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 companypredicate- 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 companyconfigurationEntryUUID- 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, IOExceptionUpdates an existing image configuration entry.- Parameters:
companyId- the primary key of the companyoldUuid- the image configuration entry's UUID to updatename- the new image configuration entry's namedescription- the new image configuration entry's descriptionnewUuid- the new image configuration entry's UUIDproperties- 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 entryIOException- if there was an issue when persisting the new image configuration entry in the store
-