|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.eyebolt.iplib.MessageHeader | +--com.eyebolt.iplib.HttpHeader
Header prepended to every ipmanager BASE message
Inner Class Summary | |
(package private) static class |
HttpHeader.HttpHeaderLine
|
(package private) static class |
HttpHeader.ParseState
|
Field Summary | |
static int |
ACCEPTED
|
static int |
BAD_GATEWAY
|
static int |
BAD_REQUEST
|
static byte[] |
byteArrayVersion
The version we emit with all replies. |
static int |
CONFLICT
|
private static byte[] |
contentLengthHdr
|
private static byte[] |
contentTypeHdr
|
private static byte[] |
contentTypeValue
|
static int |
CONTINUE
|
static int |
CREATED
|
private static boolean |
debug
|
static int |
EXPECTATION_FAILED
|
private int |
flags
|
static int |
FORBIDDEN
|
static int |
FOUND
|
static int |
GATEWAY_TIMEOUT
|
(package private) static int |
globalId
class variable for message id |
static int |
GONE
|
private boolean |
hasIpLibBody
|
private HttpHeader.HttpHeaderLine[] |
headerLines
Vector of byte arrays that are lines of HTTP header |
static int |
HTTP_VERSION_NOT_SUPPORTED
|
private static byte[] |
httpHdr
|
static int |
INTERNAL_SERVER_ERROR
|
static short |
IPLIB_HEADER_SIZE
Description of the Field |
private short |
length
|
static int |
LENGTH_REQUIRED
|
private int |
messageId
|
private int |
messageLength
|
private int |
messageResponseId
|
static int |
MOVED_PERMANENTLY
|
static java.lang.String[] |
msg_100
|
static java.lang.String[] |
msg_200
|
static java.lang.String[] |
msg_300
|
static java.lang.String[] |
msg_400
|
static java.lang.String[] |
msg_500
|
static int |
MSG_SIGNATURE
Description of the Field |
static int |
MULTIPLE_CHOICE
|
static int |
NO_CONTENT
|
static int |
NON_AUTHORITATIVE_INFORMATION
|
static int |
NOT_ACCEPTABLE
|
static int |
NOT_ALLOWED
|
static int |
NOT_EXTENDED
|
static int |
NOT_FOUND
|
static int |
NOT_IMPLEMENTED
|
static int |
NOT_MODIFIED
|
static int |
OK
|
private int |
packetSize
|
static int |
PARTIAL_CONTENT
|
static int |
PAYMENT_REQUIRED
|
static int |
PRECONDITION_FAILED
|
static int |
PROXY_AUTH_REQUIRED
|
private IPAddress |
remoteAddress
Address of the other end |
static int |
REQUEST_ENTITY_TOO_LARGE
|
static int |
REQUEST_TIMEOUT
|
static int |
REQUEST_URI_TOO_LONG
|
static int |
REQUESTED_RANGE_NOT_SATISFIABLE
|
static int |
RESET_CONTENT
|
static int |
SEE_OTHER
|
private short |
sequenceNum
|
private byte[] |
serializedHttp
|
private boolean |
serverMode
|
private short |
service
|
static int |
SERVICE_UNAVAILABLE
|
private int |
signature
|
static int |
SWITCHING
|
static int |
TEMPORARY_REDIRECT
|
static int |
UNAUTHORIZED
|
static int |
UNSUPPORTED_MEDIA_TYPE
|
static int |
USE_PROXY
|
private short |
version
|
Fields inherited from class com.eyebolt.iplib.MessageHeader |
FLAG_BEACON, FLAG_MESSAGE_ACK, FLAG_MESSAGE_CANCEL, FLAG_MESSAGE_CRC, FLAG_MESSAGE_RETRY, FLAG_PING, Flags, globalID, HdrCRC, HdrLen, MAX_SIZE, message, MSG_VERSION, MsgId, MsgLen, PktLen, SeqNum, Service, Signature, SVC_DISCONNECT, SVC_NORMAL, SVC_VERIFYCONNECTION, Version |
Constructor Summary | |
HttpHeader()
Constructor for the HttpHeader object |
|
HttpHeader(IPMessage msg)
Constructor for the HttpHeader object |
|
HttpHeader(IPMessage msg,
IPAddress remoteAddress)
Constructor for the HttpHeader object |
Method Summary | |
(package private) void |
|
(package private) static boolean |
checkHdr(byte[] buffer,
int offset,
int len)
Validate this stream of bytes as an HTTP header |
(package private) static boolean |
checkRequestHdr(byte[] buffer,
int offset,
int len)
Validate this stream of bytes as an HTTP header |
(package private) static boolean |
checkResponseHdr(byte[] buffer,
int offset,
int len)
Validate this stream of bytes as an HTTP header |
int |
flattenAt(byte[] buf)
Description of the Method |
(package private) void |
flattenHeader()
Serialize HTTP header |
(package private) int |
getId()
Fetch the message Id |
(package private) short |
getLength()
Fetch the header length |
(package private) int |
getMessageLength()
Fetch the message length |
(package private) java.lang.String |
getMethod()
Fetch the message method type |
static int |
getMinimumSize()
Gets the Size attribute of the HttpHeader class |
(package private) IPAddress |
getRemoteAddress()
Return the address of the remote machine. |
(package private) int |
getResponseId()
Fetch the message ResponseId |
(package private) short |
getServiceType()
Fetch the message service type |
int |
getSize()
Gets the Size attribute of the HttpHeader class |
(package private) java.lang.String |
getTarget()
Fetch the message target type |
(package private) boolean |
hasFlag(int flag)
Return true if a flag is set on this message header. |
(package private) void |
makeId()
Assign the header a new unique message Id |
(package private) static int |
nextItem(byte[] buf,
HttpHeader.ParseState ps)
Parse list of items, taking care of quotes and optional LWS. |
(package private) int |
parseHttpRequestHeader(byte[] buf)
Fill this header with the contents of the input buffer. |
(package private) int |
parseHttpResponseHeader(byte[] buf)
Fill this header with the contents of the input buffer. |
(package private) static int |
parseInt(byte[] buf,
HttpHeader.ParseState ps)
|
(package private) static int |
parseInt(byte[] buf,
int radix,
HttpHeader.ParseState ps)
Parse an integer, and return an updated pointer. |
(package private) void |
setFlag(int flag)
Set a flag value |
(package private) void |
setId(int id)
Sets the Id attribute of the HttpHeader object |
(package private) void |
setLength(short length)
Sets the length of the HttpHeader |
(package private) void |
setMessageLength(int length)
Sets the length of the message for which this is a header |
(package private) void |
setMethod(java.lang.String method)
Sets the method attribute of the HttpHeader object |
(package private) void |
setRemoteAddress(IPAddress address)
Set the address of the remote machine. |
(package private) void |
setResponseId(int id)
Sets the Id attribute of the HttpHeader object |
(package private) void |
setServiceType(short serviceId)
Sets the service attribute of the HttpHeader object |
(package private) void |
setTarget(java.lang.String target)
Sets the target attribute of the HttpHeader object |
(package private) static int |
skipSpaces(byte[] buf,
HttpHeader.ParseState ps)
Skip leading LWS, not including CR LF. |
java.lang.String |
toString()
Description of the Method |
(package private) int |
unFlattenFrom(byte[] buf)
Fill this header with the contents of the input buffer. |
void |
updateValues()
Recalculate header values, recompute flattened size, based on possible header changes. |
Methods inherited from class com.eyebolt.iplib.MessageHeader |
getBaseSize, getID, makeID, setID |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Field Detail |
public static final int MSG_SIGNATURE
public static final byte[] byteArrayVersion
getMajorVersion
and getMinorVersion
.public static final java.lang.String[] msg_100
public static final java.lang.String[] msg_200
public static final java.lang.String[] msg_300
public static final java.lang.String[] msg_400
public static final java.lang.String[] msg_500
public static final int CONTINUE
public static final int SWITCHING
public static final int OK
public static final int CREATED
public static final int ACCEPTED
public static final int NON_AUTHORITATIVE_INFORMATION
public static final int NO_CONTENT
public static final int RESET_CONTENT
public static final int PARTIAL_CONTENT
public static final int MULTIPLE_CHOICE
public static final int MOVED_PERMANENTLY
public static final int FOUND
public static final int SEE_OTHER
public static final int NOT_MODIFIED
public static final int USE_PROXY
public static final int TEMPORARY_REDIRECT
public static final int BAD_REQUEST
public static final int UNAUTHORIZED
public static final int PAYMENT_REQUIRED
public static final int FORBIDDEN
public static final int NOT_FOUND
public static final int NOT_ALLOWED
public static final int NOT_ACCEPTABLE
public static final int PROXY_AUTH_REQUIRED
public static final int REQUEST_TIMEOUT
public static final int CONFLICT
public static final int GONE
public static final int LENGTH_REQUIRED
public static final int PRECONDITION_FAILED
public static final int REQUEST_ENTITY_TOO_LARGE
public static final int REQUEST_URI_TOO_LONG
public static final int UNSUPPORTED_MEDIA_TYPE
public static final int REQUESTED_RANGE_NOT_SATISFIABLE
public static final int EXPECTATION_FAILED
public static final int INTERNAL_SERVER_ERROR
public static final int NOT_IMPLEMENTED
public static final int BAD_GATEWAY
public static final int SERVICE_UNAVAILABLE
public static final int GATEWAY_TIMEOUT
public static final int HTTP_VERSION_NOT_SUPPORTED
public static final int NOT_EXTENDED
public static final short IPLIB_HEADER_SIZE
private static final byte[] httpHdr
private static final byte[] contentLengthHdr
private static final byte[] contentTypeHdr
private static final byte[] contentTypeValue
static int globalId
private int signature
private short version
private short service
private short length
private int packetSize
private int messageLength
private int messageId
private int messageResponseId
private short sequenceNum
private int flags
private boolean serverMode
private boolean hasIpLibBody
private static boolean debug
private IPAddress remoteAddress
private HttpHeader.HttpHeaderLine[] headerLines
private byte[] serializedHttp
Constructor Detail |
public HttpHeader()
public HttpHeader(IPMessage msg)
msg
- Description of Parameterpublic HttpHeader(IPMessage msg, IPAddress remoteAddress)
msg
- Description of ParameterMethod Detail |
public void updateValues()
updateValues
in class MessageHeader
public int flattenAt(byte[] buf)
flattenAt
in class MessageHeader
buf
- Description of Parametervoid flattenHeader()
static boolean checkHdr(byte[] buffer, int offset, int len)
buffer
- bytes to checkoffset
- offset from beginning of buffer at which header starts.len
- how many bytes to check, maximumint unFlattenFrom(byte[] buf)
unFlattenFrom
in class MessageHeader
buf
- buffer to unflatten from.int parseHttpRequestHeader(byte[] buf)
buf
- buffer to unflatten from.int parseHttpResponseHeader(byte[] buf)
buf
- buffer to unflatten from.public java.lang.String toString()
toString
in class MessageHeader
public int getSize()
getSize
in class MessageHeader
public static int getMinimumSize()
IPAddress getRemoteAddress()
void setRemoteAddress(IPAddress address)
address
- machine addressvoid setFlag(int flag)
setFlag
in class MessageHeader
flag
- flag to setboolean hasFlag(int flag)
hasFlag
in class MessageHeader
flag
- flag to checkvoid setId(int id)
setId
in class MessageHeader
id
- The new Id valueint getId()
getId
in class MessageHeader
void setResponseId(int id)
setResponseId
in class MessageHeader
id
- The new ResponseId valueint getResponseId()
getResponseId
in class MessageHeader
void setLength(short length)
id
- The new length valueshort getLength()
void setMessageLength(int length)
id
- The new length valueint getMessageLength()
void setServiceType(short serviceId)
setServiceType
in class MessageHeader
service
- The new service valueshort getServiceType()
getServiceType
in class MessageHeader
void setMethod(java.lang.String method)
method
- The new method valuejava.lang.String getMethod()
void setTarget(java.lang.String target)
target
- The new target valuejava.lang.String getTarget()
void makeId()
static boolean checkRequestHdr(byte[] buffer, int offset, int len)
buffer
- bytes to checkoffset
- offset from beginning of buffer at which header starts.len
- how many bytes to check, maximumstatic boolean checkResponseHdr(byte[] buffer, int offset, int len)
buffer
- bytes to checkoffset
- offset from beginning of buffer at which header starts.len
- how many bytes to check, maximumstatic final int skipSpaces(byte[] buf, HttpHeader.ParseState ps)
buf
- The buffer to be parsed.ptr
- The buffer pointer to be updated on return.static final int nextItem(byte[] buf, HttpHeader.ParseState ps)
static final int parseInt(byte[] buf, int radix, HttpHeader.ParseState ps)
static final int parseInt(byte[] buf, HttpHeader.ParseState ps)
void()
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |