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

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.BackupTypeImpl, LspImpl.DiffServTypeImpl, LspImpl.PathTypeImpl, LspImpl.Unmarshaller
 
Nested classes/interfaces inherited from interface be.ac.ulg.montefiore.run.totem.domain.model.jaxb.Lsp
Lsp.BackupType, Lsp.DiffServType, Lsp.PathType
 
Field Summary
 
Fields inherited from class be.ac.ulg.montefiore.run.totem.domain.model.jaxb.impl.LspImpl
_Backup, _Bw, _DiffServ, _Id, _MaxRate, _Metric, _Path, _Status, 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 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 backup lsp.
 
Method Summary
 void addBackupLsp(Lsp lsp)
          Add a lsp in the list of backup lsps of this primary lsp.
 boolean equals(java.lang.Object o)
          Two LSPs are equal if they belong to the same domain and have the same id.
 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.
 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.
 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
 void makePrimary()
           
 void removeBackupLsp(Lsp lsp)
          Removes a LSP for the list of backups
 void setDomain(Domain domain)
          Set the domain reference
 void setLspId(java.lang.String id)
           
 void setLspPath(Path path)
          Set a new path for a LSP
 void setLspStatus(int status)
           
 void setProtectedLsp(java.lang.String lspId)
           
 void setReservation(float bw)
           
 
Methods inherited from class be.ac.ulg.montefiore.run.totem.domain.model.jaxb.impl.LspImpl
createRawValidator, createUnmarshaller, getBackup, getBw, getDiffServ, getId, getMaxRate, getMetric, getPath, getPrimaryInterface, getStatus, isSetBackup, isSetBw, isSetDiffServ, isSetId, isSetMaxRate, isSetMetric, isSetPath, isSetStatus, serializeAttributes, serializeBody, serializeURIs, setBackup, setBw, setDiffServ, setId, setMaxRate, setMetric, setPath, setStatus, unsetBackup, unsetBw, unsetDiffServ, unsetId, unsetMaxRate, unsetMetric, unsetPath, unsetStatus
 
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 backup lsp.

Parameters:
domain -
protectedLspId -
backupId -
lspBackupType -
protectedLinks -
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.

setLspId

public void setLspId(java.lang.String id)
              throws BadLspTypeException
Throws:
BadLspTypeException

setReservation

public void setReservation(float bw)
                    throws LinkCapacityExceededException
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

setLspPath

public void setLspPath(Path path)
Set a new path for a LSP

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

getBackupType

public 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

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()

setLspStatus

public void setLspStatus(int status)
                  throws StatusTypeException
Throws:
StatusTypeException


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