com.h3c.sdn.misc.net

## Class LinkInfoDTO

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

- All Implemented Interfaces:
    LinkInfo, Serializable

      public class LinkInfoDTO
      extends Object
      implements LinkInfo, Serializable

  Provides an implementation of `LinkInfo`, representing the link status and the time of discovery of a layer 2 link in the network.

  Instances of this class are mutable and hence not thread-safe.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LinkInfoDTO(long unicastDiscoveryTime, long multicastDiscoveryTime, Set<PortState> srcPortState, Set<PortState> dstPortState)` Creates a DTO representing the link status and the time of discovery of a layer 2 link in the network.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<PortState>` | `dstPortState()` Returns the state of the destination port of the associated link.
    `boolean` | `equals(Object obj)`
    `int` | `hashCode()`
    `long` | `multicastDiscoveryTime()` Returns the time at which the direct link was discovered by means other than standard LLDP packet.
    `Set<PortState>` | `srcPortState()` Returns the state of the source port of the associated link.
    `String` | `toKeyString()`
    `String` | `toString()`
    `Link.Type` | `type()` Returns the type of the associated link, i.e.
    `long` | `unicastDiscoveryTime()` Returns the time at which the direct link was discovered.
    `void` | `updateDstPortState(Set<PortState> dstPortState)` Updates the state of the destination port of the associated link.
    `void` | `updateMulticastDiscoveryTime(long multicastDiscoveryTime)` Updates the time at which the direct link was discovered by means other than standard LLDP packet, with the specified value.
    `void` | `updateSrcPortState(Set<PortState> srcPortState)` Updates the state of the source port of the associated link.
    `void` | `updateUnicastDiscoveryTime(long unicastDiscoveryTime)` Updates the time at which the direct link was discovered with the specified value.
    `static LinkInfoDTO` | `valueOf(String str)`

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

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

- - ### Constructor Detail

    - #### LinkInfoDTO

          public LinkInfoDTO(long unicastDiscoveryTime,
                     long multicastDiscoveryTime,
                     Set<PortState> srcPortState,
                     Set<PortState> dstPortState)

      Creates a DTO representing the link status and the time of discovery of a layer 2 link in the network.
      Parameters:
        `unicastDiscoveryTime` - the time at which the direct link was discovered
        `multicastDiscoveryTime` - the time at which the direct link was discovered by means other than standard LLDP packet
        `srcPortState` - the state of the source port of the associated link
        `dstPortState` - the state of the destination port of the associated link
      Throws:
        `NullPointerException` - if srcPortState or dstPortState is null

  - ### Method Detail

    - #### unicastDiscoveryTime

          public long unicastDiscoveryTime()

      Description copied from interface: `LinkInfo`
      Returns the time at which the direct link was discovered.

      The term unicast may be slightly misleading here; the standard LLDP destination MAC address that is currently used is a multicast address, however since this address is specified in the standard, we expect all switches to absorb the standard packet, thus making the standard LLDP packet describe only one link.

      Specified by:
        `unicastDiscoveryTime` in interface `LinkInfo`
      Returns:
        the time of discovery of the associated link

    - #### multicastDiscoveryTime

          public long multicastDiscoveryTime()

      Description copied from interface: `LinkInfo`
      Returns the time at which the direct link was discovered by means other than standard LLDP packet. For example, from a BDDP packet.
      Specified by:
        `multicastDiscoveryTime` in interface `LinkInfo`
      Returns:
        the time of discovery of the associated link

    - #### srcPortState

          public Set<PortState> srcPortState()

      Description copied from interface: `LinkInfo`
      Returns the state of the source port of the associated link.
      Specified by:
        `srcPortState` in interface `LinkInfo`
      Returns:
        the state of the source port

    - #### dstPortState

          public Set<PortState> dstPortState()

      Description copied from interface: `LinkInfo`
      Returns the state of the destination port of the associated link.
      Specified by:
        `dstPortState` in interface `LinkInfo`
      Returns:
        the state of the destination port

    - #### type

          public Link.Type type()

      Description copied from interface: `LinkInfo`
      Returns the type of the associated link, i.e. a direct link, multi-hop link or a tunnel.
      Specified by:
        `type` in interface `LinkInfo`
      Returns:
        the type of the associated link

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toKeyString

          public String toKeyString()

    - #### valueOf

          public static LinkInfoDTO valueOf(String str)

    - #### updateUnicastDiscoveryTime

          public void updateUnicastDiscoveryTime(long unicastDiscoveryTime)

      Description copied from interface: `LinkInfo`
      Updates the time at which the direct link was discovered with the specified value.
      Specified by:
        `updateUnicastDiscoveryTime` in interface `LinkInfo`
      Parameters:
        `unicastDiscoveryTime` - the time of discovery to set

    - #### updateMulticastDiscoveryTime

          public void updateMulticastDiscoveryTime(long multicastDiscoveryTime)

      Description copied from interface: `LinkInfo`
      Updates the time at which the direct link was discovered by means other than standard LLDP packet, with the specified value.
      Specified by:
        `updateMulticastDiscoveryTime` in interface `LinkInfo`
      Parameters:
        `multicastDiscoveryTime` - the time of discovery to set

    - #### updateSrcPortState

          public void updateSrcPortState(Set<PortState> srcPortState)

      Description copied from interface: `LinkInfo`
      Updates the state of the source port of the associated link.
      Specified by:
        `updateSrcPortState` in interface `LinkInfo`
      Parameters:
        `srcPortState` - the state of the source port

    - #### updateDstPortState

          public void updateDstPortState(Set<PortState> dstPortState)

      Description copied from interface: `LinkInfo`
      Updates the state of the destination port of the associated link.
      Specified by:
        `updateDstPortState` in interface `LinkInfo`
      Parameters:
        `dstPortState` - the state of the destination port

Copyright © 2014. All Rights Reserved.