Package tigase.server

Examples of tigase.server.Packet


    }
  }

  public void sendWarningOut(String text, Object warning) {
    if (warning == null || !warningsSent.contains(warning)) {
      Packet result = Packet.getMessage("", jid, StanzaType.normal,
              "Warning! High resource usage alert from: " +
              getClass().getSimpleName() + "\n" +
              new Date() + " - " + text,
              "System Monitor Alert", null);
      smTask.sendPacketOut(result);
View Full Code Here


   *
   * @param new_subscr a <code>String[]</code> value
   */
  public void addNewSubscribers(Queue<Packet> results, String... new_subscr) {
    for (String buddy: new_subscr) {
      Packet presence = null;
      if (isAllowedToSubscribe(buddy)) {
        if (getRosterItem(buddy) == null) {
          addToRoster(buddy);
        } // end of if (getRosterItem(buddy) == null)
        log.info(getJID() + ": " + "Adding buddy to roster: " + buddy);
        presence = getPresence(buddy, jid, StanzaType.subscribe,
          JIDUtils.getNodeNick(jid), null);
      } else {
        log.info(getJID() + ": " +
          "Not allowed to subscribe, rejecting: " + buddy);
        presence = getPresence(buddy, jid, StanzaType.unsubscribed);
      } // end of else
      log.finest(getJID() + ": " +
        "Sending back: " + presence.toString());
      results.offer(presence);
    } // end of for (String buddy: new_subscr)
  }
View Full Code Here

    return defs;
  }

  public void init(final Queue<Packet> results) {
    for (RosterItem ri: roster.values()) {
      Packet presence = null;
      if (ri.isSubscribed()) {
        presence = getPresence(ri.getJid(), jid, StanzaType.available,
          null, getDescription());
      } else {
        presence = getPresence(ri.getJid(), jid, StanzaType.subscribe,
View Full Code Here

    }
  }

  public void destroy(Queue<Packet> results) {
    for (RosterItem ri: roster.values()) {
      Packet presence = getPresence(ri.getJid(), jid, StanzaType.unsubscribe);
      results.offer(presence);
      presence = getPresence(ri.getJid(), jid, StanzaType.unsubscribed);
      results.offer(presence);
    }
  }
View Full Code Here

            break;
          }
          default:
            break;
        }
        results.offer(new Packet(message));
      } // end of if (ri.isSubscribed() && ri.isModerationAccepted())
    } // end of for (RosterItem ri: roster.values())
  }
View Full Code Here

          new String[] {"http://jabber.org/protocol/nick"}));
    }
    if (status != null) {
      presence.addChild(new Element("status", status));
    }
    return new Packet(presence);
  }
View Full Code Here

      new Element[] {
        new Element("subject", "Automatic system message"),
        new Element("body", body)},
      new String[] {"to", "from", "type"},
      new String[] {to, from, type.toString()});
    return new Packet(message);
  }
View Full Code Here

TOP

Related Classes of tigase.server.Packet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.