@Transactional(readOnly=true) public class RawFileBean extends AbstractStatefulBean implements RawFileStore
iQuery, iUpdate, modified, sec| Constructor and Description |
|---|
RawFileBean()
default constructor
|
RawFileBean(boolean checking)
overridden to allow Spring to set boolean
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
Completely restore this service for active use from whatever
passivation it has implemented.
|
void |
clean() |
void |
close()
signals the end of the service lifecycle.
|
boolean |
exists()
Checks to see if a raw file exists with the file ID that the service was
initialized with.
|
Long |
getFileId()
Returns the current file id or null if none has been set.
|
Class<? extends ServiceInterface> |
getServiceInterface() |
boolean |
isDiskSpaceChecking()
getter disk overflow checking
|
protected boolean |
isModified()
Extends the check of the
AbstractStatefulBean.modified flag performed by super
with an additional check of the actual file size against the value
stored in the database |
void |
passivate()
Perform whatever passivation is possible or throw an exception.
|
byte[] |
read(long position,
int length)
Reads
length bytes of data at the position from the raw
file into an array of bytes |
OriginalFile |
save()
Saves the
OriginalFile associated with the service if it has
been modified. |
void |
setAdminService(IAdmin admin) |
void |
setChecksumProviderFactory(ChecksumProviderFactory checksumProviderFactory)
ChecksumProviderFactory Bean injector
|
void |
setDiskSpaceChecking(boolean diskSpaceChecking)
setter disk overflow checking
|
void |
setFileId(long fileId)
This method manages the state of the service.
|
void |
setFileIdWithBuffer(long fileId,
FileBuffer buffer) |
void |
setIRepositoryInfo(IRepositoryInfo iRepositoryInfo)
Disk Space Usage service Bean injector
|
void |
setOriginalFilesService(OriginalFilesService ioService)
I/O service (OriginalFilesService) Bean injector.
|
long |
size()
Returns the size of the file on disk (not as stored in the database since
that value will only be updated on
RawFileStore.save(). |
boolean |
truncate(long length)
Limits the size of a file to the given length.
|
void |
write(byte[] buf,
long position,
int length)
Writes
length bytes of data from the specified buf byte
array starting at at position to the raw file |
getBeanHelper, getCurrentEventContext, modified, selfConfigure, setQueryService, setSecuritySystem, setUpdateServiceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCurrentEventContextpublic RawFileBean()
public RawFileBean(boolean checking)
checking - public Class<? extends ServiceInterface> getServiceInterface()
getServiceInterface in interface SelfConfigurableServicepublic final void setOriginalFilesService(OriginalFilesService ioService)
ioService - an OriginalFileService.public final void setIRepositoryInfo(IRepositoryInfo iRepositoryInfo)
iRepositoryInfo - an IRepositoryInfopublic final void setAdminService(IAdmin admin)
public final void setChecksumProviderFactory(ChecksumProviderFactory checksumProviderFactory)
checksumProviderFactory - a ChecksumProviderFactory@Transactional(readOnly=true) public void passivate()
StatefulServiceInterfacepassivate in interface StatefulServiceInterface@Transactional(readOnly=true) public void activate()
StatefulServiceInterfaceactivate in interface StatefulServiceInterfaceprotected boolean isModified()
AbstractStatefulBean.modified flag performed by super
with an additional check of the actual file size against the value
stored in the databaseisModified in class AbstractStatefulBean@Transactional(readOnly=false) public OriginalFile save()
RawFileStoreOriginalFile associated with the service if it has
been modified. The returned valued should replace all instances of the
OriginalFile in the client.
If save has not been called, RawFileStore instances will save the
OriginalFile object associated with it on StatefulServiceInterface.close().save in interface RawFileStore@Transactional(readOnly=false) public void close()
StatefulServiceInterfaceclose in interface StatefulServiceInterfacepublic void clean()
@Transactional(readOnly=true) public Long getFileId()
RawFileStoregetFileId in interface RawFileStore@Transactional(readOnly=true) public void setFileId(long fileId)
RawFileStoreSecurityViolation.setFileId in interface RawFileStorefileId - an OriginalFile id.public void setFileIdWithBuffer(long fileId,
FileBuffer buffer)
public boolean exists()
RawFileStoreexists in interface RawFileStoretrue if there is an accessible file within the
original file repository with the correct ID. Otherwise
false.public byte[] read(long position,
int length)
RawFileStorelength bytes of data at the position from the raw
file into an array of bytesread in interface RawFileStorepublic boolean truncate(long length)
RawFileStoretruncate in interface RawFileStorepublic long size()
RawFileStoreRawFileStore.save(). If the file has not
yet been written to, and therefore does not exist, a
ResourceError will be thrown.size in interface RawFileStorepublic void write(byte[] buf,
long position,
int length)
RawFileStorelength bytes of data from the specified buf byte
array starting at at position to the raw filewrite in interface RawFileStorepublic boolean isDiskSpaceChecking()
public void setDiskSpaceChecking(boolean diskSpaceChecking)
diskSpaceChecking - a boolean
Version: 5.3.4-ice35-b69
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.