本文整理匯總了Java中org.androidpn.server.console.vo.SessionVO類的典型用法代碼示例。如果您正苦於以下問題:Java SessionVO類的具體用法?Java SessionVO怎麽用?Java SessionVO使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SessionVO類屬於org.androidpn.server.console.vo包,在下文中一共展示了SessionVO類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: list
import org.androidpn.server.console.vo.SessionVO; //導入依賴的package包/類
public ModelAndView list(HttpServletRequest request,
HttpServletResponse response) throws Exception {
ClientSession[] sessions = new ClientSession[0];
sessions = SessionManager.getInstance().getSessions().toArray(sessions);
List<SessionVO> voList = new ArrayList<SessionVO>();
for (ClientSession sess : sessions) {
SessionVO vo = new SessionVO();
vo.setUsername(sess.getUsername());
vo.setResource(sess.getAddress().getResource());
// Status
if (sess.getStatus() == Session.STATUS_CONNECTED) {
vo.setStatus("CONNECTED");
} else if (sess.getStatus() == Session.STATUS_AUTHENTICATED) {
vo.setStatus("AUTHENTICATED");
} else if (sess.getStatus() == Session.STATUS_CLOSED) {
vo.setStatus("CLOSED");
} else {
vo.setStatus("UNKNOWN");
}
// Presence
if (!sess.getPresence().isAvailable()) {
vo.setPresence("Offline");// 離線
} else {
Presence.Show show = sess.getPresence().getShow();
if (show == null) {
vo.setPresence("Online");// 在線的
} else if (show == Presence.Show.away) {
vo.setPresence("Away");// 離開
} else if (show == Presence.Show.chat) {
vo.setPresence("Chat");// 聊天
} else if (show == Presence.Show.dnd) {
vo.setPresence("Do Not Disturb");// 請勿打擾
} else if (show == Presence.Show.xa) {
vo.setPresence("eXtended Away");// 忙碌
} else {
vo.setPresence("Unknown");// 未知
}
}
vo.setClientIP(sess.getHostAddress());
vo.setCreatedDate(sess.getCreationDate());
voList.add(vo);
}
ModelAndView mav = new ModelAndView();
mav.addObject("sessionList", voList);
mav.setViewName("session/list");
return mav;
}
示例2: list
import org.androidpn.server.console.vo.SessionVO; //導入依賴的package包/類
public ModelAndView list(HttpServletRequest request,
HttpServletResponse response) throws Exception {
ClientSession[] sessions = new ClientSession[0];
sessions = SessionManager.getInstance().getSessions().toArray(sessions);
List<SessionVO> voList = new ArrayList<SessionVO>();
for (ClientSession sess : sessions) {
SessionVO vo = new SessionVO();
vo.setUsername(sess.getUsername());
vo.setResource(sess.getAddress().getResource());
// Status
if (sess.getStatus() == Session.STATUS_CONNECTED) {
vo.setStatus("CONNECTED");
} else if (sess.getStatus() == Session.STATUS_AUTHENTICATED) {
vo.setStatus("AUTHENTICATED");
} else if (sess.getStatus() == Session.STATUS_CLOSED) {
vo.setStatus("CLOSED");
} else {
vo.setStatus("UNKNOWN");
}
// Presence
if (!sess.getPresence().isAvailable()) {
vo.setPresence("Offline");
} else {
Presence.Show show = sess.getPresence().getShow();
if (show == null) {
vo.setPresence("Online");
} else if (show == Presence.Show.away) {
vo.setPresence("Away");
} else if (show == Presence.Show.chat) {
vo.setPresence("Chat");
} else if (show == Presence.Show.dnd) {
vo.setPresence("Do Not Disturb");
} else if (show == Presence.Show.xa) {
vo.setPresence("eXtended Away");
} else {
vo.setPresence("Unknown");
}
}
vo.setClientIP(sess.getHostAddress());
vo.setCreatedDate(sess.getCreationDate());
voList.add(vo);
}
ModelAndView mav = new ModelAndView();
mav.addObject("sessionList", voList);
mav.setViewName("session/list");
return mav;
}