be.ac.ulg.montefiore.run.totem.domain.model.impl
Class LspImpl

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.domain.model.jaxb.impl.LspImpl
      extended by be.ac.ulg.montefiore.run.totem.domain.model.impl.LspImpl
All Implemented Interfaces:
DomainElement, Lsp, UnmarshallableObject, ValidatableObject, XMLSerializable, com.sun.xml.bind.JAXBObject
Direct Known Subclasses:
ExtendedLsp

public class LspImpl
extends LspImpl
implements Lsp

A Label Switched Path in a Domain A LspImpl is in UP state when all its links are UP. It is in DOWN state when one of its link is DOWN. Change in link status are signalled through the "nodeUpEvent"-like methods

Creation date: 19-Jan-2005 15:47:36

Author:
Fabian Skivee (skivee@run.montefiore.ulg.ac.be), Olivier Delcourt(delcourt@run.montefiore.ulg.ac.be)

Nested Class Summary
 
Nested classes/interfaces inherited from class be.ac.ulg.montefiore.run.totem.domain.model.jaxb.impl.LspImpl
LspImpl.AcceptedCosTypeImpl, LspImpl.BackupTypeImpl, LspImpl.DiffServTypeImpl, LspImpl.PathTypeImpl, LspImpl.Unmarshaller
 
Nested classes/interfaces inherited from interface be.ac.ulg.montefiore.run.totem.domain.model.jaxb.Lsp
Lsp.AcceptedCosType, Lsp.BackupType, Lsp.DiffServType, Lsp.PathType
 
Field Summary
 
Fields inherited from class be.ac.ulg.montefiore.run.totem.domain.model.jaxb.impl.LspImpl
_AcceptedCos, _Backup, _Bw, _DiffServ, _Id, _MaxRate, _Metric, _Path, has_Bw, has_MaxRate, has_Metric, version
 
Fields inherited from interface be.ac.ulg.montefiore.run.totem.domain.model.Lsp
BYPASS_BACKUP_TYPE, DETOUR_E2E_BACKUP_TYPE, DETOUR_LOCAL_BACKUP_TYPE, STATUS_DOWN, STATUS_UP
 
Constructor Summary
LspImpl()
           
LspImpl(Domain domain, java.lang.String id, float reservation, Path path)
          Basic constructor to create a LSP with a bandwidth and a path
LspImpl(Domain domain, java.lang.String backupId, float bw, Path path, java.util.Collection<Link> protectedLinks)
          Advanced constructor to create a backup bypass lsp.
LspImpl(Domain domain, java.lang.String backupId, float bw, Path path, java.util.Collection<Link> protectedLinks, int classType)
          Advanced constructor to create a backup bypass lsp, specifying the classtype
LspImpl(Domain domain, java.lang.String backupId, float bw, Path path, java.util.Collection<Link> protectedLinks, int classType, int holdingPreemption, int setupPreemption)
          Advanced constructor to create a backup bypass lsp, specifying diffserv parameters
LspImpl(Domain domain, java.lang.String id, float reservation, Path path, int classType, int holdingPreemption, int setupPreemption)
          More advanced constructor to create a primary lsp with all diffserv parameters.
LspImpl(Domain domain, java.lang.String protectedLspId, java.lang.String backupId, Path path, LspBackupType lspBackupType, java.util.Collection<Link> protectedLinks)
          Advanced constructor to create a detour backup lsp.
 
