no.ntnu.item.router.utilities
Class ActionPlaneSessions

java.lang.Object
  extended by no.ntnu.item.router.utilities.ActionPlaneSessions

public class ActionPlaneSessions
extends java.lang.Object

The responsibility of this class is to make a list of ServiceSession that the user has set a target bit rate for. These are the ServiceSession objects that AP should care about. Every time ServiceSessionBank is updated it needs to run through the elements. It then selects the ones that the router should perform action on/for.
This list should then be communicated to the Thread actually responsible
for continuous communication with the AP layer.

Author:
Kristian Haugene

Field Summary
private  ActionReasoner actionReasoner
          The reasoner to call when the list of sessions is changed
private  java.util.List<ServiceSession> markedSessions
          The list of ServiceSession objects relevant to AP
 
Constructor Summary
ActionPlaneSessions(ActionReasoner actionReasoner)
          Constructor.
 
Method Summary
private  java.lang.Boolean areServiceSessionsChanged(java.util.List<ServiceSession> oldList, java.util.List<ServiceSession> newList)
          This method checks two lists of ServiceSession objects to see if they contain the same elements
private  java.util.List<ServiceSession> getApSessionsFromNewList(java.util.List<ServiceSession> updatedList)
          Extracts a list of ServiceSession objects that have a target bit rate set
 void reportChangeInServiceSessionList(java.util.List<ServiceSession> updatedList)
          This method should be called when a change occurs in ServiceSessionBank.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

markedSessions

private java.util.List<ServiceSession> markedSessions
The list of ServiceSession objects relevant to AP


actionReasoner

private ActionReasoner actionReasoner
The reasoner to call when the list of sessions is changed

Constructor Detail

ActionPlaneSessions

public ActionPlaneSessions(ActionReasoner actionReasoner)
Constructor. Takes a ActionReasoner as parameter.
ActionReasoner will be called when changes markedSessions occur

Parameters:
actionReasoner - to call when changes occur
Method Detail

reportChangeInServiceSessionList

public void reportChangeInServiceSessionList(java.util.List<ServiceSession> updatedList)
This method should be called when a change occurs in ServiceSessionBank. When changes occur, the list obtained by might have to be updated accordingly.

Parameters:
updatedList - the new list of ServiceSession objects

getApSessionsFromNewList

private java.util.List<ServiceSession> getApSessionsFromNewList(java.util.List<ServiceSession> updatedList)
Extracts a list of ServiceSession objects that have a target bit rate set

Parameters:
updatedList - the list to iterate
Returns:
the subset that have target bit rate set

areServiceSessionsChanged

private java.lang.Boolean areServiceSessionsChanged(java.util.List<ServiceSession> oldList,
                                                    java.util.List<ServiceSession> newList)
This method checks two lists of ServiceSession objects to see if they contain the same elements

Parameters:
oldList - the first list
newList - the new list
Returns:
true if the two lists have an equal number of objects and the objects are the same in both lists. False otherwise