Package nu.fw.jeti.jabber.elements

Examples of nu.fw.jeti.jabber.elements.InfoQuery


    protected void rejectIncomingJingleSession(JingleSessionRequest request) {
        Jingle initiation = request.getJingle();

        Jingle rejection = JingleSession.createError(initiation.getPacketID(), initiation
                .getFrom(), initiation.getTo(), 403, "Declined");
        connection.send(new InfoQuery(rejection.getFrom(),rejection.getPacketID(),rejection.getError()));
    }
View Full Code Here


  private void doBind()
  {
    System.out.println("binding");
    if(Preferences.getBoolean("xmpp", "anonymousLogin", false))
    {
      connect.sendWhileConnecting(new InfoQuery("get",new IQBind()));
    }
    else connect.sendWhileConnecting(new InfoQuery("set",new IQBind(loginInfo.getResource())));
  }
View Full Code Here

    {
      respond((ChallengePacket)packet);
    }
    else if (packet instanceof InfoQuery)
    {
      InfoQuery infoquery = (InfoQuery)packet;
      IQExtension iq = infoquery.getIQExtension();
      if(iq instanceof IQBind)
      {
        if (infoquery.getType().equals("result"))
        {
          jid = ((IQBind)iq).getJID();
          System.out.println(jid);
          connect.sendWhileConnecting(new InfoQuery(null,"set","sessionStart",new IQSession()));
        }
        else if(infoquery.getType().equals("error"))
        {
          String error = infoquery.getXMPPError().getFirstXMPPError().getError();
          if(error.equals("bad-request "))
          {//wrong resource, try otherone (not allowed by string prep)
            //make one, improve
            connect.sendWhileConnecting(new InfoQuery("get",new IQBind()));
          }
          else if(error.equals("not-allowed"))
          {//resource limit reached
            connect.sendLoginError("Resource limit reached, logoff a resource");
          }
          else if(error.equals("conflict"))
          {//resource in use choose new
//            make one, improve
            connect.sendWhileConnecting(new InfoQuery("get",new IQBind()));
          }
        }
      }
      else if(infoquery.getID().equals("sessionStart"))
      {
        if (infoquery.getType().equals("result"))
        {
          connect.authenticated(jid);
        }
        else if(infoquery.getType().equals("error"))
        {
          String error = infoquery.getXMPPError().getFirstXMPPError().getError();
          if(error.equals("internal-server-error"))
          {//internal server error, try again, retry limit?
            connect.sendLoginError("Server error, try again");
          }
          else if(error.equals("forbidden"))
          {//not allowed to make session, try non sasl
            connect.sendLoginError("Not allowed to create session");
          }
          else if(error.equals("cancel"))
          {//resource conflict, choose different resource
//            make one, improve
            connect.sendWhileConnecting(new InfoQuery("get",new IQBind()));
          }
        }
       }
    }
    else if(PluginsInfo.isPluginLoaded("compression")){
View Full Code Here

        clearCandidates();

        sid = Math.abs(random.nextLong());

       
        InfoQuery query = RTPBridge.getRTPBridge(connection, String.valueOf(sid));

        connection.send(query, new IQResultListener()
            {
           
              public void iqResult(InfoQuery iq)
View Full Code Here

        }catch(RuntimeException e)
        {
          error = true;
        }
      }
      if(!error)backend.send(new InfoQuery("set",new IQPrivate(new ServerLogExtension())));
    }
    else if (iq.getType().equals("error"))
    {
      System.out.println(iq.getErrorDescription());
    }
View Full Code Here

        JID to = new JID(RTPBridge.NAME + "." + xmppConnection.getMyJID().getDomain());

//        PacketCollector collector = xmppConnection
//                .createPacketCollector(new PacketIDFilter(rtpPacket.getPacketID()));
//FIXME add to
        return new InfoQuery(to,"set", rtpPacket);
      

//        RTPBridge response = (RTPBridge) collector
//                .nextResult(SmackConfiguration.getPacketReplyTimeout());
//
View Full Code Here

        // System.out.println("Relayed to: " + candidate.getIp() + ":" + candidate.getPort());

//        PacketCollector collector = xmppConnection
//                .createPacketCollector(new PacketIDFilter(rtpPacket.getPacketID()));

        xmppConnection.send(new InfoQuery(to,"set", rtpPacket));

//        RTPBridge response = (RTPBridge) collector
//                .nextResult(SmackConfiguration.getPacketReplyTimeout());
//
//        // Cancel the collector.
View Full Code Here

//        PacketCollector collector = xmppConnection
//                .createPacketCollector(new PacketIDFilter(rtpPacket.getPacketID()));

        
        return new InfoQuery(to,"set", rtpPacket);
       

//        RTPBridge response = (RTPBridge) collector
//                .nextResult(SmackConfiguration.getPacketReplyTimeout());
//
View Full Code Here

        return errorDescription;
    }

    public synchronized void send(String type, IQMUCInterface handler) {
        String id = "Jeti_Groupchat_" + idCount++;
        InfoQuery iq = new InfoQuery(roomJID,type,id,this);
        timeout(iq);
        requests.put(id,handler);
        backend.send(iq);
    }
View Full Code Here

    Plugin.startGroupchat(jid,backend);
  }
 
    private void storeConferences() {
        backend.send(
            new InfoQuery("set",
                          new IQPrivate(
                              new PrivateBookmarkExtension(urls,
                                                           conferences))));
        addBookmarks(false);
    }
View Full Code Here

TOP

Related Classes of nu.fw.jeti.jabber.elements.InfoQuery

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.