Method Summary
 boolean acceptClassOfService(java.lang.String name)
           
 void activateBackup(Lsp backupLsp)
           
 void addAcceptedClassOfService(java.lang.String name)
           
 void addBackupLsp(Lsp lsp)
          Add a lsp in the list of backup lsps of this primary lsp.
 void deactivateBackup(Lsp backupLsp)
           
 boolean equals(java.lang.Object o)
          Two LSPs are equal if they belong to the same domain and have the same id.
 java.util.List<java.lang.String> getAcceptedClassesOfService()
           
 java.util.List<Lsp> getActivatedBackups()
          Returns a list of activated backup sorted by ingress
 java.util.Set<Lsp> getBackups()
          returns a set of the backups lsps
 int getBackupType()
          If the LSP is a backup LSP, get the type of Backup : Lsp.DETOUR_E2E_BACKUP_TYPE if end to end detour backup Lsp.DETOUR_LOCAL_BACKUP_TYPE if local detour backup Lsp.BYPASS_BACKUP_TYPE if bypass backup -1 otherwise
 int getCT()
          Gets the DiffServ class type of the LSP, the diffserv class of the primary lsp if it is a backup, or the class type of the minimum priority if it is not defined.
 Domain getDomain()
          returns the associated domain
 int getHoldingPreemption()
          Gets the holding preemption level of the LSP, the holding preemption level of the primary lsp if it is a backup, or the holding preemption level of the minimum priority if it is not defined.
 Path getLspPath()
          Get the path of the LSP
 int getLspStatus()
           
 java.util.List<Link> getProtectedLinks()
          If the LSP is a backup LSP and protect one or more links, this method return the list of protected links and null otherwise.
 Lsp getProtectedLsp()
          If the LSP is a backup LSP and protect a particular LSP, this method return this protected LSP and null otherwise.
 float getReservation()
          Get the reservation of a LSP
 int getSetupPreemption()
          Gets the setup preemption level of the LSP, the setup preemption level of the primary lsp if it is a backup, or the setup preemption level of the minimum priority if it is not defined.
 Path getWorkingPath()
          Returns a path for the LSP that is routable, i.e.
 Path getWorkingPath(boolean nocheck)
          If nocheck is true, returns the current working path even if some links are down.
 int hashCode()
           
 void init(Domain domain)
          Initialise the LSP : set a reference to the domain and create the LSP path.
 boolean isBackupLsp()
          True if the LSP is a backup LSP and false otherwise
 boolean isBypassLsp()
           
 boolean isDetourActivated()
           
 boolean isDetourLsp()
           
 void linkDownEvent(Link link)
          Maintain the status of the lsp.
 void linkUpEvent(Link link)
           
 void makePrimary()
           
 void nodeDownEvent(Node node)
           
 void nodeUpEvent(Node node)
           
 void removeAcceptedClassOfService(java.lang.String name)
           
 void removeBackupLsp(Lsp lsp)
          Removes a LSP for the list of backups
 void setDomain(Domain domain)
          Set the domain reference
 void setElementId(java.lang.String id)
          Sets the id of the element.
 void setInitParameters(LSPRoutingParameter param)
          Initilise the lsp with the given parameters
 void setLspPath(Path path)
          Set a new path for a LSP.
 void setProtectedLsp(java.lang.String lspId)
           
 void setReservation(float bw)
          Change the reservation of the lsp.
 
Methods inherited from class be.ac.ulg.montefiore.run.totem.domain.model.jaxb.impl.LspImpl
createRawValidator, createUnmarshaller, getAcceptedCos, getBackup, getBw, getDiffServ, getId, getMaxRate, getMetric, getPath, getPrimaryInterface, isSetAcceptedCos, isSetBackup, isSetBw, isSetDiffServ, isSetId, isSetMaxRate, isSetMetric, isSetPath, serializeAttributes, serializeBody, serializeURIs, setAcceptedCos, setBackup, setBw, setDiffServ, setId, setMaxRate, setMetric, setPath, unsetAcceptedCos, unsetBackup, unsetBw, unsetDiffServ, unsetId, unsetMaxRate, unsetMetric, unsetPath
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface be.ac.ulg.montefiore.run.totem.domain.model.Lsp
getMaxRate, getMetric
 
Methods inherited from interface be.ac.ulg.montefiore.run.totem.domain.model.DomainElement
getId
 

Constructor Detail

LspImpl

public LspImpl()

LspImpl

public LspImpl(Domain domain,
               java.lang.String id,
               float reservation,
               Path path)
Basic constructor to create a LSP with a bandwidth and a path

Parameters:
domain -
reservation -
path -

LspImpl

