Top Description Methods
org.h2.store

public Interface DataHandler

Known Direct Implementers
org.h2.tools.Recover, org.h2.engine.Database, org.h2.engine.SessionRemote
Imports
org.h2.message.DbException, org.h2.util.SmallLRUCache, .TempFileDeleter, org.h2.value.CompareMode

A data handler contains a number of callback methods, mostly related to CLOB and BLOB handling. The most important implementing class is a database.

Method Summary

Modifier and TypeMethod and Description
public void
checkPowerOff()

Check if the simulated power failure occurred.

public void
checkWritingAllowed()

Check if writing is allowed.

public CompareMode

Returns:

Compare mode.
getCompareMode
()

Return compare mode.

public String

Returns:

the database path
getDatabasePath
()

Get the database path.

public SmallLRUCache<String, String[]>

Returns:

the cache or null
getLobFileListCache
()

Get the lob file list cache if it is used.

public LobStorageInterface

Returns:

the lob storage mechanism
getLobStorage
()

Get the lob storage mechanism to use.

public Object

Returns:

the synchronization object
getLobSyncObject
()

Get the synchronization object for lob operations.

public int

Returns:

the maximum size
getMaxLengthInplaceLob
()

Get the maximum length of a in-place large object

public TempFileDeleter

Returns:

the temp file deleter
getTempFileDeleter
()

Get the temp file deleter mechanism.

public FileStore

Returns:

the file
openFile
(String
the file name
name
,
String
the mode
mode
,
boolean
whether the file must already exist
mustExist
)

Open a file at the given location.

public int

Returns:

the number of bytes read
readLob
(long
the lob id
lobId
,
byte[]
the message authentication code
hmac
,
long
the offset within the lob
offset
,
byte[]
the target buffer
buff
,
int
the offset within the target buffer
off
,
int
the number of bytes to read
length
)

Read from a lob.

Method Detail

checkPowerOffback to summary
public void checkPowerOff() throws DbException

Check if the simulated power failure occurred. This call will decrement the countdown.

Exceptions
DbException:
if the simulated power failure occurred
checkWritingAllowedback to summary
public void checkWritingAllowed() throws DbException

Check if writing is allowed.

Exceptions
DbException:
if it is not allowed
getCompareModeback to summary
public CompareMode getCompareMode()

Return compare mode.

Returns:CompareMode

Compare mode.

getDatabasePathback to summary
public String getDatabasePath()

Get the database path.

Returns:String

the database path

getLobFileListCacheback to summary
public SmallLRUCache<String, String[]> getLobFileListCache()

Get the lob file list cache if it is used.

Returns:SmallLRUCache<String, String[]>

the cache or null

getLobStorageback to summary
public LobStorageInterface getLobStorage()

Get the lob storage mechanism to use.

Returns:LobStorageInterface

the lob storage mechanism

getLobSyncObjectback to summary
public Object getLobSyncObject()

Get the synchronization object for lob operations.

Returns:Object

the synchronization object

getMaxLengthInplaceLobback to summary
public int getMaxLengthInplaceLob()

Get the maximum length of a in-place large object

Returns:int

the maximum size

getTempFileDeleterback to summary
public TempFileDeleter getTempFileDeleter()

Get the temp file deleter mechanism.

Returns:TempFileDeleter

the temp file deleter

openFileback to summary
public FileStore openFile(String name, String mode, boolean mustExist)

Open a file at the given location.

Parameters
name:String

the file name

mode:String

the mode

mustExist:boolean

whether the file must already exist

Returns:FileStore

the file

readLobback to summary
public int readLob(long lobId, byte[] hmac, long offset, byte[] buff, int off, int length)

Read from a lob.

Parameters
lobId:long

the lob id

hmac:byte[]

the message authentication code

offset:long

the offset within the lob

buff:byte[]

the target buffer

off:int

the offset within the target buffer

length:int

the number of bytes to read

Returns:int

the number of bytes read