public static Class<? extends Message> getMessageClass(int code) {
		if (isRequest(code)) {
			switch (code) {
			case METHOD_GET: 
				return GETRequest.class;
			case METHOD_POST: 
				return POSTRequest.class;
			case METHOD_PUT: 
				return PUTRequest.class;
			case METHOD_DELETE: 
				return DELETERequest.class;
			default: 
				return Request.class;
			}
		} else if (isResponse(code)) {
			return Response.class;
		} else if (code == EMPTY_MESSAGE) {
			// empty messages are handled as responses
			// in order to handle ACK/RST messages consistent
			// with actual responses
			return Response.class;
		} else if (isValid(code)) {
			return Message.class;
		} else {
			return null;
		}
	}