class MessageBean {

	public static MessageBean parse(String line) throws UnsupportedEncodingException {
		MessageBean bean = new MessageBean();
		line = URLDecoder.decode(line, "utf-8");
		try {
			bean.setBitrate(Long.parseLong(MessageBean.getParameter(line, "bitrate")));
		} catch (NumberFormatException e) {
			bean.setBitrate(0);
		}
		bean.setClientID(MessageBean.getParameter(line, "clientID"));
		try {
			bean.setMsgID(Long.parseLong(MessageBean.getParameter(line, "msgID")));
		} catch (NumberFormatException e) {
			bean.setMsgID(0);
		}
		bean.setProductID(MessageBean.getParameter(line, "productID"));
		bean.setViewID(MessageBean.getParameter(line, "viewID"));
		bean.setAppType(MessageBean.getParameter(line, "appType"));
		bean.setEventType(MessageBean.getParameter(line, "eventType"));
		bean.setDeviceType(MessageBean.getParameter(line, "deviceType"));
		return bean;
	}

}