org.jnetstream.capture.file
Enum FileOptions.FileProperty

java.lang.Object
  extended by java.lang.Enum<FileOptions.FileProperty>
      extended by org.jnetstream.capture.file.FileOptions.FileProperty
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FileOptions.FileProperty>
Enclosing interface:
FileOptions

public static enum FileOptions.FileProperty
extends java.lang.Enum<FileOptions.FileProperty>

Various properties that can be applied to capture files.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Enum Constant Summary
SharedPacketMode
          This will cause a shared FilePacket to be returned by the call to IOIterator.next() and initialized as if this was a new packet.
SimulationMode
          Test/simulation mode.
 
Method Summary
static FileOptions.FileProperty valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static FileOptions.FileProperty[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SharedPacketMode

public static final FileOptions.FileProperty SharedPacketMode
This will cause a shared FilePacket to be returned by the call to IOIterator.next() and initialized as if this was a new packet. This is a more efficient way of iterating throught the capture file, but no new packet instances are created, the same packet instance is reused for each iteration and simply reinitialized. The use of SharedPacketModel avoids creation of the CapturePacket and thus saving few nanoseconds of the runtime allowing greater performance from the Capture framework (upto several million packets per second.) At these speeds even creation of a single Object has large impact on the overall performance.


SimulationMode

public static final FileOptions.FileProperty SimulationMode
Test/simulation mode. This mode only accesses the disk once to read in an initial buffer using normal algorithms and the current memory model, but from then on the buffer is reused for all operations as if it was reading from the disk. Normal position pointer is kept and updated and simulates going through a file, except the same set of packets is created and returned based on the same buffer. This model allows testing of fully in memory buffers. Depending on the size of the buffer a great many packet records can be cached this way and iterated through at full VM speeds without limitation of the disk IO. Note that methods use their own separate internal buffers for doing seek operation and will still properly seek and aquire proper position within the file, but the Capture#hasNext and Capture#next methods will continue to simulate using the cached buffer. The DeprecatedPacketIterator API should not be used as this will have unspecified effects on the file and may cause unexpected exceptions to be thrown.

Method Detail

values

public static final FileOptions.FileProperty[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(FileOptions.FileProperty c : FileOptions.FileProperty.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static FileOptions.FileProperty valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name