Package com.saperion.rmi
Class TempBufferContentHandler
java.lang.Object
com.saperion.rmi.TempBufferContentHandler
- All Implemented Interfaces:
SerializableStreamContentHandler
,Closeable
,AutoCloseable
A
SerializableStreamContentHandler
that writes to a temporary buffer.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.saperion.rmi.SerializableStreamContentHandler
SerializableStreamContentHandler.ContentHandlers
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor that reads the following settings from saperion.properties. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
boolean
long
write
(SaRMIServerCommand command, int token, String filename, byte[] buffer, boolean isLast, int element, boolean doStreaming) Writes the content.
-
Constructor Details
-
TempBufferContentHandler
public TempBufferContentHandler()Default constructor that reads the following settings from saperion.properties.- operations.binary.tempdir = the directory to store the temporary files
- operations.binary.inmemorybytes = number of bytes to keep in memory
-
-
Method Details
-
write
public long write(SaRMIServerCommand command, int token, String filename, byte[] buffer, boolean isLast, int element, boolean doStreaming) throws IOException Description copied from interface:SerializableStreamContentHandler
Writes the content.- Specified by:
write
in interfaceSerializableStreamContentHandler
- Parameters:
command
- server command used for writingtoken
- current user tokenfilename
- name of the file that is writtenbuffer
- data to writeisLast
- whether the buffer is the last one to writeelement
- content element that is writtendoStreaming
- enable or disable streaming to the archive- Returns:
- the number that was assigned to the written element
- Throws:
IOException
- IO exception when writing
-
persisted
public boolean persisted()- Specified by:
persisted
in interfaceSerializableStreamContentHandler
- Returns:
- true if the content written to this content handler was persisted.
-
getInputStream
- Specified by:
getInputStream
in interfaceSerializableStreamContentHandler
- Returns:
- Input stream for content that was not yet persisted.
- Throws:
IOException
- IO exception when opening stream
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-