コード例 #1
0
  public void send(Packet packet) {
    if (packet == null) {
      return;
    }
    packet.setTo(user.getAddress());

    if (session != null && session.getStatus() == Session.STATUS_AUTHENTICATED) {
      // Send the packet directly to the local user session
      session.process(packet);
    } else {
      router.route(packet);
    }
  }
コード例 #2
0
 /**
  * Calculates and sets the extended presence information to add to the presence. The information
  * to add contains the user's jid, affiliation and role.
  */
 private void calculateExtendedInformation() {
   ElementUtil.setProperty(extendedInformation, "x.item:jid", user.getAddress().toString());
   ElementUtil.setProperty(extendedInformation, "x.item:affiliation", affiliation.toString());
   ElementUtil.setProperty(extendedInformation, "x.item:role", role.toString());
 }
コード例 #3
0
 public JID getUserAddress() {
   return user.getAddress();
 }