|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectno.ntnu.item.router.ServiceSessionBank
public class ServiceSessionBank
This is a registry for all service sessions known to the router.
It contains functionality for handling the ServiceSession
objects and
sorting incoming SilverlightMeasurement
objects.
Field Summary | |
---|---|
private ActionPlaneSessions |
actionPlaneSessions
The ActionPlaneSessions that will keep track of AP sessions |
private GuiXmlWriter |
guiXmlWriter
The GuiXmlWriter that is to be called when changes occur |
private Parser |
parser
Holds the Parser |
private java.util.List<ServiceSession> |
serviceSessions
List of ongoing service sessions known to the Router |
Constructor Summary | |
---|---|
ServiceSessionBank(Parser parser,
GuiXmlWriter guiXmlWriter,
ActionPlaneSessions actionPlaneSessions)
Constructor |
Method Summary | |
---|---|
private void |
addMeasurement(SilverlightMeasurement sm)
Method for adding a SilverlightMeasurement to the bank |
private void |
addMeasurementToExistingServiceSession(SilverlightMeasurement sm)
Given that the measurement is not from a new ServiceSession , adds
the SilverlightMeasurement to the correct ServiceSession |
private void |
createNewServiceSessionAndAddMeasurement(SilverlightMeasurement sm)
Creates a new ServiceSession and adds the
SilverlightMeasurement to it. |
java.util.List<ServiceSession> |
getServiceSessions()
Returns the current list of ServiceSession objects. |
private boolean |
measurementAndServiceSessionHaveSameId(ServiceSession session,
SilverlightMeasurement measurement)
Checks if the given ServiceSession and
SilverlightMeasurement have the same Id |
java.lang.String |
registerMeasurement(java.lang.String measurement)
Register a new SilverlightMeasurement |
void |
registerUserPreferences(java.lang.String userPreferences)
Update user preferences |
private boolean |
serviceSessionWithSameIdExistsInBank(SilverlightMeasurement measurement)
Simple method for checking if a SilverlightMeasurement has an Id
that is equal to a already registered ServiceSession |
private void |
setTargetBitRateToSessionGivenById(java.lang.String clientId,
java.lang.Integer targetBitRate)
Takes cliendId and targetBitRate as parameter. Will set the targetBitRate to the ServiceSession identified by
clientId |
void |
updateGuiXmlAndApSessions()
Method that calls the GuiXmlWriter to write the current state.Should be called when changes occur in the lists. Also notifies the ActionPlaneSessions that a change has occured |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.List<ServiceSession> serviceSessions
private Parser parser
Parser
private GuiXmlWriter guiXmlWriter
GuiXmlWriter
that is to be called when changes occur
private ActionPlaneSessions actionPlaneSessions
ActionPlaneSessions
that will keep track of AP sessions
Constructor Detail |
---|
public ServiceSessionBank(Parser parser, GuiXmlWriter guiXmlWriter, ActionPlaneSessions actionPlaneSessions)
parser
- Method Detail |
---|
public java.lang.String registerMeasurement(java.lang.String measurement)
SilverlightMeasurement
measurement
- string representing a SilverlightMeasurement
public void registerUserPreferences(java.lang.String userPreferences)
userPreferences
- string representationpublic void updateGuiXmlAndApSessions()
GuiXmlWriter
to write the current state.ActionPlaneSessions
that a change has occured
public java.util.List<ServiceSession> getServiceSessions()
ServiceSession
objects.
ServiceSession
objectsprivate void addMeasurement(SilverlightMeasurement sm)
SilverlightMeasurement
to the bank
sm
- SilverlightMeasurement
to addprivate void addMeasurementToExistingServiceSession(SilverlightMeasurement sm)
ServiceSession
, adds
the SilverlightMeasurement
to the correct ServiceSession
sm
- SilverlightMeasurement
to add to existing
ServiceSession
private void createNewServiceSessionAndAddMeasurement(SilverlightMeasurement sm)
ServiceSession
and adds the
SilverlightMeasurement
to it. Also adds the session to the
ServiceSessionBank
list of sessions.
sm
- SilverlightMeasurement
from a new sessionprivate boolean serviceSessionWithSameIdExistsInBank(SilverlightMeasurement measurement)
SilverlightMeasurement
has an Id
that is equal to a already registered ServiceSession
measurement
- SilverlightMeasurement
to check for
private boolean measurementAndServiceSessionHaveSameId(ServiceSession session, SilverlightMeasurement measurement)
ServiceSession
and
SilverlightMeasurement
have the same Id
session
- measurement
-
private void setTargetBitRateToSessionGivenById(java.lang.String clientId, java.lang.Integer targetBitRate)
ServiceSession
identified by
clientId
clientId
- the session idtargetBitRate
- wanted bit rate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |