View Javadoc

1   package org.musicontroller.gui.statistics;
2   
3   import java.util.Collection;
4   
5   import org.apache.tapestry.IExternalPage;
6   import org.apache.tapestry.IRequestCycle;
7   import org.apache.tapestry.html.BasePage;
8   import org.musicontroller.dao.Dao;
9   import org.musicontroller.security.IUser;
10  import org.musicontroller.streaming.StreamMaster;
11  
12  /**
13   * @author Arjan Verstoep
14   * @version $Id: Bandwidth.java,v 1.1 2010/03/16 18:55:42 varienaja Exp $
15   * 
16   * TODO This page does not function anymore. I have to program a Tomcat-filter
17   * to count bytes, the construction before was too messy.
18   */
19  public abstract class Bandwidth extends BasePage implements IExternalPage {
20  	public abstract Dao getDao();
21  
22  	public abstract Long getUserid();
23  	public abstract void setUserid(Long userid);
24  
25  	public Collection<Long> getUserIDs() {
26  		return StreamMaster.getUserIDs();
27  	}
28  	
29  	public String getUsername() {
30  		IUser user = getDao().getUserById(getUserid());
31  		return user.getLoginname();
32  	}
33  	
34  	public long getBytesconsumed() {
35  		return 0L;
36  		//return StreamMaster.getStatisticsByUserId(getUserid()).getBytesWritten();
37  	}
38  	
39  	public int getBitrate() {
40  		return 0;
41  		//return StreamMaster.getStatisticsByUserId(getUserid()).getBitrate();
42  	}
43  
44  	public void activateExternalPage(Object[] args, IRequestCycle cycle) {
45  		//no params expected
46  	}
47  
48  }