|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.logic.AbstractLevel2Service
ome.services.ThumbnailBean
@Transactional(readOnly=true) public class ThumbnailBean
Provides methods for directly querying object graphs. The service is entirely read/write transactionally because of the requirements of rendering engine lazy object creation where rendering settings are missing.
Field Summary | |
---|---|
static float |
DEFAULT_COMPRESSION_QUALITY
The default compression quality in fractional percent. |
static String |
DEFAULT_MIME_TYPE
The default MIME type. |
static int |
DEFAULT_X_WIDTH
The default X-width for a thumbnail. |
static int |
DEFAULT_Y_WIDTH
The default Y-width for a thumbnail. |
Fields inherited from class ome.logic.AbstractLevel2Service |
---|
iQuery, iUpdate, metadata, queryFactory, sec |
Constructor Summary | |
---|---|
ThumbnailBean()
default constructor |
|
ThumbnailBean(boolean checking)
overriden to allow Spring to set boolean |
Method Summary | |
---|---|
void |
activate()
Completely restore this service for active use from whatever passivation it has implemented. |
void |
close()
signals the end of the service lifecycle. |
void |
createThumbnail(Integer sizeX,
Integer sizeY)
Creates a thumbnail for a pixels set using a given set of rendering settings (RenderingDef) in the on-disk cache. |
void |
createThumbnails()
Creates thumbnails for a pixels set using a given set of rendering settings (RenderingDef) in the on-disk cache for every sizeX/sizeY combination already cached. |
void |
createThumbnailsByLongestSideSet(Integer size,
Set<Long> pixelsIds)
Creates thumbnails for a number of pixels sets using a given set of rendering settings (RenderingDef) in the on-disk cache. |
protected void |
errorIfInvalidState()
|
protected void |
errorIfNullPixels()
|
protected void |
errorIfNullPixelsAndRenderingDef()
|
protected void |
errorIfNullRenderingDef()
|
EventContext |
getCurrentEventContext()
Returns the current EventContext for this instance. |
Class<? extends ServiceInterface> |
getServiceInterface()
|
byte[] |
getThumbnail(Integer sizeX,
Integer sizeY)
Retrieves a thumbnail for a pixels set using a given set of rendering settings (RenderingDef). |
byte[] |
getThumbnailByLongestSide(Integer size)
Retrieves a thumbnail for a pixels set using a given set of rendering settings (RenderingDef). |
byte[] |
getThumbnailByLongestSideDirect(Integer size)
Retrieves a thumbnail for a pixels set using a given set of rendering settings (RenderingDef). |
Map<Long,byte[]> |
getThumbnailByLongestSideSet(Integer size,
Set<Long> pixelsIds)
Retrieves a number of thumbnails for pixels sets using given sets of rendering settings (RenderingDef). |
byte[] |
getThumbnailDirect(Integer sizeX,
Integer sizeY)
Retrieves a thumbnail for a pixels set using a given set of rendering settings (RenderingDef). |
byte[] |
getThumbnailForSectionByLongestSideDirect(int theZ,
int theT,
Integer size)
Retrieves a thumbnail for a pixels set using a given set of rendering settings (RenderingDef) for a particular section. |
byte[] |
getThumbnailForSectionDirect(int theZ,
int theT,
Integer sizeX,
Integer sizeY)
Retrieves a thumbnail for a pixels set using a given set of rendering settings (RenderingDef) for a particular section. |
Map<Long,byte[]> |
getThumbnailSet(Integer sizeX,
Integer sizeY,
Set<Long> pixelsIds)
Retrieves a number of thumbnails for pixels sets using given sets of rendering settings (RenderingDef). |
boolean |
isDiskSpaceChecking()
|
void |
passivate()
Perform whatever passivation is possible or throw an exception. |
void |
resetDefaults()
Resets the rendering definition for the active pixels set to its default settings. |
void |
setCompressionService(LocalCompress compressionService)
Compression service Bean injector. |
void |
setDiskSpaceChecking(boolean diskSpaceChecking)
|
void |
setIoService(ThumbnailService ioService)
I/O service (ThumbnailService) Bean injector. |
void |
setIPixels(IPixels iPixels)
Pixels service Bean injector. |
void |
setIRepositoryInfo(IRepositoryInfo iRepositoryInfo)
Disk Space Usage service Bean injector |
void |
setPixelDataService(PixelsService pixelDataService)
Pixels service Bean injector. |
boolean |
setPixelsId(long id)
This method manages the state of the service; it must be invoked before using any other methods. |
void |
setRenderingDefId(long id)
This method manages the state of the service; it should be invoked directly after setPixelsId . |
void |
setScaleService(IScale iScale)
Scale service Bean injector. |
void |
setSettingsService(IRenderingSettings settingsService)
Rendering settings service Bean injector. |
boolean |
thumbnailExists(Integer sizeX,
Integer sizeY)
Checks if a thumbnail of a particular size exists for a pixels set. |
Methods inherited from class ome.logic.AbstractLevel2Service |
---|
getBeanHelper, getExtendedMetadata, getQueryFactory, getSecuritySystem, selfConfigure, setExtendedMetadata, setQueryFactory, setQueryService, setSecuritySystem, setUpdateService |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_X_WIDTH
public static final int DEFAULT_Y_WIDTH
public static final float DEFAULT_COMPRESSION_QUALITY
public static final String DEFAULT_MIME_TYPE
Constructor Detail |
---|
public ThumbnailBean()
public ThumbnailBean(boolean checking)
checking
- Method Detail |
---|
public Class<? extends ServiceInterface> getServiceInterface()
getServiceInterface
in interface SelfConfigurableService
@Transactional(readOnly=true) public void passivate()
StatefulServiceInterface
passivate
in interface StatefulServiceInterface
@Transactional(readOnly=true) public void activate()
StatefulServiceInterface
activate
in interface StatefulServiceInterface
public void close()
StatefulServiceInterface
close
in interface StatefulServiceInterface
public EventContext getCurrentEventContext()
StatefulServiceInterface
EventContext
for this instance. This is
useful for later identifying changes made by this Event
.
getCurrentEventContext
in interface StatefulServiceInterface
@Transactional(readOnly=false) public boolean setPixelsId(long id)
ThumbnailStore
ThumbnailStorerelies on the
RenderingEngine, a valid rendering definition must be available for it to work.
setPixelsId
in interface ThumbnailStore
id
- an Pixels
id.
true
if a RenderingDef
exists for the
Pixels
set, otherwise false
public void setRenderingDefId(long id)
ThumbnailStore
setPixelsId
. If it is not invoked with a valid
rendering definition ID before using the thumbnail accessor methods
execution continues as if renderingDefId were set to
null
.
setRenderingDefId
in interface ThumbnailStore
id
- an RenderingDef
id.
null
specifies the user's currently active
rendering settings to be used.public void setPixelDataService(PixelsService pixelDataService)
iPixels
- an IPixels
.public void setIPixels(IPixels iPixels)
iPixels
- an IPixels
.public void setScaleService(IScale iScale)
iScale
- an IScale
.public void setIoService(ThumbnailService ioService)
ioService
- a ThumbnailService
.public final void setIRepositoryInfo(IRepositoryInfo iRepositoryInfo)
iRepositoryInfo
- an IRepositoryInfo
public void setCompressionService(LocalCompress compressionService)
compressionService
- an ICompress
.public void setSettingsService(IRenderingSettings settingsService)
settingsService
- an IRenderingSettings
.protected void errorIfInvalidState()
protected void errorIfNullPixelsAndRenderingDef()
protected void errorIfNullPixels()
protected void errorIfNullRenderingDef()
@Transactional(readOnly=false) public void createThumbnail(Integer sizeX, Integer sizeY)
ThumbnailStore
createThumbnail
in interface ThumbnailStore
sizeX
- the X-axis width of the thumbnail. null
specifies the default size of 48.sizeY
- the Y-axis width of the thumbnail. null
specifies the default size of 48.getThumb()
,
getThumbDirect()
@Transactional(readOnly=false) public void createThumbnails()
ThumbnailStore
createThumbnails
in interface ThumbnailStore
getThumb()
,
getThumbDirect()
@Transactional(readOnly=false) public void createThumbnailsByLongestSideSet(Integer size, Set<Long> pixelsIds)
ThumbnailStore
#setPixelsId()
. This method will not
reset or modify rendering settings in any way. If rendering settings for
a pixels set are not present, thumbnail creation for that pixels set
will not be performed.
createThumbnailsByLongestSideSet
in interface ThumbnailStore
size
- the size of the longest side of the thumbnail requested.
null
specifies the default size of 48.pixelsIds
- the Pixels sets to retrieve thumbnails for.createThumbnail()
,
ThumbnailStore.createThumbnails()
@Transactional(readOnly=false) public Map<Long,byte[]> getThumbnailSet(Integer sizeX, Integer sizeY, Set<Long> pixelsIds)
ThumbnailStore
#getThumbDirect()
, placed in the on-disk cache and
returned. Unlike the other thumbnail retrieval methods, this method
may be called without first calling #setPixelsId()
.
getThumbnailSet
in interface ThumbnailStore
sizeX
- the X-axis width of the thumbnail. null
specifies the default size of 48.sizeY
- the Y-axis width of the thumbnail. null
specifies the default size of 48.pixelsIds
- the Pixels sets to retrieve thumbnails for.
Map
whose keys are pixels ids and values are JPEG
thumbnail byte buffers or null
if an exception was thrown
while attempting to retrieve the thumbnail for that particular Pixels
set.getThumbnail()
@Transactional(readOnly=false) public Map<Long,byte[]> getThumbnailByLongestSideSet(Integer size, Set<Long> pixelsIds)
ThumbnailStore
ThumbnailStore.getThumbnailByLongestSideDirect(java.lang.Integer)
. The longest
side of the image will be used to calculate the size for the smaller
side in order to keep the aspect ratio of the original image. Unlike the
other thumbnail retrieval methods, this method may be called
without first calling #setPixelsId()
.
getThumbnailByLongestSideSet
in interface ThumbnailStore
size
- the size of the longest side of the thumbnail requested.
null
specifies the default size of 48.pixelsIds
- the Pixels sets to retrieve thumbnails for.
Map
whose keys are pixels ids and values are JPEG
thumbnail byte buffers or null
if an exception was thrown
while attempting to retrieve the thumbnail for that particular Pixels
set.getThumbnailSet()
@Transactional(readOnly=false) public byte[] getThumbnail(Integer sizeX, Integer sizeY)
ThumbnailStore
#getThumbDirect()
, placed in the on-disk cache and returned.
getThumbnail
in interface ThumbnailStore
sizeX
- the X-axis width of the thumbnail. null
specifies the default size of 48.sizeY
- the Y-axis width of the thumbnail. null
specifies the default size of 48.
getThumbnailDirect()
@Transactional(readOnly=false) public byte[] getThumbnailByLongestSide(Integer size)
ThumbnailStore
#getThumbDirect()
, placed in the on-disk cache and returned. The
longest side of the image will be used to calculate the size for the
smaller side in order to keep the aspect ratio of the original image.
getThumbnailByLongestSide
in interface ThumbnailStore
size
- the size of the longest side of the thumbnail requested.
null
specifies the default size of 48.
getThumbnail()
public byte[] getThumbnailDirect(Integer sizeX, Integer sizeY)
ThumbnailStore
getThumbnailDirect
in interface ThumbnailStore
sizeX
- the X-axis width of the thumbnail. null
specifies the default size of 48.sizeY
- the Y-axis width of the thumbnail. null
specifies the default size of 48.
getThumbnail()
public byte[] getThumbnailForSectionDirect(int theZ, int theT, Integer sizeX, Integer sizeY)
ThumbnailStore
getThumbnailForSectionDirect
in interface ThumbnailStore
theZ
- the optical section (offset across the Z-axis) to use.theT
- the timepoint (offset across the T-axis) to use.sizeX
- the X-axis width of the thumbnail. null
specifies the default size of 48.sizeY
- the Y-axis width of the thumbnail. null
specifies the default size of 48.
getThumbnail()
public byte[] getThumbnailByLongestSideDirect(Integer size)
ThumbnailStore
getThumbnailByLongestSideDirect
in interface ThumbnailStore
size
- the size of the longest side of the thumbnail requested.
null
specifies the default size of 48.
getThumbnailDirect()
public byte[] getThumbnailForSectionByLongestSideDirect(int theZ, int theT, Integer size)
ThumbnailStore
getThumbnailForSectionByLongestSideDirect
in interface ThumbnailStore
theZ
- the optical section (offset across the Z-axis) to use.theT
- the timepoint (offset across the T-axis) to use.size
- the size of the longest side of the thumbnail requested.
null
specifies the default size of 48.
getThumbnailDirect()
public boolean thumbnailExists(Integer sizeX, Integer sizeY)
ThumbnailStore
thumbnailExists
in interface ThumbnailStore
sizeX
- the X-axis width of the thumbnail. null
specifies use the default size of 48.sizeY
- the Y-axis width of the thumbnail. null
specifies user the default size of 48.getThumb()
,
getThumbDirect()
@Transactional(readOnly=false) public void resetDefaults()
ThumbnailStore
resetDefaults
in interface ThumbnailStore
public boolean isDiskSpaceChecking()
public void setDiskSpaceChecking(boolean diskSpaceChecking)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta4.2.1-r8614-Beta4.2-b41
Copyright © 2009 The University of Dundee. All Rights Reserved.