Package org.onosproject.net
Class DefaultDisjointPath
- java.lang.Object
-
- org.onosproject.net.AbstractAnnotated
-
- org.onosproject.net.AbstractModel
-
- org.onosproject.net.AbstractProjectableModel
-
- org.onosproject.net.DefaultLink
-
- org.onosproject.net.DefaultPath
-
- org.onosproject.net.DefaultDisjointPath
-
- All Implemented Interfaces:
Annotated,DisjointPath,Projectable,Link,NetworkResource,Path,Provided
public class DefaultDisjointPath extends DefaultPath implements DisjointPath
Default implementation of a network disjoint path pair.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.onosproject.net.DefaultLink
DefaultLink.Builder
-
Nested classes/interfaces inherited from class org.onosproject.net.AbstractProjectableModel
AbstractProjectableModel.AnnotationDriverData
-
Nested classes/interfaces inherited from interface org.onosproject.net.Link
Link.State, Link.Type
-
-
Field Summary
-
Fields inherited from class org.onosproject.net.AbstractProjectableModel
NO_DRIVER, NO_DRIVER_SERVICE
-
-
Constructor Summary
Constructors Constructor Description DefaultDisjointPath(ProviderId providerId, DefaultPath path1)Creates a disjoint path pair from single default paths.DefaultDisjointPath(ProviderId providerId, DefaultPath path1, DefaultPath path2)Creates a disjoint path pair from two default paths.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pathbackup()Gets secondary path.doublecost()Returns the path cost as a unit-less value.booleanequals(java.lang.Object obj)inthashCode()java.util.List<Link>links()Returns sequence of links comprising the path.Pathprimary()Gets primary path.Weightweight()Returns the path cost as an weight instance.-
Methods inherited from class org.onosproject.net.DefaultPath
toString
-
Methods inherited from class org.onosproject.net.DefaultLink
builder, dst, isExpected, src, state, type
-
Methods inherited from class org.onosproject.net.AbstractProjectableModel
as, asData, bindAndCheckDriver, bindDriver, driver, driverService, is, locateDriver, setDriverService
-
Methods inherited from class org.onosproject.net.AbstractModel
providerId
-
Methods inherited from class org.onosproject.net.AbstractAnnotated
annotations
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.onosproject.net.Annotated
annotations
-
Methods inherited from interface org.onosproject.net.driver.Projectable
as, is, project
-
Methods inherited from interface org.onosproject.net.Provided
providerId
-
-
-
-
Constructor Detail
-
DefaultDisjointPath
public DefaultDisjointPath(ProviderId providerId, DefaultPath path1, DefaultPath path2)
Creates a disjoint path pair from two default paths.- Parameters:
providerId- provider identitypath1- primary pathpath2- backup path
-
DefaultDisjointPath
public DefaultDisjointPath(ProviderId providerId, DefaultPath path1)
Creates a disjoint path pair from single default paths.- Parameters:
providerId- provider identitypath1- primary path
-
-
Method Detail
-
links
public java.util.List<Link> links()
Description copied from interface:PathReturns sequence of links comprising the path.- Specified by:
linksin interfacePath- Overrides:
linksin classDefaultPath- Returns:
- list of links
-
cost
public double cost()
Description copied from interface:PathReturns the path cost as a unit-less value.- Specified by:
costin interfacePath- Overrides:
costin classDefaultPath- Returns:
- unit-less path cost
-
weight
public Weight weight()
Description copied from interface:PathReturns the path cost as an weight instance.- Specified by:
weightin interfacePath- Overrides:
weightin classDefaultPath- Returns:
- weight path cost
-
primary
public Path primary()
Description copied from interface:DisjointPathGets primary path.- Specified by:
primaryin interfaceDisjointPath- Returns:
- primary path
-
backup
public Path backup()
Description copied from interface:DisjointPathGets secondary path.- Specified by:
backupin interfaceDisjointPath- Returns:
- secondary path, or null if there is no secondary path available.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDefaultPath
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classDefaultPath
-
-