|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.radekzitek.userver.http.HttpVersion
HttpVersion represents the version of the HTTP protocol.
Field Summary | |
private static java.util.regex.Pattern |
HTTP_VERSION_PATTERN
Regular expression pattern used to parse the version string. |
private static org.apache.log4j.Logger |
LOG
Log4j logger. |
private int |
majorVersion
Major vresion number. |
private int |
minorVersion
Minor version number. |
Constructor Summary | |
HttpVersion()
Default HttpVersion constructor. |
|
HttpVersion(int majorVersion,
int minorVersion)
Constructor used to set specific version numbers. |
|
HttpVersion(java.lang.String versionString)
Contructor used to set the version using the string present in the HTTP request message - HTTP/1.1 for example. |
Method Summary | |
void |
clear()
Utility method used to set both major and minor version number to -1 signaling invalid state of the object. |
int |
getMajorVersion()
Returns the major version number. |
int |
getMinorVersion()
Returns the minor version number. |
void |
parse(java.lang.String versionString)
Method used to set the version using the string present in the HTTP request message - HTTP/1.1 for example. |
void |
setMajorVersion(int majorVersion)
Sets the major version number. |
void |
setMinorVersion(int minorVersion)
Sets the minor version number. |
void |
setVersion(int majorVersion,
int minorVersion)
Sets both major and minor version number. |
java.lang.String |
toString()
Converts the HttpVersion to the string as used in the HTTP request and response messahes - HTTP/1.1 for example. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final java.util.regex.Pattern HTTP_VERSION_PATTERN
private static final org.apache.log4j.Logger LOG
private int majorVersion
private int minorVersion
Constructor Detail |
public HttpVersion()
public HttpVersion(int majorVersion, int minorVersion)
majorVersion
- Major version number to set.minorVersion
- Minor version number to set.public HttpVersion(java.lang.String versionString) throws HttpVersionFormatException
versionString
- String used to set the version. Format should be HTTP/m.n
where m and n are integers.
HttpVersionFormatException
- Exception thrown if the parameter string does not match the
regular expression above.Method Detail |
public void clear()
clear
in interface HttpObject
public int getMajorVersion()
public int getMinorVersion()
public void parse(java.lang.String versionString) throws HttpVersionFormatException
parse
in interface HttpObject
versionString
- String used to set the version. Format should be HTTP/m.n
where m and n are integers.
HttpVersionFormatException
- Exception thrown if the parameter string does not match the
regular expression above.public void setMajorVersion(int majorVersion)
majorVersion
- the new major version numberpublic void setMinorVersion(int minorVersion)
minorVersion
- the new minor version numberpublic void setVersion(int majorVersion, int minorVersion)
majorVersion
- the new major version numberminorVersion
- the new minor version numberpublic java.lang.String toString()
toString
in interface HttpObject
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |