tcpcatcher
Class TcpCatcherPacket

java.lang.Object
  extended by tcpcatcher.TcpCatcherPacket

public class TcpCatcherPacket
extends java.lang.Object


Field Summary
 boolean bounceBack
          bounceBack : Set it to true, if you want to send back to the host this packet (usually after a modification)
 java.lang.String client
           
 long duration
          duration : Time in millisec between request and response.
static java.lang.String endofheader
           
static java.lang.String endofline
          an HTTP Header endofline
 boolean fromClient
           
 java.lang.String host
           
 java.lang.String httpContent
          httpContent : In case of an HTTP packet, this field provides the HTTP content.
 java.lang.String httpHeader
          httpHeader : In case of an HTTP packet, header is provided in this field.
 java.lang.String httpResourceName
          httpResourceName : In case of an HTTP packet, this field provides the name of the requested or served HTTP resource.
 byte[] packetbytes
          tcpPacket : An array of bytes of the TCP packet going through (and that you are invited to modify)
 int packetIndex
           
 int threadId
          threadId : The id of the thread that caught that packet
 java.lang.String unzippedContent
          unzippedContent : In case of an HTTP packet carrying a zipped content, this field provides the deflated content.
 
Constructor Summary
TcpCatcherPacket()
           
 
Method Summary
 java.lang.String Description()
          Returns a complete String description of the packet
 java.lang.String getContentType()
          Get the Http Content Type in UPPER CASE (HTML, IMAGE, etc..)
 java.lang.String getHttpContent()
          Return the Http Content of the Http packet.
 java.lang.String getHttpHeader(java.lang.String headerName)
          Get some Http header value
 java.lang.String getHttpHeaderBloc()
          Get the whole header bloc of the HTTP request
 void insert(int index, byte[] insert)
          Insert a byte array into our packet bytes
 void insertHttpHeader(java.lang.String headerName, java.lang.String headerValue)
          Insert an HTTP header (at the end of the header)
 void remove(int beginindex, int endindex)
          Remove bytes from packet
 void removeHttpHeader(java.lang.String headerName)
          Remove the HTTP header headerName
 void setHttpContent(java.lang.String newHttpContent)
          Set new Http Content to this Http packet.
 void setHttpContent(java.lang.String newHttpContent, boolean rezip)
          Set new Http Content to this Http packet.
 void setHttpHeaderBloc(java.lang.String newheaderbloc)
          Set the whole header bloc of the HTTP request
 java.lang.String summaryDescription()
          Returns a summary of the packet
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threadId

public int threadId
threadId : The id of the thread that caught that packet


packetIndex

public int packetIndex

packetbytes

public byte[] packetbytes
tcpPacket : An array of bytes of the TCP packet going through (and that you are invited to modify)


fromClient

public boolean fromClient

client

public java.lang.String client

host

public java.lang.String host

bounceBack

public boolean bounceBack
bounceBack : Set it to true, if you want to send back to the host this packet (usually after a modification)


httpHeader

public java.lang.String httpHeader
httpHeader : In case of an HTTP packet, header is provided in this field. Note that any modification on this field will be ignored.


unzippedContent

public java.lang.String unzippedContent
unzippedContent : In case of an HTTP packet carrying a zipped content, this field provides the deflated content. Note that any modification on this field will be ignored.


httpContent

public java.lang.String httpContent
httpContent : In case of an HTTP packet, this field provides the HTTP content. Note that any modification on this field will be ignored.


httpResourceName

public java.lang.String httpResourceName
httpResourceName : In case of an HTTP packet, this field provides the name of the requested or served HTTP resource.


duration

public long duration
duration : Time in millisec between request and response. (Equals zero in case of a request.)


endofline

public static final java.lang.String endofline
an HTTP Header endofline

See Also:
Constant Field Values

endofheader

public static final java.lang.String endofheader
See Also:
Constant Field Values
Constructor Detail

TcpCatcherPacket

public TcpCatcherPacket()
Method Detail

getHttpContent

public java.lang.String getHttpContent()
Return the Http Content of the Http packet.

Returns:
Return the Http Content of the Http packet.

summaryDescription

public java.lang.String summaryDescription()
Returns a summary of the packet


Description

public java.lang.String Description()
Returns a complete String description of the packet


removeHttpHeader

public void removeHttpHeader(java.lang.String headerName)
Remove the HTTP header headerName


insertHttpHeader

public void insertHttpHeader(java.lang.String headerName,
                             java.lang.String headerValue)
Insert an HTTP header (at the end of the header)

Parameters:
headerName -
headerValue -

remove

public void remove(int beginindex,
                   int endindex)
Remove bytes from packet

Parameters:
beginindex - (remove from beginindex included)
endindex - (remove to endindex included)

insert

public void insert(int index,
                   byte[] insert)
Insert a byte array into our packet bytes

Parameters:
index -
insert -

setHttpContent

public void setHttpContent(java.lang.String newHttpContent)
Set new Http Content to this Http packet. By default, zipped packet will not be zipped again after modification.

Parameters:
newHttpContent - : A string carriying the new http content

setHttpContent

public void setHttpContent(java.lang.String newHttpContent,
                           boolean rezip)
Set new Http Content to this Http packet.

Parameters:
newHttpContent - : A string carriying the new http content
rezip - : In case of a zipped http packet, indicates if Tcpcatcher should rezip the packet after content modification

getHttpHeaderBloc

public java.lang.String getHttpHeaderBloc()
Get the whole header bloc of the HTTP request

Returns:
the httpheader

setHttpHeaderBloc

public void setHttpHeaderBloc(java.lang.String newheaderbloc)
Set the whole header bloc of the HTTP request

Parameters:
newheaderbloc - : the new header

getHttpHeader

public java.lang.String getHttpHeader(java.lang.String headerName)
Get some Http header value

Parameters:
headerName -
Returns:
the header value

getContentType

public java.lang.String getContentType()
Get the Http Content Type in UPPER CASE (HTML, IMAGE, etc..)

Returns:
the content type