@Service(value="imageManager") public class FileSystemCachingImageManager extends Object implements ImageManager
Constructor and Description |
---|
FileSystemCachingImageManager()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
defaultImageChanged(String typeName,
String providerIdentifier)
Inform the image manager that the default image of the given provider changed.
|
Image |
getImage(String typeName,
ImageDescriptor descriptor)
Get an image
|
Image |
getImage(String typeName,
Map<String,? extends Object> parameters,
ImageSizeType size)
Get an image
|
Image |
getImage(String typeName,
String imageIdentifier,
ImageSizeType size)
Get an image
|
ImageSize |
getImageSize(String typeName,
ImageSizeType sizeType)
Map the size type constant to the actual size.
|
String |
getImageVersionString(String typeName,
String imageIdentifier)
Return a string which represents the version of the image.
|
void |
imageChanged(String typeName,
String providerIdentifier,
String imageIdentifier)
Inform the image manager that an image was changed.
|
void |
registerImageProvider(String imageTypeName,
ImageProvider provider)
Register an image provider which can load images for the given image type.
|
void |
registerImageType(ImageTypeDescriptor imageType)
Register an image type.
|
void |
unregisterImageProvider(String imageTypeName,
ImageProvider provider)
Remove an image provider which was added for a given image type.
|
void |
unregisterImageType(ImageTypeDescriptor imageType)
Remove a previously registered image type.
|
public FileSystemCachingImageManager()
public void defaultImageChanged(String typeName, String providerIdentifier)
ImageManager
defaultImageChanged
in interface ImageManager
typeName
- the type of the image that changed. If there is no provider for the image type,
this call has no effect.providerIdentifier
- the ID of the ImageProvider
that loaded the changed image. If null, all
providers that are registered for that type are considered.public Image getImage(String typeName, ImageDescriptor descriptor) throws AuthorizationException, IOException, ImageNotFoundException
ImageManager
getImage
in interface ImageManager
typeName
- Name of the image typedescriptor
- the descriptor with image ID and details about scalingAuthorizationException
- in case the current user has no access to the imageIOException
- in case retrieving or scaling the image failedImageNotFoundException
- in case the image type is not known or there is no provider for the image type or
the provider has no image for the descriptor and a default image doesn't exist
neitherpublic Image getImage(String typeName, Map<String,? extends Object> parameters, ImageSizeType size) throws AuthorizationException, IOException, ImageNotFoundException
ImageManager
getImage
in interface ImageManager
typeName
- the name of the type of the imageparameters
- the parameters as a key to value mapping which can contain the image identifier.
The ImageTypeDescriptor identified by the typeName will be used to extract the
identifier.size
- the size type constant which will be mapped to the actual sizeAuthorizationException
- in case the current user has no access to the imageIOException
- in case retrieving or scaling the image failedImageNotFoundException
- in case the image type is not known or there is no provider for the image type or
the provider has no image for the extracted identifier and a default image
doesn't exist neitherpublic Image getImage(String typeName, String imageIdentifier, ImageSizeType size) throws AuthorizationException, IOException, ImageNotFoundException
ImageManager
getImage
in interface ImageManager
typeName
- the name of the type of the imageimageIdentifier
- the identifier of the imagesize
- the size type constant which will be mapped to the actual sizeAuthorizationException
- in case the current user has no access to the imageIOException
- in case retrieving or scaling the image failedImageNotFoundException
- in case the image type is not known or there is no provider for the image type or
the provider has no image for the identifier and a default image doesn't exist
neitherpublic ImageSize getImageSize(String typeName, ImageSizeType sizeType)
ImageManager
getImageSize
in interface ImageManager
typeName
- the name of the image typesizeType
- the size type constant to mappublic String getImageVersionString(String typeName, String imageIdentifier) throws ImageNotFoundException, AuthorizationException
ImageManager
getImageVersionString
in interface ImageManager
typeName
- Name of the image type.imageIdentifier
- identifier of the imageImageNotFoundException
- in case there is no provider for that image type or the image with the identifier
does not exist the provider has no default imageAuthorizationException
- in case the current user is not allowed to access the imagepublic void imageChanged(String typeName, String providerIdentifier, String imageIdentifier)
ImageManager
imageChanged
in interface ImageManager
typeName
- the type of the image that changed. If there is no provider for the image type,
this call has no effect.providerIdentifier
- the ID of the ImageProvider
that loaded the changed image. If null, all
providers that are registered for that type are considered.imageIdentifier
- the ID of the image that changed. If null, all images of the provider are treated
as having changed.public void registerImageProvider(String imageTypeName, ImageProvider provider) throws ImageProviderManagerException, ImageTypeNotFoundException
ImageManager
registerImageProvider
in interface ImageManager
imageTypeName
- the name of the type which must have been registered beforeprovider
- the provider to addImageProviderManagerException
- in case there is already a provider with the same identifierImageTypeNotFoundException
- in case the image type does not existpublic void registerImageType(ImageTypeDescriptor imageType)
ImageManager
registerImageType
in interface ImageManager
imageType
- the descriptor of the typepublic void unregisterImageProvider(String imageTypeName, ImageProvider provider) throws ImageProviderManagerException
ImageManager
unregisterImageProvider
in interface ImageManager
imageTypeName
- the name of the typeprovider
- the provider to removeImageProviderManagerException
- in case the provider to remove is a built-in providerpublic void unregisterImageType(ImageTypeDescriptor imageType)
ImageManager
unregisterImageType
in interface ImageManager
imageType
- the type to removeCopyright © 2019 Communote team. All rights reserved.