/**
  * Returns the current presence of the user.
  *
  * @param user the user
  * @return the current presence of the user.
  */
 public Presence getPresence(ApnUser user) {
   if (user == null) {
     return null;
   }
   Presence presence = null;
   ClientSession session = sessionManager.getSession(user.getUsername());
   if (session != null) {
     presence = session.getPresence();
   }
   return presence;
 }
 /**
  * Returns the availability of the user.
  *
  * @param user the user
  * @return true if the user is available
  */
 public boolean isAvailable(ApnUser user) {
   return sessionManager.getSession(user.getUsername()) != null;
 }