Package org.servalproject.servaldna.meshms

Examples of org.servalproject.servaldna.meshms.MeshMSMessageList


  }

  static void meshms_list_messages(SubscriberId sid1, SubscriberId sid2) throws ServalDInterfaceException, IOException, InterruptedException
  {
    ServalDClient client = new ServerControl().getRestfulClient();
    MeshMSMessageList list = null;
    try {
      list = client.meshmsListMessages(sid1, sid2);
      System.out.println("read_offset=" + list.getReadOffset());
      System.out.println("latest_ack_offset=" + list.getLatestAckOffset());
      MeshMSMessage msg;
      while ((msg = list.nextMessage()) != null) {
        System.out.println("type=" + msg.type
                 + ", my_sid=" + msg.mySid
                 + ", their_sid=" + msg.theirSid
                 + ", offset=" + msg.offset
                 + ", token=" + msg.token
                 + ", text=" + (msg.text == null ? null : msg.text.replace('\n', '.').replace(' ', '.'))
                 + ", delivered=" + msg.isDelivered
                 + ", read=" + msg.isRead
                 + ", timestamp=" + msg.timestamp
                 + ", ack_offset=" + msg.ackOffset
              );
      }
    }
    catch (MeshMSException e) {
      System.out.println(e.toString());
    }
    finally {
      if (list != null)
        list.close();
    }
    System.exit(0);
  }
View Full Code Here


  }

  static void meshms_list_messages_since(SubscriberId sid1, SubscriberId sid2, String token) throws ServalDInterfaceException, IOException, InterruptedException
  {
    ServalDClient client = new ServerControl().getRestfulClient();
    MeshMSMessageList list = null;
    try {
      list = client.meshmsListMessagesSince(sid1, sid2, token);
      MeshMSMessage msg;
      while ((msg = list.nextMessage()) != null) {
        System.out.println("type=" + msg.type
                 + ", my_sid=" + msg.mySid
                 + ", their_sid=" + msg.theirSid
                 + ", offset=" + msg.offset
                 + ", token=" + msg.token
                 + ", text=" + (msg.text == null ? null : msg.text.replace('\n', '.').replace(' ', '.'))
                 + ", delivered=" + msg.isDelivered
                 + ", read=" + msg.isRead
                 + ", timestamp=" + msg.timestamp
                 + ", ack_offset=" + msg.ackOffset
              );
      }
    }
    catch (MeshMSException e) {
      System.out.println(e.toString());
    }
    finally {
      if (list != null)
        list.close();
    }
    System.exit(0);
  }
View Full Code Here

    return list;
  }

  public MeshMSMessageList meshmsListMessages(SubscriberId sid1, SubscriberId sid2) throws IOException, ServalDInterfaceException, MeshMSException
  {
    MeshMSMessageList list = new MeshMSMessageList(this, sid1, sid2);
    list.connect();
    return list;
  }
View Full Code Here

    return list;
  }

  public MeshMSMessageList meshmsListMessagesSince(SubscriberId sid1, SubscriberId sid2, String token) throws IOException, ServalDInterfaceException, MeshMSException
  {
    MeshMSMessageList list = new MeshMSMessageList(this, sid1, sid2, token);
    list.connect();
    return list;
  }
View Full Code Here

    return list;
  }

  public MeshMSMessageList meshmsListMessages(SubscriberId sid1, SubscriberId sid2) throws IOException, ServalDInterfaceException, MeshMSException
  {
    MeshMSMessageList list = new MeshMSMessageList(this, sid1, sid2);
    list.connect();
    return list;
  }
View Full Code Here

    return list;
  }

  public MeshMSMessageList meshmsListMessagesSince(SubscriberId sid1, SubscriberId sid2, String token) throws IOException, ServalDInterfaceException, MeshMSException
  {
    MeshMSMessageList list = new MeshMSMessageList(this, sid1, sid2, token);
    list.connect();
    return list;
  }
View Full Code Here

TOP

Related Classes of org.servalproject.servaldna.meshms.MeshMSMessageList

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.