public LspImpl(Domain domain,
               java.lang.String id,
               float reservation,
               Path path,
               int classType,
               int holdingPreemption,
               int setupPreemption)
        throws DiffServConfigurationException
More advanced constructor to create a primary lsp with all diffserv parameters.

Parameters:
domain -
id -
reservation -
path -
classType -
holdingPreemption -
setupPreemption -
Throws:
DiffServConfigurationException

LspImpl

public LspImpl(Domain domain,
               java.lang.String protectedLspId,
               java.lang.String backupId,
               Path path,
               LspBackupType lspBackupType,
               java.util.Collection<Link> protectedLinks)
Advanced constructor to create a detour backup lsp.

Parameters:
domain -
protectedLspId -
backupId -
lspBackupType - should be LspBackupType.DETOUR_LOCAL or LspBackupType.DETOUR_E_2_E
protectedLinks -

LspImpl

public LspImpl(Domain domain,
               java.lang.String backupId,
               float bw,
               Path path,
               java.util.Collection<Link> protectedLinks)
Advanced constructor to create a backup bypass lsp.

Parameters:
domain -
backupId -
protectedLinks -

LspImpl

public LspImpl(Domain domain,
               java.lang.String backupId,
               float bw,
               Path path,
               java.util.Collection<Link> protectedLinks,
               int classType)
        throws DiffServConfigurationException
Advanced constructor to create a backup bypass lsp, specifying the classtype

Parameters:
domain -
backupId -
protectedLinks -
Throws:
DiffServConfigurationException

LspImpl

public LspImpl(Domain domain,
               java.lang.String backupId,
               float bw,
               Path path,
               java.util.Collection<Link> protectedLinks,
               int classType,
               int holdingPreemption,
               int setupPreemption)
        throws DiffServConfigurationException
Advanced constructor to create a backup bypass lsp, specifying diffserv parameters

Parameters:
domain -
backupId -
protectedLinks -
Throws:
DiffServConfigurationException
Method Detail

init

public void init(Domain domain)
          throws InvalidPathException,
                 DiffServConfigurationException
Initialise the LSP : set a reference to the domain and create the LSP path. This method must be called prior to usage of the instance. Also checks if the priority is defined in the domain.

Parameters:
domain - The domain to which the LSP belongs
Throws:
InvalidPathException - if the path is invalid (not continuous or if a link or node cannot be found)
DiffServConfigurationException - if the setup or holding priority is not defined in the domain.

setInitParameters

public void setInitParameters(LSPRoutingParameter param)
                       throws java.lang.IllegalArgumentException
Initilise the lsp with the given parameters

Parameters:
param -
Throws:
java.lang.IllegalArgumentException

setElementId

public void setElementId(java.lang.String id)
                  throws IdException
Description copied from interface: DomainElement
Sets the id of the element.

Specified by:
setElementId in interface DomainElement
Throws:
IdException

getDomain

public Domain getDomain()
Description copied from interface: DomainElement
returns the associated domain

Specified by:
getDomain in interface DomainElement
Returns:

setReservation

public void setReservation(float bw)
                    throws LinkCapacityExceededException
Change the reservation of the lsp.

Parameters:
bw -
Throws:
LinkCapacityExceededException

getReservation

public float getReservation()
Get the reservation of a LSP

Returns:

getLspPath

public Path getLspPath()
Get the path of the LSP

Returns:
the path

getWorkingPath

public Path getWorkingPath(boolean nocheck)
                    throws InvalidPathException
If nocheck is true, returns the current working path even if some links are down. Else, returns the working path.
The working path is the current path used for routing on this LSP. It is different from the normal path since the lsp can be routed temporarily on backups.

Parameters:
nocheck -
Returns:
Throws:
InvalidPathException

getWorkingPath

public Path getWorkingPath()
                    throws InvalidPathException
Returns a path for the LSP that is routable, i.e. a path where all links are up.

Returns:
Throws:
InvalidPathException - If no path can be found

getActivatedBackups

public java.util.List<Lsp> getActivatedBackups()
Returns a list of activated backup sorted by ingress

