Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 /** @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");
 }
Esempio n. 3
0
 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);
   }
 }
Esempio n. 4
0
 /**
  * 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);
 }
Esempio n. 5
0
 public void clearStreamPriorities() {
   streamMgr.clearStreamPriorities();
 }
Esempio n. 6
0
 public Set<Node> getKnownSources(String sid) {
   return streamMgr.getKnownSources(sid);
 }
Esempio n. 7
0
 public void removeFoundSourceListener(String sid, FoundSourceListener listener) {
   streamMgr.removeFoundSourceListener(sid, listener);
 }
Esempio n. 8
0
 public void addFoundSourceListener(String sid, FoundSourceListener listener) {
   streamMgr.addFoundSourceListener(sid, listener);
 }
Esempio n. 9
0
 public int numSources(String sid) {
   return streamMgr.numSources(sid);
 }
Esempio n. 10
0
 public Set<String> getSources(String sid) {
   return streamMgr.getSourceNodeIds(sid);
 }
Esempio n. 11
0
 public void stopReception(String sid) {
   streamMgr.stopReception(sid);
 }
Esempio n. 12
0
 public void startReception(String sid, StreamVelocity sv) {
   bidStrategy.setStreamVelocity(sid, sv);
   streamMgr.startReception(sid);
 }
Esempio n. 13
0
 public void stopBroadcast(String sid) {
   streamMgr.stopBroadcast(sid);
 }
Esempio n. 14
0
 @Override
 public void startBroadcasts(Collection<String> sids) {
   streamMgr.startBroadcasts(sids);
 }