Class LiveTransferSample

java.lang.Object
ecmwf.ecpds.master.LiveTransferSample
All Implemented Interfaces:
Serializable

public final class LiveTransferSample extends Object implements Serializable
The Class LiveTransferSample. Lightweight, generic snapshot of an in-progress (or just-finished) data transfer, pushed periodically from a DataMover to the MasterServer so that it can be broadcast to "Live ECPDS Earth" globe visualisation clients. This is intentionally decoupled from ECPDS's internal transfer machinery: it only carries the information the visualisation needs (who/what/where/how-fast/how-much), not full DataTransfer/Host objects.

@JsonIgnoreProperties(ignoreUnknown = true) is required here: isTerminal() is a derived getter (no backing field, not a constructor parameter), but Jackson's default bean introspection still serialises it as a "terminal" JSON property on the way out. A Continental/Proxy Data Mover pushing samples over its REST relay (see RESTClient#updateLiveTransferStatistics) round-trips through actual JSON, unlike a regular, RMI-connected Data Mover (native Java serialization) - without this annotation, the MasterServer's @JsonCreator constructor (which has no "terminal" parameter) rejects that field as unrecognised and the whole batch is dropped, silently losing every sample a Continental Mover reports.

See Also:
  • Field Details

    • STATUS_ACTIVE

      public static final String STATUS_ACTIVE
      Status: transfer is currently in progress.
      See Also:
    • STATUS_DONE

      public static final String STATUS_DONE
      Status: transfer completed successfully.
      See Also:
    • STATUS_FAILED

      public static final String STATUS_FAILED
      Status: transfer failed/was retried.
      See Also:
    • DIRECTION_DISSEMINATION

      public static final String DIRECTION_DISSEMINATION
      Direction: data pushed out to a Dissemination Host.
      See Also:
    • DIRECTION_ACQUISITION

      public static final String DIRECTION_ACQUISITION
      Direction: data pulled in from an Acquisition Host.
      See Also:
  • Constructor Details

    • LiveTransferSample

      public LiveTransferSample(long transferId, String moverName, String destinationName, String hostName, String hostNickname, String hostAddress, String protocol, long fileSize, long byteSent, long duration, double rateBitsPerSecond, String status, String direction, String hostType)
      Instantiates a new live transfer sample.
      Parameters:
      transferId - the transfer id
      moverName - the mover name
      destinationName - the destination name
      hostName - the host name
      hostNickname - the host nickname (display name, falls back to hostName when blank)
      hostAddress - the host's actual network address (hostname or IP), used for GeoIP resolution
      protocol - the protocol
      fileSize - the file size
      byteSent - the byte sent
      duration - the duration
      rateBitsPerSecond - the rate bits per second
      status - the status
      direction - one of DIRECTION_DISSEMINATION or DIRECTION_ACQUISITION; defaults to DIRECTION_DISSEMINATION if null
      hostType - the target/source Host's actual type (see hostType); may be null
    • LiveTransferSample

      public LiveTransferSample(long transferId, String moverName, String destinationName, String hostName, String hostNickname, String hostAddress, String protocol, long fileSize, long byteSent, long duration, double rateBitsPerSecond, String status, String direction, String hostType, Long timestamp, String attemptId)
  • Method Details

    • withAttempt

      public LiveTransferSample withAttempt(String attempt)
    • getAttemptId

      public String getAttemptId()
    • getEventKey

      public String getEventKey()
      Identity of a movement, not merely the database transfer reused by successive legs/retries.
    • getTransferId

      public long getTransferId()
    • getMoverName

      public String getMoverName()
    • getDestinationName

      public String getDestinationName()
    • getHostName

      public String getHostName()
    • getHostNickname

      public String getHostNickname()
    • getHostAddress

      public String getHostAddress()
    • getProtocol

      public String getProtocol()
    • getFileSize

      public long getFileSize()
    • getByteSent

      public long getByteSent()
    • getDuration

      public long getDuration()
    • getRateBitsPerSecond

      public double getRateBitsPerSecond()
    • getStatus

      public String getStatus()
    • getDirection

      public String getDirection()
    • getHostType

      public String getHostType()
    • getTimestamp

      public long getTimestamp()
    • isTerminal

      public boolean isTerminal()
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object