org.jnetstream.capture
Interface Captures.LocalFactory

All Superinterfaces:
Captures.Factory, Captures.LiveCaptureFactory
Enclosing class:
Captures

public static interface Captures.LocalFactory
extends Captures.Factory

Factory interface for local sessions. This is a factory interface which provides access to jNetStream implementation of this API. The LocalFactory interface provides additional methods, besides the ones found in Captures.Factory, that may only be used locally on a system. You can use Captures.getLocal() method to aquire a reference to the default factory that creates all local instances of capture framework objects.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Field Summary
 
Fields inherited from interface org.jnetstream.capture.Captures.LiveCaptureFactory
LIVE_CAPTURE_FACTORY_CLASS_PROPERTY
 
Method Summary
 FormatType formatType(java.nio.channels.ReadableByteChannel in)
          Gets the type of underlying file format the input stream is in.
 FormatType.Detail formatTypeDetail(java.io.File f)
           
 FormatType.Detail formatTypeDetail(java.nio.channels.ReadableByteChannel in)
           
<T extends InputCapture<? extends FilePacket>>
T
newInput(java.lang.Class<T> t, java.io.File file, Filter<ProtocolFilterTarget> filter)
          Creates a capture session which reads from a formatted file.
<T extends InputCapture<? extends FilePacket>>
T
newInput(java.lang.Class<T> t, java.nio.channels.ReadableByteChannel in)
          Creates a capture session which reads from a formatted input stream.
<T extends InputCapture<? extends FilePacket>>
T
newInput(java.lang.Class<T> t, java.nio.channels.ReadableByteChannel in, Filter<ProtocolFilterTarget> filter)
          Creates a capture session which reads from a formatted input stream.
 InputCapture<? extends CapturePacket> newInput(java.io.File file, Filter<ProtocolFilterTarget> filter)
          Creates a capture session which reads from a formatted file.
 InputCapture<? extends CapturePacket> newInput(java.nio.channels.ReadableByteChannel in)
          Creates a capture session which reads from a formatted channel.
 InputCapture<? extends CapturePacket> newInput(java.nio.channels.ReadableByteChannel in, Filter<ProtocolFilterTarget> filter)
          Creates a capture session which reads from a formatted channel.
<T extends OutputCapture>
T
newOutput(java.lang.Class<T> t, java.nio.channels.WritableByteChannel out)
          Creates an outbound capture session that is connected to the the supplied WritableByteChannel.
 OutputCapture newOutput(FormatType type, java.io.OutputStream out)
          Creates an outbound capture session that is connected to the the supplied OutputStream.
 FileCapture<? extends FilePacket> openFile(java.io.File file, FileMode mode)
           
 
Methods inherited from interface org.jnetstream.capture.Captures.Factory
append, catFile, catFile, countPackets, formatType, newFile, newFile, newFile, newFile, openFile, openFile, openFile, openFile, registerListener, removeRegisteredListener, splitFile, splitFile, validateFile
 
Methods inherited from interface org.jnetstream.capture.Captures.LiveCaptureFactory
listCaptureDevices, newCaptureDevice, openLive, openLive, openLive, openLive, openLive, openLive, openLive, openTransmitter, openTransmitter
 

Method Detail

formatType

FormatType formatType(java.nio.channels.ReadableByteChannel in)
                      throws java.io.IOException
Gets the type of underlying file format the input stream is in. The format of the stream is expected to be in any one of the supported file formats as if the stream was simply opened with standard java FileInputStream class.

Specified by:
formatType in interface Captures.Factory
Parameters:
in - stream that has the data to read from
Returns:
read-only FileCapture instance that is used to decode the stream contents
Throws:
java.io.IOException

formatTypeDetail

FormatType.Detail formatTypeDetail(java.io.File f)
                                   throws java.io.IOException
Parameters:
f -
Returns:
Throws:
java.io.IOException

formatTypeDetail

FormatType.Detail formatTypeDetail(java.nio.channels.ReadableByteChannel in)
                                   throws java.io.IOException
Parameters:
in -
Returns:
Throws:
java.io.IOException

newInput

