public Map<String, TransferSpeed> getTransferSpeeds() {
   Map<String, TransferSpeed> result = new HashMap<String, TransferSpeed>();
   for (String sid : streamMgr.getLiveStreamIds()) {
     int upload = flowRateMgr.getBroadcastingFlowRate(sid);
     int download = flowRateMgr.getListeningFlowRate(sid);
     if (upload > 0 || download > 0) result.put(sid, new TransferSpeed(sid, download, upload));
   }
   return result;
 }
 /** @syncpriority 200 */
 public void stop() throws MinaException {
   log.fatal("Mina instance stopping");
   ccm.prepareForShutdown();
   scm.closeAllStreamConns();
   streamMgr.stop();
   sourceMgr.stop();
   streamAdvertiser.cancel();
   ccm.stop();
   netMgr.stop();
   badNodes.clear();
   started = false;
   log.fatal("Mina instance stopped");
 }
 public void setAllStreamVelocitiesExcept(String streamId, StreamVelocity sv) {
   String[] receivingSids = streamMgr.getReceivingStreamIds();
   // After the velocity is changed, we might want to inc/dec our bid to our sources
   Set<String> rebidNodeIds = new HashSet<String>();
   for (String sid : receivingSids) {
     if (!sid.equals(streamId)) {
       bidStrategy.setStreamVelocity(sid, sv);
       for (LCPair lcp : scm.getListenConns(sid)) {
         rebidNodeIds.add(lcp.getCC().getNodeId());
       }
     }
   }
   for (String nodeId : rebidNodeIds) {
     buyMgr.possiblyRebid(nodeId);
   }
 }
 /**
  * The stream priority dictates the importance of streams relative to each other (higher is more
  * important)
  */
 public void setStreamPriority(String streamId, int priority) {
   streamMgr.setPriority(streamId, priority);
 }
 public void clearStreamPriorities() {
   streamMgr.clearStreamPriorities();
 }
 public Set<Node> getKnownSources(String sid) {
   return streamMgr.getKnownSources(sid);
 }
 public void removeFoundSourceListener(String sid, FoundSourceListener listener) {
   streamMgr.removeFoundSourceListener(sid, listener);
 }
 public void addFoundSourceListener(String sid, FoundSourceListener listener) {
   streamMgr.addFoundSourceListener(sid, listener);
 }
 public int numSources(String sid) {
   return streamMgr.numSources(sid);
 }
Exemple #10
0
 public Set<String> getSources(String sid) {
   return streamMgr.getSourceNodeIds(sid);
 }
Exemple #11
0
 public void stopReception(String sid) {
   streamMgr.stopReception(sid);
 }
Exemple #12
0
 public void startReception(String sid, StreamVelocity sv) {
   bidStrategy.setStreamVelocity(sid, sv);
   streamMgr.startReception(sid);
 }
Exemple #13
0
 public void stopBroadcast(String sid) {
   streamMgr.stopBroadcast(sid);
 }
Exemple #14
0
 @Override
 public void startBroadcasts(Collection<String> sids) {
   streamMgr.startBroadcasts(sids);
 }