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 Path
backup()
Gets secondary path.double
cost()
Returns the path cost as a unit-less value.boolean
equals(java.lang.Object obj)
int
hashCode()
java.util.List<Link>
links()
Returns sequence of links comprising the path.Path
primary()
Gets primary path.Weight
weight()
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:Path
Returns sequence of links comprising the path.- Specified by:
links
in interfacePath
- Overrides:
links
in classDefaultPath
- Returns:
- list of links
-
cost
public double cost()
Description copied from interface:Path
Returns the path cost as a unit-less value.- Specified by:
cost
in interfacePath
- Overrides:
cost
in classDefaultPath
- Returns:
- unit-less path cost
-
weight
public Weight weight()
Description copied from interface:Path
Returns the path cost as an weight instance.- Specified by:
weight
in interfacePath
- Overrides:
weight
in classDefaultPath
- Returns:
- weight path cost
-
primary
public Path primary()
Description copied from interface:DisjointPath
Gets primary path.- Specified by:
primary
in interfaceDisjointPath
- Returns:
- primary path
-
backup
public Path backup()
Description copied from interface:DisjointPath
Gets secondary path.- Specified by:
backup
in interfaceDisjointPath
- Returns:
- secondary path, or null if there is no secondary path available.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classDefaultPath
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classDefaultPath
-
-