Package tigase.xmpp

Examples of tigase.xmpp.StanzaType


      }
      if (packet.getFrom().equals(session.getConnectionId())) {
        List<Element> elems = packet.getElemChildren("/iq/query");
        if (elems != null && elems.size() > 0) {
          Element elem = elems.get(0);
          StanzaType type = packet.getType();
          switch (type) {
          case get:
            String priv = session.getData(PRIVATE_KEY,
              elem.getName()+elem.getXMLNS(), null);
            log.finest("Loaded private data for key: "
View Full Code Here


    if (conn == null) {
      return;
    } // end of if (session == null)

    StanzaType type = packet.getType();
    if (type == null || type == StanzaType.available) {
      // Should we send off-line messages now?
      // Let's try to do it here and maybe later I find better place.
      String priority_str = packet.getElemCData("/presence/priority");
      int priority = 0;
View Full Code Here

  }

  public boolean savePacketForOffLineUser(Packet pac,
    NonAuthUserRepository repo) throws UserNotFoundException {

    StanzaType type = pac.getType();

    if ((pac.getElemName().equals("message") &&
        (pac.getElement().findChild("/message/body") != null) &&
        (type == null || type == StanzaType.normal || type == StanzaType.chat))
      || (pac.getElemName().equals("presence") &&
View Full Code Here

      String id = null;
      if (packet.getElemTo() != null) {
        id = JIDUtils.getNodeID(packet.getElemTo());
      } // end of if (packet.getElemTo() != null)
      if (id == null || id.equals(session.getUserId())) {
        StanzaType type = packet.getType();
        switch (type) {
        case get:
          try {
            String strvCard = repo.getPublicData(session.getUserId(),
              ID, VCARD_KEY, null);
View Full Code Here

          "Session is not yet authorized.", false));
      return;
    } // end of if (!session.isAuthorized())

    Element request = packet.getElement();
    StanzaType type = packet.getType();
    try {
      switch (type) {
      case set:
        final String resource = request.getChildCData("/iq/bind/resource");
        if (resource == null || resource.equals("")) {
View Full Code Here

      if ((id.equals(session.getDomain())
          || id.equals(session.getUserId()))
        && packet.getFrom().equals(session.getConnectionId())) {
        Authorization result = Authorization.NOT_AUTHORIZED;
        Element request = packet.getElement();
        StanzaType type = packet.getType();
        switch (type) {
        case set:
          // Is it registration cancel request?
          Element elem = request.findChild("/iq/query/remove");
          if (elem != null) {
View Full Code Here

    if (session == null) {
      return;
    } // end of if (session == null)

    Element request = packet.getElement();
    StanzaType type = packet.getType();
    switch (type) {
    case get:
      Map<String, Object> query = new HashMap<String, Object>();
      query.put(UserAuthRepository.PROTOCOL_KEY,
        UserAuthRepository.PROTOCOL_VAL_NONSASL);
View Full Code Here

          + ", request: " + packet.getStringData());
        return;
      } // end of if (packet.getElemFrom() != null
        // && !session.getUserId().equals(JIDUtils.getNodeID(packet.getElemFrom())))

      StanzaType type = packet.getType();
      String xmlns = packet.getElement().getXMLNS("/iq/query");
      if (xmlns == XMLNS) {
        switch (type) {
          case get:
            processGetRequest(packet, session, results, settings);
View Full Code Here

    String to = packet.getElemTo();
    if (to != null) {
      to = JIDUtils.getNodeID(to);
    } // end of if (to != null)
    StanzaType type = packet.getType();
    if (type == null) {
      type = StanzaType.available;
    } else {
      if (type == StanzaType.error) {
        return PresenceType.error;
View Full Code Here

        if (pres_type == null) {
          log.warning("Invalid presence found: " + packet.toString());
          return;
        } // end of if (type == null)

        StanzaType type = packet.getType();
        if (type == null) {
          type = StanzaType.available;
        } // end of if (type == null)

        // Not needed anymore. Packet filter does it for all stanzas.
View Full Code Here

TOP

Related Classes of tigase.xmpp.StanzaType

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.