Package net.officefloor.server.http
Class HttpStatus
- java.lang.Object
-
- net.officefloor.server.http.HttpStatus
-
public class HttpStatus extends java.lang.Object
HTTP status.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpStatus.HttpStatusEnum
HttpStatus
Enum
.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description HttpStatus(int statusCode, java.lang.String statusMessage)
Instantiate a dynamicHttpStatus
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
HttpStatus.HttpStatusEnum
getEnum()
Obtains theHttpStatus.HttpStatusEnum
for thisHttpVersion
.static HttpStatus
getHttpStatus(int statusCode)
Obtains theHttpStatus
for the status code.int
getStatusCode()
Obtains the status code.java.lang.String
getStatusMessage()
Obtains the status message.int
hashCode()
boolean
isEqual(HttpStatus httpStatus)
Equals without the type checking.java.lang.String
toString()
<B> void
write(StreamBuffer<B> head, StreamBufferPool<B> bufferPool)
Writes thisHttpStatus
to theStreamBuffer
.
-
-
-
Field Detail
-
CONTINUE
public static final HttpStatus CONTINUE
-
SWITCHING_PROTOCOLS
public static final HttpStatus SWITCHING_PROTOCOLS
-
OK
public static final HttpStatus OK
-
CREATED
public static final HttpStatus CREATED
-
ACCEPTED
public static final HttpStatus ACCEPTED
-
NON_AUTHORITATIVE_INFORMATION
public static final HttpStatus NON_AUTHORITATIVE_INFORMATION
-
NO_CONTENT
public static final HttpStatus NO_CONTENT
-
RESET_CONTENT
public static final HttpStatus RESET_CONTENT
-
PARTIAL_CONTENT
public static final HttpStatus PARTIAL_CONTENT
-
MULTIPLE_CHOICES
public static final HttpStatus MULTIPLE_CHOICES
-
MOVED_PERMANENTLY
public static final HttpStatus MOVED_PERMANENTLY
-
FOUND
public static final HttpStatus FOUND
-
SEE_OTHER
public static final HttpStatus SEE_OTHER
-
NOT_MODIFIED
public static final HttpStatus NOT_MODIFIED
-
USE_PROXY
public static final HttpStatus USE_PROXY
-
TEMPORARY_REDIRECT
public static final HttpStatus TEMPORARY_REDIRECT
-
BAD_REQUEST
public static final HttpStatus BAD_REQUEST
-
UNAUTHORIZED
public static final HttpStatus UNAUTHORIZED
-
PAYMENT_REQUIRED
public static final HttpStatus PAYMENT_REQUIRED
-
FORBIDDEN
public static final HttpStatus FORBIDDEN
-
NOT_FOUND
public static final HttpStatus NOT_FOUND
-
METHOD_NOT_ALLOWED
public static final HttpStatus METHOD_NOT_ALLOWED
-
NOT_ACCEPTABLE
public static final HttpStatus NOT_ACCEPTABLE
-
PROXY_AUTHENTICATION_REQUIRED
public static final HttpStatus PROXY_AUTHENTICATION_REQUIRED
-
REQUEST_TIME_OUT
public static final HttpStatus REQUEST_TIME_OUT
-
CONFLICT
public static final HttpStatus CONFLICT
-
GONE
public static final HttpStatus GONE
-
LENGTH_REQUIRED
public static final HttpStatus LENGTH_REQUIRED
-
PRECONDITION_FAILED
public static final HttpStatus PRECONDITION_FAILED
-
REQUEST_ENTITY_TOO_LARGE
public static final HttpStatus REQUEST_ENTITY_TOO_LARGE
-
REQUEST_URI_TOO_LARGE
public static final HttpStatus REQUEST_URI_TOO_LARGE
-
UNSUPPORTED_MEDIA_TYPE
public static final HttpStatus UNSUPPORTED_MEDIA_TYPE
-
REQUESTED_RANGE_NOT_SATISFIABLE
public static final HttpStatus REQUESTED_RANGE_NOT_SATISFIABLE
-
EXPECTATION_FAILED
public static final HttpStatus EXPECTATION_FAILED
-
INTERNAL_SERVER_ERROR
public static final HttpStatus INTERNAL_SERVER_ERROR
-
NOT_IMPLEMENTED
public static final HttpStatus NOT_IMPLEMENTED
-
BAD_GATEWAY
public static final HttpStatus BAD_GATEWAY
-
SERVICE_UNAVAILABLE
public static final HttpStatus SERVICE_UNAVAILABLE
-
GATEWAY_TIME_OUT
public static final HttpStatus GATEWAY_TIME_OUT
-
HTTP_VERSION_NOT_SUPPORTED
public static final HttpStatus HTTP_VERSION_NOT_SUPPORTED
-
-
Constructor Detail
-
HttpStatus
public HttpStatus(int statusCode, java.lang.String statusMessage)
Instantiate a dynamicHttpStatus
.- Parameters:
statusCode
- Status code.statusMessage
- Status message.
-
-
Method Detail
-
getHttpStatus
public static HttpStatus getHttpStatus(int statusCode)
Obtains theHttpStatus
for the status code.- Parameters:
statusCode
- Status code.- Returns:
HttpStatus
.
-
isEqual
public boolean isEqual(HttpStatus httpStatus)
Equals without the type checking.- Parameters:
httpStatus
-HttpStatus
.- Returns:
true
if sameHttpStatus
.
-
getEnum
public HttpStatus.HttpStatusEnum getEnum()
Obtains theHttpStatus.HttpStatusEnum
for thisHttpVersion
.- Returns:
HttpStatus.HttpStatusEnum
.
-
getStatusCode
public int getStatusCode()
Obtains the status code.- Returns:
- Status code.
-
getStatusMessage
public java.lang.String getStatusMessage()
Obtains the status message.- Returns:
- Status message.
-
write
public <B> void write(StreamBuffer<B> head, StreamBufferPool<B> bufferPool)
Writes thisHttpStatus
to theStreamBuffer
.- Type Parameters:
B
- Buffer type.- Parameters:
head
- HeadStreamBuffer
of the linked list ofStreamBuffer
instances.bufferPool
-StreamBufferPool
.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-