Class V2Session
- All Implemented Interfaces:
Closeable,AutoCloseable,CTISession
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected net.zamasoft.zstream.io.FragmentedOutputprotected final Stringprotected MessageHandlerprotected final Stringprotected V2ContentProducerprotected ProgressListenerprotected V2RequestConsumerprotected net.zamasoft.zstream.resolver.SourceResolverprotected Resultsprotected intprotected final URIprotected final StringFields inherited from interface jp.cssj.cti2.CTISession
ABORT_FORCE, ABORT_NORMAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort(byte mode) Aborts conversion.protected booleanvoidclose()Closes the session.getServerInfo(URI uri) Returns server information.protected voidinit()voidjoin()With setContinues(true) set, combines and outputs the results of multiple transcode calls.protected voidnext()voidSets a property.voidreset()Clears all sent resources and all settings, including properties and the message handler, and restores the initial state the session had when it was created.voidresource(net.zamasoft.zstream.resolver.Source source) Sends a resource.resource(net.zamasoft.zstream.resolver.SourceMetadata metaSource) Returns an output stream for sending a resource.voidsendResource(net.zamasoft.zstream.resolver.Source source) voidsetContinuous(boolean continuous) Switches to a mode that combines multiple results.voidSets the object that receives messages.voidSets the object that monitors progress.voidsetResults(Results results) Sets the output destination.voidsetSourceResolver(net.zamasoft.zstream.resolver.SourceResolver resolver) Sets the object that loads resources.voidRetrieves and converts the main document by accessing the specified address from the server.voidtranscode(net.zamasoft.zstream.resolver.Source source) Retrieves the main document from a data source and converts it.transcode(net.zamasoft.zstream.resolver.SourceMetadata metaSource) Returns an output stream for sending the main document.Methods inherited from class jp.cssj.cti2.helpers.AbstractCTISession
finalize
-
Field Details
-
BUFFER_SIZE
public static final int BUFFER_SIZE- See Also:
-
encoding
-
uri
-
user
-
password
-
producer
-
request
-
results
-
resolver
protected net.zamasoft.zstream.resolver.SourceResolver resolver -
messageHandler
-
progressListener
-
state
protected volatile int state -
builder
protected net.zamasoft.zstream.io.FragmentedOutput builder
-
-
Constructor Details
-
V2Session
- Throws:
IOException
-
-
Method Details
-
init
- Throws:
IOException
-
getServerInfo
Description copied from interface:CTISessionReturns server information. For details, see the Copper PDF documentation.- Specified by:
getServerInfoin interfaceCTISession- Parameters:
uri- The URI that selects the server information.- Returns:
- A stream of server information data.
- Throws:
IOException
-
setResults
Description copied from interface:CTISessionSets the output destination.
You must call this method before any transcode method.
- Specified by:
setResultsin interfaceCTISession- Parameters:
results- The output destination.- Throws:
IOException
-
setMessageHandler
Description copied from interface:CTISessionSets the object that receives messages.
You must call this method before any transcode method.
- Specified by:
setMessageHandlerin interfaceCTISession- Parameters:
eh- The message handler- See Also:
-
setProgressListener
Description copied from interface:CTISessionSets the object that monitors progress.
You must call this method before any transcode method.
- Specified by:
setProgressListenerin interfaceCTISession- Parameters:
l- The progress listener- See Also:
-
property
Description copied from interface:CTISessionSets a property.
You must call this method before any transcode method.
- Specified by:
propertyin interfaceCTISession- Parameters:
key- The property namevalue- The value- Throws:
IOException
-
resource
public OutputStream resource(net.zamasoft.zstream.resolver.SourceMetadata metaSource) throws IOException Description copied from interface:CTISessionReturns an output stream for sending a resource.
Always close the output stream after sending the resource.
You must call this method before any transcode method.
- Specified by:
resourcein interfaceCTISession- Returns:
- An output stream to the server.
- Throws:
IOException
-
resource
Description copied from interface:CTISessionSends a resource.
You must call this method before any transcode method.
- Specified by:
resourcein interfaceCTISession- Parameters:
source- The data source for the resource.- Throws:
IOException
-
buildNext
- Throws:
IOExceptionTranscoderException
-
transcode
public OutputStream transcode(net.zamasoft.zstream.resolver.SourceMetadata metaSource) throws IOException, TranscoderException Description copied from interface:CTISessionReturns an output stream for sending the main document.
Always close the output stream after sending the document body.
- Specified by:
transcodein interfaceCTISession- Returns:
- An output stream to the server.
- Throws:
IOExceptionTranscoderException
-
transcode
Description copied from interface:CTISessionRetrieves and converts the main document by accessing the specified address from the server. This also works with resources you previously sent using the resource method.
- Specified by:
transcodein interfaceCTISession- Parameters:
uri- The URI of the main document.- Throws:
IOExceptionTranscoderException
-
transcode
public void transcode(net.zamasoft.zstream.resolver.Source source) throws IOException, TranscoderException Description copied from interface:CTISessionRetrieves the main document from a data source and converts it.
- Specified by:
transcodein interfaceCTISession- Parameters:
source- The data source for the main document.- Throws:
IOExceptionTranscoderException
-
next
- Throws:
IOException
-
setContinuous
Description copied from interface:CTISessionSwitches to a mode that combines multiple results.
- Specified by:
setContinuousin interfaceCTISession- Parameters:
continuous- If true, enables the mode that combines results using join.- Throws:
IOException
-
join
Description copied from interface:CTISessionWith setContinues(true) set, combines and outputs the results of multiple transcode calls.
- Specified by:
joinin interfaceCTISession- Throws:
IOException
-
setSourceResolver
public void setSourceResolver(net.zamasoft.zstream.resolver.SourceResolver resolver) throws IOException Description copied from interface:CTISessionSets the object that loads resources.
- Specified by:
setSourceResolverin interfaceCTISession- Parameters:
resolver- The SourceResolver that retrieves resources requested by the server.- Throws:
IOException
-
sendResource
- Throws:
IOException
-
abort
Description copied from interface:CTISessionAborts conversion. You must call this method asynchronously (from another thread). When processing actually stops, the thread performing the conversion (the one that called transcode) throws a TranscoderException.
- Specified by:
abortin interfaceCTISession- Parameters:
mode- Specify ABORT_NORMAL to output up to a suitable stopping point, or ABORT_FORCE to forcibly stop processing.- Throws:
IOException
-
reset
Description copied from interface:CTISessionClears all sent resources and all settings, including properties and the message handler, and restores the initial state the session had when it was created.
- Specified by:
resetin interfaceCTISession- Throws:
IOException
-
close
Description copied from interface:CTISessionCloses the session.
You cannot perform any operations on the session after calling this method.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceCTISession- Throws:
IOException
-