com.h3c.sdn.misc.net

## Class L2PathDTO

- java.lang.Object
- - com.h3c.sdn.misc.net.L2PathDTO

- All Implemented Interfaces:
    L2Path

      public class L2PathDTO
      extends Object
      implements L2Path

  Represents the path between two switches in a cluster.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.h3c.sdn.common.L2Path

      `L2Path.Metric`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `L2PathDTO()` Creates dummy L2 path.
    `L2PathDTO(DataPathId srcDpid, DataPathId dstDpid)` Creates the L2 path for given source and destination device.
    `L2PathDTO(DataPathId srcDpid, DataPathId dstDpid, List<Link> paths)` Creates L2 path representing all links between the given source and destination device.
    `L2PathDTO(DataPathId srcId, Object... routeElements)` Concise way to instantiate a route.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `compares(L2Path path)`
    `L2Cost` | `cost()` Retrieves the cost of the path.
    `boolean` | `equals(Object obj)`
    `DataPathId` | `from()` Retrieves the datapathid associated to a source device of the L2 Path.
    `int` | `hashCode()`
    `String` | `makeKey()`
    `L2Path.Metric` | `metric()` Returns the type of metric used in computing shortest path.
    `List<Link>` | `path()` Returns the sequence of `links`, which comprise the path.
    `void` | `setCost(L2Cost cost)`
    `DataPathId` | `to()` Retrieves the datapathid associated to a destination device of the L2Path.
    `static L2PathDTO` | `valueOf(String pathStr)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### L2PathDTO

          public L2PathDTO()

      Creates dummy L2 path.

    - #### L2PathDTO

          public L2PathDTO(DataPathId srcDpid,
                   DataPathId dstDpid,
                   List<Link> paths)

      Creates L2 path representing all links between the given source and destination device.
      Parameters:
        `srcDpid` - Id of the source device of L2 path
        `dstDpid` - Id of the destination device of L2 path
        `paths` - List of links belongs to the L2 path

    - #### L2PathDTO

          public L2PathDTO(DataPathId srcDpid,
                   DataPathId dstDpid)

      Creates the L2 path for given source and destination device.
      Parameters:
        `srcDpid` - Id of the source device of L2 path
        `dstDpid` - Id of the destination device of L2 path

    - #### L2PathDTO

          public L2PathDTO(DataPathId srcId,
                   Object... routeElements)

      Concise way to instantiate a route. The sequence of objects must be: Source switch out port, in port on the following switch and the following switch's data path ID.
      Parameters:
        `srcId` - Id of the source device
        `routeElements` - path elements

  - ### Method Detail

    - #### path

          public List<Link> path()

      Description copied from interface: `L2Path`
      Returns the sequence of `links`, which comprise the path.
      Specified by:
        `path` in interface `L2Path`
      Returns:
        the list of links

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### from

          public DataPathId from()

      Description copied from interface: `L2Path`
      Retrieves the datapathid associated to a source device of the L2 Path.
      Specified by:
        `from` in interface `L2Path`
      Returns:
        the dpid of the source

    - #### to

          public DataPathId to()

      Description copied from interface: `L2Path`
      Retrieves the datapathid associated to a destination device of the L2Path.
      Specified by:
        `to` in interface `L2Path`
      Returns:
        the dpid of the destination

    - #### metric

          public L2Path.Metric metric()

      Description copied from interface: `L2Path`
      Returns the type of metric used in computing shortest path.
      Specified by:
        `metric` in interface `L2Path`
      Returns:
        the type of metric

    - #### cost

          public L2Cost cost()

      Description copied from interface: `L2Path`
      Retrieves the cost of the path.
      Specified by:
        `cost` in interface `L2Path`
      Returns:
        the cost of the path

    - #### setCost

          public void setCost(L2Cost cost)

    - #### compares

          public boolean compares(L2Path path)

      Specified by:
        `compares` in interface `L2Path`

    - #### makeKey

          public String makeKey()

    - #### valueOf

          public static L2PathDTO valueOf(String pathStr)

Copyright © 2014. All Rights Reserved.