Package eu.pursuit.core

Examples of eu.pursuit.core.ItemName


    // Get a handle on the video
    System.err.println("Requested " + vs.getAbsolutePath());
    // Implement the video strategy.
    videoRunner = new VideoRunner(vs.getAbsolutePath(), ds.getLocalPort());
    videoRunner.start();
    ItemName newPubName = ItemName.parseSerializedName(rID, ScopeID.SEGMENT_SIZE);
    try {
      DatagramPacket p = null;
      do{
        int buffer_size = 1316;
        byte[] buffer = new byte[buffer_size];
View Full Code Here


  }
 
  public boolean publishVideo(String rid, String path) throws DecoderException{
    try{
        ByteIdentifier newPubID = new ByteIdentifier(Hex.decodeHex(rid.toCharArray()));
      ItemName newPubName = new ItemName(superScope, newPubID);
      client.publishItem(newPubName, strategy);
      // Add to the list.
      published.add(newPubName);
      addVideo(new VideoStream(path, getChannelID(), rid));
      return true;
View Full Code Here

  }
 
  public boolean unpublishVideo(String rid) throws DecoderException{
    try{
        ByteIdentifier newPubID = new ByteIdentifier(Hex.decodeHex(rid.toCharArray()));
      ItemName newPubName = new ItemName(superScope, newPubID);
      client.unpublishItem(newPubName, strategy);
      // remove from list
      ItemName marked = null;
      for (ItemName in: published){
        if (Arrays.equals(in.getRendezvousId().getId(), newPubName.getRendezvousId().getId())){
          marked = in;
        }
      }
View Full Code Here

  public boolean publishCatalog() throws DecoderException{
    try {
      String catString = "0000000000000000";
      ByteIdentifier catID = new ByteIdentifier(Hex.decodeHex(catString.toCharArray()));
      catName = new ItemName(superScope, catID);
      client.publishItem(catName, strategy);

      return true;
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

  public boolean subscribeCatalog(){ 
    try {
      // Subscribe to the catalog
      String catString = "0000000000000000";
      ByteIdentifier catID = new ByteIdentifier(Hex.decodeHex(catString.toCharArray()));
      catName = new ItemName(superScope, catID);
      client.subscribeItem(catName, strategy);
      return true;
    } catch (Exception e) {
      e.printStackTrace();
      return false;
View Full Code Here

  public boolean unsubscribeCatalog(){
    try {
      // Subscribe to the catalog
      String catString = "0000000000000000";
      ByteIdentifier catID = new ByteIdentifier(Hex.decodeHex(catString.toCharArray()));
      catName = new ItemName(superScope, catID);
      client.unsubscribeItem(catName, strategy);
      return true;
    } catch (Exception e) {
      e.printStackTrace();
      return false;
View Full Code Here

 
  public boolean subscribeVideo(String rid){
    try {
      // Subscribe to the video
      ByteIdentifier vidID = new ByteIdentifier(Hex.decodeHex(rid.toCharArray()));
      ItemName vidName = new ItemName(superScope, vidID);
      client.subscribeItem(vidName, strategy);
      subscribed.add(vidName);
      return true;
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

 
  public boolean unsubscribeVideo(String rid){
    try {
      // Subscribe to the video
      ByteIdentifier vidID = new ByteIdentifier(Hex.decodeHex(rid.toCharArray()));
      ItemName vidName = new ItemName(superScope, vidID);
      client.unsubscribeItem(vidName, strategy);
      // remove from list
      ItemName marked = null;
      for (ItemName in: subscribed){
        if (Arrays.equals(in.getRendezvousId().getId(), vidName.getRendezvousId().getId())){
          marked = in;
        }
      }
View Full Code Here

  public PPChannelReceiver(ScopeID scope, ByteIdentifier rid,
      BlackAdderClient ba) {
    this.scope = scope;
    this.rid = rid;
    this.ba = ba;
    this.receiveData = new ItemName(scope, rid);
  }
View Full Code Here

    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);

    ItemName sendData = new ItemName(sId, otherEndId);

    Logger.log("Sending response to caller...");
    client.publishItem(sendData, strategy, null);
    event = client.getNextEvent();
View Full Code Here

TOP

Related Classes of eu.pursuit.core.ItemName

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.