Package org.h2.store
Class LobStorageFrontend
- java.lang.Object
-
- org.h2.store.LobStorageFrontend
-
- All Implemented Interfaces:
LobStorageInterface
public class LobStorageFrontend extends java.lang.Object implements LobStorageInterface
This factory creates in-memory objects and temporary files. It is used on the client side.
-
-
Field Summary
Fields Modifier and Type Field Description private SessionRemotesessionRemotestatic intTABLE_ID_SESSION_VARIABLEThe table id for session variables (LOBs not assigned to a table).static intTABLE_RESULTThe table id for result sets.static intTABLE_TEMPThe table id for temporary objects (not assigned to any object).
-
Constructor Summary
Constructors Constructor Description LobStorageFrontend(SessionRemote handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueLobcopyLob(ValueLob old, int tableId)Copy a lob.ValueBlobcreateBlob(java.io.InputStream in, long maxLength)Create a BLOB object.ValueClobcreateClob(java.io.Reader reader, long maxLength)Create a CLOB object.java.io.InputStreamgetInputStream(long lobId, int tableId, long byteCount)Get the input stream for the given lobjava.io.InputStreamgetInputStream(long lobId, long byteCount)Get the input stream for the given lob, only called on server side of a TCP connection.booleanisReadOnly()Whether the storage is read-onlyvoidremoveAllForTable(int tableId)Remove all LOBs for this table.voidremoveLob(ValueLob lob)Delete a LOB (from the database, if it is stored there).
-
-
-
Field Detail
-
TABLE_ID_SESSION_VARIABLE
public static final int TABLE_ID_SESSION_VARIABLE
The table id for session variables (LOBs not assigned to a table).- See Also:
- Constant Field Values
-
TABLE_TEMP
public static final int TABLE_TEMP
The table id for temporary objects (not assigned to any object).- See Also:
- Constant Field Values
-
TABLE_RESULT
public static final int TABLE_RESULT
The table id for result sets.- See Also:
- Constant Field Values
-
sessionRemote
private final SessionRemote sessionRemote
-
-
Constructor Detail
-
LobStorageFrontend
public LobStorageFrontend(SessionRemote handler)
-
-
Method Detail
-
removeLob
public void removeLob(ValueLob lob)
Description copied from interface:LobStorageInterfaceDelete a LOB (from the database, if it is stored there).- Specified by:
removeLobin interfaceLobStorageInterface- Parameters:
lob- the lob
-
getInputStream
public java.io.InputStream getInputStream(long lobId, long byteCount) throws java.io.IOExceptionDescription copied from interface:LobStorageInterfaceGet the input stream for the given lob, only called on server side of a TCP connection.- Specified by:
getInputStreamin interfaceLobStorageInterface- Parameters:
lobId- the lob idbyteCount- the number of bytes to read, or -1 if not known- Returns:
- the stream
- Throws:
java.io.IOException- on failure
-
getInputStream
public java.io.InputStream getInputStream(long lobId, int tableId, long byteCount) throws java.io.IOExceptionDescription copied from interface:LobStorageInterfaceGet the input stream for the given lob- Specified by:
getInputStreamin interfaceLobStorageInterface- Parameters:
lobId- the lob idtableId- the able idbyteCount- the number of bytes to read, or -1 if not known- Returns:
- the stream
- Throws:
java.io.IOException- on failure
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:LobStorageInterfaceWhether the storage is read-only- Specified by:
isReadOnlyin interfaceLobStorageInterface- Returns:
- true if yes
-
copyLob
public ValueLob copyLob(ValueLob old, int tableId)
Description copied from interface:LobStorageInterfaceCopy a lob.- Specified by:
copyLobin interfaceLobStorageInterface- Parameters:
old- the old lobtableId- the new table id- Returns:
- the new lob
-
removeAllForTable
public void removeAllForTable(int tableId)
Description copied from interface:LobStorageInterfaceRemove all LOBs for this table.- Specified by:
removeAllForTablein interfaceLobStorageInterface- Parameters:
tableId- the table id
-
createBlob
public ValueBlob createBlob(java.io.InputStream in, long maxLength)
Description copied from interface:LobStorageInterfaceCreate a BLOB object.- Specified by:
createBlobin interfaceLobStorageInterface- Parameters:
in- the input streammaxLength- the maximum length (-1 if not known)- Returns:
- the LOB
-
createClob
public ValueClob createClob(java.io.Reader reader, long maxLength)
Create a CLOB object.- Specified by:
createClobin interfaceLobStorageInterface- Parameters:
reader- the readermaxLength- the maximum length (-1 if not known)- Returns:
- the LOB
-
-