Returns:

isDetourActivated

public boolean isDetourActivated()

activateBackup

public void activateBackup(Lsp backupLsp)
                    throws LspNotFoundException
Throws:
LspNotFoundException

deactivateBackup

public void deactivateBackup(Lsp backupLsp)
                      throws LspNotFoundException
Throws:
LspNotFoundException

linkDownEvent

public void linkDownEvent(Link link)
Maintain the status of the lsp.

Parameters:
link -

nodeDownEvent

public void nodeDownEvent(Node node)

linkUpEvent

public void linkUpEvent(Link link)

nodeUpEvent

public void nodeUpEvent(Node node)

setLspPath

public void setLspPath(Path path)
Set a new path for a LSP. also sets the status according to the node/links status

Parameters:
path -

setDomain

public void setDomain(Domain domain)
Set the domain reference

Parameters:
domain -

getCT

public int getCT()
Gets the DiffServ class type of the LSP, the diffserv class of the primary lsp if it is a backup, or the class type of the minimum priority if it is not defined.

Returns:

getHoldingPreemption

public int getHoldingPreemption()
Gets the holding preemption level of the LSP, the holding preemption level of the primary lsp if it is a backup, or the holding preemption level of the minimum priority if it is not defined.

Returns:

getSetupPreemption

public int getSetupPreemption()
Gets the setup preemption level of the LSP, the setup preemption level of the primary lsp if it is a backup, or the setup preemption level of the minimum priority if it is not defined.

Returns:

isBackupLsp

public boolean isBackupLsp()
True if the LSP is a backup LSP and false otherwise

Returns:
True if the LSP is a backup LSP and false otherwise

isDetourLsp

public boolean isDetourLsp()

isBypassLsp

public boolean isBypassLsp()

getBackupType

public int getBackupType()
If the LSP is a backup LSP, get the type of Backup :

Returns:
the type of backup LSP

getProtectedLsp

public Lsp getProtectedLsp()
                    throws LspNotFoundException
If the LSP is a backup LSP and protect a particular LSP, this method return this protected LSP and null otherwise.

Returns:
Throws:
LspNotFoundException

setProtectedLsp

public void setProtectedLsp(java.lang.String lspId)
                     throws BadLspTypeException
Throws:
BadLspTypeException

getProtectedLinks

public java.util.List<Link> getProtectedLinks()
                                       throws LinkNotFoundException
If the LSP is a backup LSP and protect one or more links, this method return the list of protected links and null otherwise.

Returns:
Throws:
LinkNotFoundException

equals

public boolean equals(java.lang.Object o)
Two LSPs are equal if they belong to the same domain and have the same id.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

addBackupLsp

public void addBackupLsp(Lsp lsp)
Add a lsp in the list of backup lsps of this primary lsp. This method should not be called directly.

Parameters:
lsp - Backup LSP to add to this primary
Throws:
java.lang.IllegalArgumentException - if the given lsp does not correspond to a backup lsp of this one

removeBackupLsp

public void removeBackupLsp(Lsp lsp)
                     throws LspNotFoundException
Removes a LSP for the list of backups

Parameters:
lsp -
Throws:
LspNotFoundException

getBackups

public java.util.Set<Lsp> getBackups()
returns a set of the backups lsps

Returns:

makePrimary

public void makePrimary()

getLspStatus

public int getLspStatus()

addAcceptedClassOfService

public void addAcceptedClassOfService(java.lang.String name)
                               throws ClassOfServiceNotFoundException,
                                      ClassOfServiceAlreadyExistException
Throws:
ClassOfServiceNotFoundException
ClassOfServiceAlreadyExistException

removeAcceptedClassOfService

public void removeAcceptedClassOfService(java.lang.String name)
                                  throws ClassOfServiceNotFoundException
Throws:
ClassOfServiceNotFoundException

getAcceptedClassesOfService

public java.util.List<java.lang.String> getAcceptedClassesOfService()

acceptClassOfService

public boolean acceptClassOfService(java.lang.String name)


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.