org.mortbay.http.ajp
Class AJP13Packet

java.lang.Object
  |
  +--org.mortbay.http.ajp.AJP13Packet
Direct Known Subclasses:
AJP13RequestPacket, AJP13ResponsePacket

public abstract class AJP13Packet
extends java.lang.Object

Version:
$Id: AJP13Packet.java,v 1.15 2003/05/24 16:53:04 gregwilkins Exp $
Author:
Greg Wilkins (gregw)

Field Summary
static int __DATA_HDR
           
static byte __END_RESPONSE
           
static byte __FORWARD_REQUEST
           
static byte __GET_BODY_CHUNK
           
static int __HDR_SIZE
           
 java.lang.String[] __header
           
static int __MAX_BUF
           
static int __MAX_DATA
           
static java.lang.String[] __method
           
static byte __SEND_BODY_CHUNK
           
static byte __SEND_HEADERS
           
static byte __SHUTDOWN
           
 
Constructor Summary
AJP13Packet(byte[] buffer)
           
AJP13Packet(byte[] buffer, int len)
           
AJP13Packet(int size)
           
 
Method Summary
 void addBoolean(boolean b)
           
 void addByte(byte b)
           
 int addBytes(byte[] buf, int offset, int length)
           
 void addHeader(java.lang.String s)
           
 void addInt(int i)
           
 void addString(java.lang.String s)
           
 void destroy()
           
 boolean getBoolean()
           
 byte[] getBuffer()
           
 int getBufferSize()
           
 byte getByte()
           
 int getBytes(byte[] buf, int offset, int length)
           
 int getDataSize()
           
 java.lang.String getHeader()
           
 int getInt()
           
 int getMark()
           
 java.lang.String getMethod()
           
 java.lang.String getString()
           
abstract  void populateHeaders()
          Abstract method to populate the header array and hash map.
 void prepare()
           
 boolean read(java.io.InputStream in)
           
 void reset()
           
 void resetData()
           
 void setDataSize()
           
 void setDataSize(int s)
           
 void setInt(int mark, int i)
           
 java.lang.String toString()
           
 java.lang.String toString(int max)
           
 int unconsumedCapacity()
           
 int unconsumedData()
           
 void write(java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__MAX_BUF

public static final int __MAX_BUF
See Also:
Constant Field Values

__HDR_SIZE

public static final int __HDR_SIZE
See Also:
Constant Field Values

__DATA_HDR

public static final int __DATA_HDR
See Also:
Constant Field Values

__MAX_DATA

public static final int __MAX_DATA
See Also:
Constant Field Values

__FORWARD_REQUEST

public static final byte __FORWARD_REQUEST
See Also:
Constant Field Values

__SHUTDOWN

public static final byte __SHUTDOWN
See Also:
Constant Field Values

__SEND_BODY_CHUNK

public static final byte __SEND_BODY_CHUNK
See Also:
Constant Field Values

__SEND_HEADERS

public static final byte __SEND_HEADERS
See Also:
Constant Field Values

__END_RESPONSE

public static final byte __END_RESPONSE
See Also:
Constant Field Values

__GET_BODY_CHUNK

public static final byte __GET_BODY_CHUNK
See Also:
Constant Field Values

__method

public static final java.lang.String[] __method

__header

public java.lang.String[] __header
Constructor Detail

AJP13Packet

public AJP13Packet(byte[] buffer,
                   int len)

AJP13Packet

public AJP13Packet(byte[] buffer)

AJP13Packet

public AJP13Packet(int size)
Method Detail

populateHeaders

public abstract void populateHeaders()
Abstract method to populate the header array and hash map.


prepare

public void prepare()

destroy

public void destroy()

reset

public void reset()

getBuffer

public byte[] getBuffer()

resetData

public void resetData()

getMark

public int getMark()

getBufferSize

public int getBufferSize()

unconsumedData

public int unconsumedData()
Returns:
Bytes of data remaining

unconsumedCapacity

public int unconsumedCapacity()
Returns:
Bytes of capacity remaining

read

public boolean read(java.io.InputStream in)
             throws java.io.IOException
java.io.IOException

write

public void write(java.io.OutputStream out)
           throws java.io.IOException
java.io.IOException

getByte

public byte getByte()

getBytes

public int getBytes(byte[] buf,
                    int offset,
                    int length)

getBoolean

public boolean getBoolean()

getInt

public int getInt()

getString

public java.lang.String getString()

getMethod

public java.lang.String getMethod()

getHeader

public java.lang.String getHeader()

addByte

public void addByte(byte b)

addBytes

public int addBytes(byte[] buf,
                    int offset,
                    int length)

addBoolean

public void addBoolean(boolean b)

addInt

public void addInt(int i)

setInt

public void setInt(int mark,
                   int i)

addString

public void addString(java.lang.String s)
               throws java.io.IOException
java.io.IOException

addHeader

public void addHeader(java.lang.String s)
               throws java.io.IOException
java.io.IOException

getDataSize

public int getDataSize()

setDataSize

public void setDataSize()

setDataSize

public void setDataSize(int s)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(int max)


Copyright ? 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.