InputCapture<? extends CapturePacket> newInput(java.io.File file,
                                               Filter<ProtocolFilterTarget> filter)
                                               throws java.io.IOException
Creates a capture session which reads from a formatted file. The file has to be formatted to one of the supported file formats such as Pcap, etc. The file can be in compressed format or not.

Parameters:
t - the returned result is class t type specific
in - input stream
Returns:
stream based capture session
Throws:
java.io.IOException - any IO errors

newInput

<T extends InputCapture<? extends FilePacket>> T newInput(java.lang.Class<T> t,
                                                          java.io.File file,
                                                          Filter<ProtocolFilterTarget> filter)
                                                      throws java.io.IOException
Creates a capture session which reads from a formatted file. The file has to be formatted to one of the supported file formats such as Pcap, etc. The file can be in compressed format or not.

Parameters:
t - the returned result is class t type specific
in - input stream
Returns:
stream based capture session
Throws:
java.io.IOException - any IO errors

newInput

<T extends InputCapture<? extends FilePacket>> T newInput(java.lang.Class<T> t,
                                                          java.nio.channels.ReadableByteChannel in)
                                                      throws java.io.IOException
Creates a capture session which reads from a formatted input stream. The stream has to be formatted to one of the supported file formats such as Pcap, etc. The stream based capture session is always read-only, as input stream is read-only as well.

Parameters:
t - the returned result is class t type specific
in - input stream
Returns:
stream based capture session
Throws:
java.io.IOException - any IO errors

newInput

<T extends InputCapture<? extends FilePacket>> T newInput(java.lang.Class<T> t,
                                                          java.nio.channels.ReadableByteChannel in,
                                                          Filter<ProtocolFilterTarget> filter)
                                                      throws java.io.IOException
Creates a capture session which reads from a formatted input stream. The stream has to be formatted to one of the supported file formats such as Pcap, etc. The stream based capture session is always read-only, as input stream is read-only as well.

Parameters:
t - the returned result is class t type specific
in - input stream
filter - default packet filter
Returns:
stream based capture session
Throws:
java.io.IOException - any IO errors

newInput

InputCapture<? extends CapturePacket> newInput(java.nio.channels.ReadableByteChannel in)
                                               throws java.io.IOException
Creates a capture session which reads from a formatted channel. The stream has to be formatted to one of the supported file formats such as Pcap, etc. The stream based capture session is always read-only, as input stream is read-only as well.

Parameters:
in - input stream
Returns:
stream based capture session
Throws:
java.io.IOException - any IO errors

newInput

InputCapture<? extends CapturePacket> newInput(java.nio.channels.ReadableByteChannel in,
                                               Filter<ProtocolFilterTarget> filter)
                                               throws java.io.IOException
Creates a capture session which reads from a formatted channel. The stream has to be formatted to one of the supported file formats such as Pcap, etc. The stream based capture session is always read-only, as input stream is read-only as well.

Parameters:
in - input stream
filter - a filter to filter certain elements from the stream
Returns:
stream based capture session
Throws:
java.io.IOException - any IO errors

newOutput

<T extends OutputCapture> T newOutput(java.lang.Class<T> t,
                                      java.nio.channels.WritableByteChannel out)
                                  throws java.io.IOException
Creates an outbound capture session that is connected to the the supplied WritableByteChannel.

Parameters:
t - format type to format the data into
out - output stream to where to send the serialized formatted byte stream
Returns:
output capture session
Throws:
java.io.IOException - any IO errors

newOutput

OutputCapture newOutput(FormatType type,
                        java.io.OutputStream out)
                        throws java.io.IOException
Creates an outbound capture session that is connected to the the supplied OutputStream.

Parameters:
type - format type to format the data into
out - output stream to where to send the serialized formatted byte stream
Returns:
output capture session
Throws:
java.io.IOException - any IO errors

openFile

FileCapture<? extends FilePacket> openFile(java.io.File file,
                                           FileMode mode)
                                           throws FileFormatException,
                                                  java.io.IOException
Parameters:
file -
mode -
Returns:
Throws:
java.io.IOException
FileFormatException