Examples of Bind


Examples of org.jivesoftware.smack.packet.Bind

      return;
    if (packet instanceof IQ) {
      IQ iqPacket = (IQ) packet;
      if (iqPacket.getType().equals(IQ.Type.RESULT)
          && iqPacket instanceof Bind) {
        Bind bindPacket = (Bind) iqPacket;
        synchronized (bindLock) {
          jid = bindPacket.getJid();
          bindLock.notify();
        }
      }
    }
  }
View Full Code Here

Examples of org.jivesoftware.smack.packet.Bind

        if (!resourceBinded) {
            // Server never offered resource binding
            throw new XMPPException("Resource binding not offered by server");
        }

        Bind bindResource = new Bind();
        bindResource.setResource(resource);

        PacketCollector collector = connection
                .createPacketCollector(new PacketIDFilter(bindResource.getPacketID()));
        // Send the packet
        connection.sendPacket(bindResource);
        // Wait up to a certain number of seconds for a response from the server.
        Bind response = (Bind) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        collector.cancel();
        if (response == null) {
            throw new XMPPException("No response from the server.");
        }
        // If the server replied with an error, throw an exception.
        else if (response.getType() == IQ.Type.ERROR) {
            throw new XMPPException(response.getError());
        }
        String userJID = response.getJid();

        if (sessionSupported) {
            Session session = new Session();
            collector = connection.createPacketCollector(new PacketIDFilter(session.getPacketID()));
            // Send the packet
View Full Code Here

Examples of org.jivesoftware.smack.packet.Bind

        return registration;
    }

    private static Bind parseResourceBinding(XmlPullParser parser) throws IOException,
            XmlPullParserException {
        Bind bind = new Bind();
        boolean done = false;
        while (!done) {
            int eventType = parser.next();
            if (eventType == XmlPullParser.START_TAG) {
                if (parser.getName().equals("resource")) {
                    bind.setResource(parser.nextText());
                }
                else if (parser.getName().equals("jid")) {
                    bind.setJid(parser.nextText());
                }
            } else if (eventType == XmlPullParser.END_TAG) {
                if (parser.getName().equals("bind")) {
                    done = true;
                }
View Full Code Here

Examples of org.jnetpcap.packet.annotate.Bind

    for (AnnotatedBindMethod boundMethod : bindMethods) {

      try {

        Bind bind = boundMethod.getMethod().getAnnotation(Bind.class);
        target = bind.to();
        Class<? extends JHeader> source = bind.from();
        Class<? extends JHeader>[] dependencies = bind.dependencies();

        list.add(new AnnotatedBinding(c, source, target, boundMethod,
            dependencies));

      } catch (AnnotatedMethodException e) {
View Full Code Here

Examples of org.jnetpcap.packet.annotate.Bind

    for (AnnotatedBindMethod boundMethod : bindMethods) {

      try {

        Bind bind = boundMethod.getMethod().getAnnotation(Bind.class);
        target = bind.to();
        Class<? extends JHeader>[] dependencies = bind.dependencies();

        list.add(new AnnotatedBinding(c, source, target, boundMethod,
            dependencies));

      } catch (AnnotatedMethodException e) {
View Full Code Here

Examples of org.jnetpcap.packet.annotate.Bind

      /*
       * Also need to check and make sure that for general classes, there is
       * also a "from" parameter, which does not have to be present int JHeader
       * declaring class case.
       */
      final Bind bind = b.getMethod().getAnnotation(Bind.class);
      final Class<? extends JHeader> source = bind.from();

      if (source == JHeader.class) {
        errors.add(new HeaderDefinitionError(c,
            "missing annotated 'from' declaration for method "
                + b.getMethod().getName() + "()"));
View Full Code Here

Examples of org.jnetpcap.packet.annotate.Bind

      try {
        if (method.isAnnotationPresent(Bind.class)) {

          checkSignature(method);

          final Bind bind = method.getAnnotation(Bind.class);
          target = bind.to();
          final AnnotatedBindMethod boundMethod =
              new AnnotatedBindMethod(target, method);

          list.add(boundMethod);
        }
View Full Code Here

Examples of org.jnetpcap.packet.annotate.Bind

      try {
        if (method.isAnnotationPresent(Bind.class)) {

          checkNonStaticSignature(method);

          final Bind bind = method.getAnnotation(Bind.class);
          target = bind.to();
          final AnnotatedBindMethod boundMethod =
              new AnnotatedBindMethod(target, method, object);

          list.add(boundMethod);
        }
View Full Code Here

Examples of org.jruby.pg.internal.messages.Bind

    this.format = format;
  }

  public void sendExecPrepared(PostgresqlString name, Value[] values, Format format) throws IOException {
    checkIsReady();
    currentOutBuffer = new Bind(PostgresqlString.NULL_STRING, name, values, format).toBytes();
    shouldDescribe = true;
    shouldExecute = true;
    state = ConnectionState.SendingBind;
    if (!nonBlocking)
      socket.configureBlocking(true);
View Full Code Here

Examples of org.jsmpp.bean.Bind

            fail("Should throw IllegalStateException");
        }
    }
   
    private static final Bind dummyBind() {
        Bind bind = new Bind();
        bind.setCommandId(BindType.BIND_RX.commandId());
        return bind;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.