Package org.servalproject.servaldna

Examples of org.servalproject.servaldna.ServerControl


      System.out.println(details.getResult()==0?details.toString():i.toString());
    }
  }

  static void lookup(String did) throws IOException, InterruptedException, ServalDInterfaceException {
    MdpDnaLookup lookup = new ServerControl().getMdpDnaLookup(new ChannelSelector()new AsyncResult<ServalDCommand.LookupResult>() {
      @Override
      public void result(ServalDCommand.LookupResult nextResult) {
        System.out.println(nextResult.toString());
      }
    });
View Full Code Here


    Thread.sleep(3000);
    lookup.close();
  }

  static void service(String pattern) throws IOException, InterruptedException, ServalDInterfaceException {
    MdpServiceLookup lookup = new ServerControl().getMdpServiceLookup(new ChannelSelector(), new AsyncResult<MdpServiceLookup.ServiceResult>() {
      @Override
      public void result(MdpServiceLookup.ServiceResult nextResult) {
        System.out.println(nextResult.toString());
      }
    });
View Full Code Here

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) {
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());
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) {
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) {
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) {
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) {
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) {
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) {
View Full Code Here

TOP

Related Classes of org.servalproject.servaldna.ServerControl

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.