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