Package eu.pursuit.core

Examples of eu.pursuit.core.ByteIdentifier


    channelID = 1;
   
    // Initialise the rootscope
    // publish the root scope where all videos will be published
    String rootScopeStr = "1111111111111111";
        ByteIdentifier rootId = new ByteIdentifier(Hex.decodeHex(rootScopeStr.toCharArray()));
        rootScope = new ScopeID(rootId);
   
    // immediately subscribe to the catalog
    videoSubscriber = new VideoSubscriber(client, rootScope, strategy);
   
View Full Code Here


  private byte[] msg;

  public PPChannelReceiver(String seed, ByteIdentifier rid,
      BlackAdderClient ba) throws UnsupportedEncodingException,
      NoSuchAlgorithmException {
    this.rid = new ByteIdentifier(Utility.sha1(seed));
    this.scope = new ScopeID();
    scope.addSegment(new ByteIdentifier(Utility.sha1(rid.getId())));
    this.ba = ba;
  }
View Full Code Here

  }

  public void receiveCall(String callee) throws NoSuchAlgorithmException,
      UnsupportedEncodingException {

    myRid = new ByteIdentifier(Utility.sha1(callee));
    sId = new ScopeID();
    ByteIdentifier b = new ByteIdentifier(Utility.sha1(myRid.getId()));
    sId.addSegment(b);
    ItemName receiveData = new ItemName(sId, myRid);

    Logger.log("waiting for call...");

    client.subscribeItem(receiveData, strategy, null);
    event = client.getNextEvent();

    Logger.log("incoming call...");

    if (event.getType() == EventType.PUBLISHED_DATA) {
      msg = event.getDataCopy();
    }

    otherEndId = new ByteIdentifier(msg);

    msgSeqNum++;

    client.publishRootScope(b, strategy, null);
View Full Code Here

   * derived from his name.
   */
  public void makeCall(String caller, String callee)
      throws NoSuchAlgorithmException, UnsupportedEncodingException {

    myRid = new ByteIdentifier(Utility.sha1(caller));
    otherEndId = new ByteIdentifier(Utility.sha1(callee));
    sId = new ScopeID();
    ByteIdentifier b = new ByteIdentifier(Utility.sha1(otherEndId.getId()));
    sId.addSegment(b);
    ItemName sendData = new ItemName(sId, otherEndId);

    client.publishRootScope(b, strategy, null);
    Logger.log("Calling " + callee);
View Full Code Here

  }

  public void addParticipant(String participantName)
      throws NoSuchAlgorithmException, UnsupportedEncodingException {

    ByteIdentifier participantId = new ByteIdentifier(
        Utility.sha1(participantName));
    participants.add(participantId);

    client.publishRootScope(sId.get(0), strategy, null);

    ItemName updateData;

    for (int i = 0; i < participants.size(); i++) {

      updateData = new ItemName(sId, participants.get(i));

      System.out.println("Sending new participant to all...");
      Logger.log("Adding " + participantName + " to the conversation...");
      client.publishItem(updateData, strategy, null);
      event = client.getNextEvent();
      System.out.println("got a notification");

      prepareHeader(MsgType.NEWPART);

      System.arraycopy(participantId, 0, sendMsg, 1,
          participantId.length());

      if (event.getType() == EventType.START_PUBLISH) {

        client.publishData(event.getId(), sendMsg, strategy, null);
        System.out.println("New participant sent...");
View Full Code Here

    configure();
  }

  public PPChannelSender(String seed, ByteIdentifier rid, BlackAdderClient ba)
      throws UnsupportedEncodingException, NoSuchAlgorithmException {
    this.rid = new ByteIdentifier(Utility.sha1(seed));
    this.scope = new ScopeID();
    scope.addSegment(new ByteIdentifier(Utility.sha1(rid.getId())));
    this.ba = ba;
    configure();
  }
View Full Code Here

   
    BlackadderWrapper.configureObjectFile(sharedObjPath);
   
    BlackAdderClient client = BlackAdderClient.getInstance();
    ScopeID rootScope = new ScopeID();
    ByteIdentifier rootScopeId = new ByteIdentifier((byte)0, 8);
    rootScope.addSegment(rootScopeId);
   
    client.publishRootScope(rootScopeId, Strategy.NODE, null);
   
    ByteIdentifier rid = new ByteIdentifier((byte)1, 8);
    ItemName name = new ItemName(rootScope, rid);
   
    System.out.println("Publishing");
    client.publishItem(name, Strategy.NODE, null);
    System.out.println("done");
View Full Code Here

    String sharedObjPath = "lib/bindings/java-binding/jni/eu_pursuit_client_BlackadderWrapper.o";
    BlackadderWrapper.configureObjectFile(sharedObjPath);
   
    BlackAdderClient client = BlackAdderClient.getInstance();
    ScopeID rootScope = new ScopeID();
    rootScope.addSegment(new ByteIdentifier((byte)0, 8));
   
    ByteIdentifier rid = new ByteIdentifier((byte)1, 8);
    ItemName name = new ItemName(rootScope, rid);
   
    client.subscribeItem(name, Strategy.NODE, null);
   
    System.out.println("Subscribing");   
View Full Code Here

TOP

Related Classes of eu.pursuit.core.ByteIdentifier

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.