public class ThumbnailCtx extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ThumbnailCtx.NoThumbnail
Marker exception which is thrown by all methods which wish to tell
their callers that for whatever reason the desired Thumbnail is not
available, in which case the caller can use a *Direct method instead.
|
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_MIME_TYPE
Default thumbnail MIME type.
|
Constructor and Description |
---|
ThumbnailCtx(IQuery queryService,
IUpdate updateService,
IPixels pixelsService,
IRenderingSettings settingsService,
ThumbnailService thumbnailService,
OmeroContext applicationContext,
SecuritySystem securitySystem,
long userId)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Dimension |
calculateXYWidths(Pixels pixels,
int longestSide)
Calculates the ratio of the two sides of a Pixel set and returns the
X and Y widths based on the longest side maintaining aspect ratio.
|
void |
createAndPrepareMissingRenderingSettings(Set<Long> pixelsIds)
Resets a given set of Pixels rendering settings to the default
effectively creating any which do not exist.
|
Thumbnail |
createThumbnailMetadata(Pixels pixels,
Dimension dimensions)
Creates metadata for a thumbnail of a given set of pixels set and X-Y
dimensions.
|
boolean |
dirtyMetadata(long pixelsId)
Whether or not the thumbnail metadata for a given Pixels ID is dirty
(the RenderingDef has been updated since the Thumbnail was).
|
Thumbnail |
getMetadata(long pixelsId)
Retrieves the Thumbnail object for a given Pixels ID.
|
Pixels |
getPixels(long pixelsId)
Retrieves the Pixels object for a given Pixels ID.
|
RenderingDef |
getSettings(long pixelsId)
Retrieves the RenderingDef object for a given Pixels ID.
|
long |
getUserId()
Retrieves the current user ID to use for queries.
|
boolean |
hasMetadata(long pixelsId)
Whether or not thumbnail metadata is available for a given Pixels ID.
|
boolean |
hasSettings(long pixelsId)
Whether or not settings are available for a given Pixels ID.
|
boolean |
isExtendedGraphCritical(Set<Long> pixelsIds)
Whether or not we're extended graph critical for a given set of
dimension pools.
|
boolean |
isThumbnailCached(long pixelsId)
Checks to see if a thumbnail is in the on disk cache or not.
|
List<Thumbnail> |
loadAllMetadata(long pixelsId)
Retrieves all thumbnail metadata available in the database for a given
Pixels ID.
|
void |
loadAndPrepareMetadata(Set<Long> pixelsIds,
Dimension dimensions)
Bulk loads and prepares metadata for a group of pixels sets.
|
void |
loadAndPrepareMetadata(Set<Long> pixelsIds,
Dimension dimensions,
boolean createMissing)
Bulk loads and prepares metadata for a group of pixels sets.
|
void |
loadAndPrepareMetadata(Set<Long> pixelsIds,
int longestSide)
Bulk loads and prepares metadata for a group of pixels sets.
|
void |
loadAndPrepareRenderingSettings(long pixelsId,
long settingsId)
Loads and prepares a rendering settings for a Pixels ID and RenderingDef
ID.
|
void |
loadAndPrepareRenderingSettings(Set<Long> pixelsIds)
Bulk loads a set of rendering settings for a group of pixels sets and
prepares our internal data structures.
|
void |
setUserId(long userId)
Sets the user ID to use for queries.
|
public static final String DEFAULT_MIME_TYPE
public ThumbnailCtx(IQuery queryService, IUpdate updateService, IPixels pixelsService, IRenderingSettings settingsService, ThumbnailService thumbnailService, OmeroContext applicationContext, SecuritySystem securitySystem, long userId)
queryService
- OMERO query service to use.updateService
- OMERO update service to use.pixelsService
- OMERO pixels service to use.settingsService
- OMERO rendering settings service to use.thumbnailService
- OMERO thumbnail service to use.applicationContext
- OMERO application contextsecuritySystem
- OMERO security system for this session.userId
- Current user ID.public long getUserId()
public void setUserId(long userId)
userId
- The user ID to use for queries.public void loadAndPrepareRenderingSettings(Set<Long> pixelsIds)
pixelsIds
- Set of Pixels IDs to prepare rendering settings for.public void loadAndPrepareRenderingSettings(long pixelsId, long settingsId)
pixelsId
- Pixels ID to load.settingsId
- RenderingDef ID to load an prepare settings for.public void loadAndPrepareMetadata(Set<Long> pixelsIds, int longestSide)
pixelsIds
- Pixels IDs to prepare metadata for.longestSide
- The longest side of the thumbnails requested.public void loadAndPrepareMetadata(Set<Long> pixelsIds, Dimension dimensions)
pixelsIds
- Pixels IDs to prepare metadata for.dimensions
- X-Y dimensions of the thumbnails requested.public void loadAndPrepareMetadata(Set<Long> pixelsIds, Dimension dimensions, boolean createMissing)
pixelsIds
- Pixels IDs to prepare metadata for.dimensions
- X-Y dimensions of the thumbnails requested.public List<Thumbnail> loadAllMetadata(long pixelsId)
pixelsId
- Pixels ID to retrieve thumbnail metadata for.public void createAndPrepareMissingRenderingSettings(Set<Long> pixelsIds)
pixelsIds
- Pixels IDspublic boolean hasSettings(long pixelsId)
pixelsId
- Pixels ID to check for availability.true
if settings are available and
false
otherwise.public boolean hasMetadata(long pixelsId)
pixelsId
- Pixels ID to check for availability.true
if metadata is available and
false
otherwise.public Pixels getPixels(long pixelsId)
pixelsId
- Pixels ID to retrieve the Pixels object for.public RenderingDef getSettings(long pixelsId)
pixelsId
- Pixels ID to retrieve the RenderingDef object for.public Thumbnail getMetadata(long pixelsId) throws ThumbnailCtx.NoThumbnail
pixelsId
- Pixels ID to retrieve the Thumbnail object for.ThumbnailCtx.NoThumbnail
public boolean dirtyMetadata(long pixelsId)
pixelsId
- Pixels ID to check for dirty metadata.true
if the metadata is dirty false
otherwise.public boolean isThumbnailCached(long pixelsId)
pixelsId
- The Pixels set the thumbnail is for.public Dimension calculateXYWidths(Pixels pixels, int longestSide)
pixels
- The Pixels set to calculate against.longestSide
- The size of the longest side of the thumbnail
requested.public boolean isExtendedGraphCritical(Set<Long> pixelsIds)
isGraphCritical() == true
and the Pixels set does not
belong to us.
isGraphCritical() == false
, the Pixels set does not
belong to us and the group is READ-ONLY.
pixelsIds
- Set of Pixels to check if we're graph critical for.true
if we're graph critical, and
false
otherwise.public Thumbnail createThumbnailMetadata(Pixels pixels, Dimension dimensions)
pixels
- The Pixels set to create thumbnail metadata for.dimensions
- The dimensions of the thumbnail.getMetadata(long)
Version: 5.3.3-ice35-b63
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.