Package org.servalproject.servaldna

Examples of org.servalproject.servaldna.ServalDClient


public class Meshms {

  static void meshms_list_conversations(SubscriberId sid) throws ServalDInterfaceException, IOException, InterruptedException
  {
    ServalDClient client = new ServerControl().getRestfulClient();
    MeshMSConversationList list = null;
    try {
      list = client.meshmsListConversations(sid);
      MeshMSConversation conv;
      while ((conv = list.nextConversation()) != null) {
        System.out.println(
          "_id=" + conv._id +
          ", my_sid=" + conv.mySid +
View Full Code Here


    System.exit(0);
  }

  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
View Full Code Here

    System.exit(0);
  }

  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
View Full Code Here

    System.exit(0);
  }

  static void meshms_send_message(SubscriberId sid1, SubscriberId sid2, String text) throws ServalDInterfaceException, IOException, InterruptedException
  {
    ServalDClient client = new ServerControl().getRestfulClient();
    try {
      MeshMSStatus status = client.meshmsSendMessage(sid1, sid2, text);
      System.out.println("" + status);
    }
    catch (MeshMSException e) {
      System.out.println(e.toString());
    }
View Full Code Here

    System.exit(0);
  }

  static void meshms_mark_all_conversations_read(SubscriberId sid1) throws ServalDInterfaceException, IOException, InterruptedException
  {
    ServalDClient client = new ServerControl().getRestfulClient();
    try {
      MeshMSStatus status = client.meshmsMarkAllConversationsRead(sid1);
      System.out.println("" + status);
    }
    catch (MeshMSException e) {
      System.out.println(e.toString());
    }
View Full Code Here

    System.exit(0);
  }

  static void meshms_mark_all_messages_read(SubscriberId sid1, SubscriberId sid2) throws ServalDInterfaceException, IOException, InterruptedException
  {
    ServalDClient client = new ServerControl().getRestfulClient();
    try {
      MeshMSStatus status = client.meshmsMarkAllMessagesRead(sid1, sid2);
      System.out.println("" + status);
    }
    catch (MeshMSException e) {
      System.out.println(e.toString());
    }
View Full Code Here

    System.exit(0);
  }

  static void meshms_advance_read_offset(SubscriberId sid1, SubscriberId sid2, long offset) throws ServalDInterfaceException, IOException, InterruptedException
  {
    ServalDClient client = new ServerControl().getRestfulClient();
    try {
      MeshMSStatus status = client.meshmsAdvanceReadOffset(sid1, sid2, offset);
      System.out.println("" + status);
    }
    catch (MeshMSException e) {
      System.out.println(e.toString());
    }
View Full Code Here

        + (manifest.name != null ? sep + "name=" + manifest.name : "");
  }

  static void rhizome_list() throws ServalDInterfaceException, IOException, InterruptedException
  {
    ServalDClient client = new ServerControl().getRestfulClient();
    RhizomeBundleList list = null;
    try {
      list = client.rhizomeListBundles();
      RhizomeListBundle bundle;
      while ((bundle = list.nextBundle()) != null) {
        System.out.println(
            "_token=" + bundle.token +
            ", _rowId=" + bundle.rowId +
View Full Code Here

  }

  static void rhizome_list_newsince(String token) throws ServalDInterfaceException, IOException, InterruptedException
  {
    System.err.println("token=" + token);
    ServalDClient client = new ServerControl().getRestfulClient();
    RhizomeBundleList list = null;
    try {
      list = client.rhizomeListBundlesSince(token);
      RhizomeListBundle bundle;
      while ((bundle = list.nextBundle()) != null) {
        System.out.println(
            "_token=" + bundle.token +
            ", _rowId=" + bundle.rowId +
View Full Code Here

    System.exit(0);
  }

  static void rhizome_manifest(BundleId bid, String dstpath) throws ServalDInterfaceException, IOException, InterruptedException
  {
    ServalDClient client = new ServerControl().getRestfulClient();
    RhizomeManifestBundle bundle = client.rhizomeManifest(bid);
    if (bundle == null)
      System.out.println("not found");
    else {
      System.out.println(
          (bundle.rowId == null ? "" : "_rowId=" + bundle.rowId + "\n") +
View Full Code Here

TOP

Related Classes of org.servalproject.servaldna.ServalDClient

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.