Examples of AckMessage


Examples of asia.stampy.client.message.ack.AckMessage

    thread.start();
  }

  private void sendAck(int i) throws InterceptException {
    String id = Integer.toString(i);
    AckMessage ack = new AckMessage(id);
    ack.getHeader().setReceipt(id);
    ack.getHeader().setTransaction(id);

    gateway.broadcastMessage(ack);
  }
View Full Code Here

Examples of asia.stampy.client.message.ack.AckMessage

  }

  private void onMessage(MessageMessage message) throws InterceptException, InterruptedException {
    messageCount++;
    if (messageCount < 100) {
      AckMessage ack = new AckMessage(message.getHeader().getMessageId());
      gateway.broadcastMessage(ack);
    }
    if (messageCount == 100) {
      System.out.println("Received all expected messages from subscription");
      sendUnsubscribe("subscription");
View Full Code Here

Examples of asia.stampy.client.message.ack.AckMessage

    NackMessage message = new NackMessage(id);
    getGateway().broadcastMessage(message);
  }

  private void sendAck(String id) throws InterceptException {
    AckMessage message = new AckMessage(id);
    getGateway().broadcastMessage(message);
  }
View Full Code Here

Examples of asia.stampy.client.message.ack.AckMessage

    case ABORT:
      message = (MSG) new AbortMessage();
      break;
    case ACK:
      message = (MSG) new AckMessage();
      break;
    case BEGIN:
      message = (MSG) new BeginMessage();
      break;
    case COMMIT:
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.AckMessage

                            logger.info("UserAgent [" + uaid + "] Unregistered[" + response.getChannelId() + "]");
                        }
                        break;
                    case ACK:
                        if (checkHandshakeCompleted(uaid)) {
                            final AckMessage ack = fromJson(buffer.toString(), AckMessageImpl.class);
                            simplePushServer.handleAcknowledgement(ack, uaid);
                            processUnacked(uaid);
                        }
                        break;
                    case PING:
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.AckMessage

public class AckMessageImplTest {

    @Test
    public void constructNullUpdates() {
        final AckMessage ack = new AckMessageImpl(null);
        assertThat(ack.getMessageType(), is(equalTo(MessageType.Type.ACK)));
        assertThat(ack.getAcks().isEmpty(), is(true));
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.AckMessage

    }

    @Test
    public void constructWithUpdates() {
        final Set<Ack> acks = acks(ack("abc123", 1L), ack("efg456", 20L));
        final AckMessage ack = new AckMessageImpl(acks);
        assertThat(ack.getAcks(), hasItems(ack("abc123", 1L), ack("efg456", 20L)));
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.AckMessage

    }

    @Test
    public void fromJson() {
        final String json = "{\"messageType\": \"ack\", \"updates\": [{\"channelID\": \"abc123\", \"version\": 20}, {\"channelID\": \"efg456\", \"version\": 10}]}";
        final AckMessage ack = JsonUtil.fromJson(json, AckMessageImpl.class);
        assertThat(ack.getMessageType(), is(equalTo(MessageType.Type.ACK)));
        assertThat(ack.getAcks(), hasItems(ack("abc123", 20L), ack("efg456", 10L)));
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.AckMessage

    @Test
    public void toJson() {
        final Set<Ack> acks = acks(ack("abc123", 1L), ack("efg456", 20L));
        final String json = JsonUtil.toJson(new AckMessageImpl(acks));
        final AckMessage ack = JsonUtil.fromJson(json, AckMessageImpl.class);
        assertThat(ack.getMessageType(), is(equalTo(MessageType.Type.ACK)));
        assertThat(ack.getAcks(), hasItems(ack("abc123", 1L), ack("efg456", 20L)));
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.AckMessage

                logger.info("UserAgent [" + uaid + "] Unregistered[" + response.getChannelId() + "]");
            }
            break;
        case ACK:
            if (checkHandshakeCompleted(uaid)) {
                final AckMessage ack = fromJson(message, AckMessageImpl.class);
                simplePushServer.handleAcknowledgement(ack, uaid);
                processUnacked(uaid, session, simplePushServer.config().acknowledmentInterval());
            }
            break;
        case PING:
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.