Class CfdpOutgoingTransfer

java.lang.Object
org.yamcs.cfdp.OngoingCfdpTransfer
org.yamcs.cfdp.CfdpOutgoingTransfer
All Implemented Interfaces:
CfdpFileTransfer, FileTransfer

public class CfdpOutgoingTransfer extends OngoingCfdpTransfer
  • Constructor Details

    • CfdpOutgoingTransfer

      public CfdpOutgoingTransfer(String yamcsInstance, long initiatorEntityId, long id, long creationTime, ScheduledThreadPoolExecutor executor, PutRequest request, Stream cfdpOut, YConfiguration config, Bucket bucket, Integer customPduSize, Integer customPduDelay, EventProducer eventProducer, TransferMonitor monitor, Map<ConditionCode,org.yamcs.cfdp.OngoingCfdpTransfer.FaultHandlingAction> faultHandlerActions)
      Create a new CFDP outgoing (uplink) transfer.

      The transfer has to be started with the start() method.

      Parameters:
      yamcsInstance - - yamcsInstance where this transfer is running. It is used for log configuration and to get the time service.
      initiatorEntityId -
      id - - unique identifier. The least significant number of bits (according to the CFDP sequence length) of this id will be used to make the CFDP transaction id.
      creationTime - - time when the transaction has been created
      executor - - the CFDP state machine is serialized in this executor. It is also used to schedule timeouts.
      request - - the request containing the file to be sent.
      cfdpOut - - the stream where the outgoing PDUs are placed.
      config - - the configuration of various settings (see yamcs manual)
      bucket - - bucket from/to which the file should be
      customPduSize - - if not null, size to overwrite the config maxPduSize
      customPduDelay - - if not null, delay to overwrite the config sleepBetweenPdus
      eventProducer - - used to send events when important things happen
      monitor - - will be notified when transaction status changes
      faultHandlerActions - - can be used to change behaviour in case of timeouts or failures. Can be null, in which case the default behaviour to cancel the transaction will be used.
  • Method Details

    • start

      public void start()
      Start the transfer
    • processPacket

      public void processPacket(CfdpPacket packet)
      Specified by:
      processPacket in class OngoingCfdpTransfer
    • onInactivityTimerExpiration

      protected void onInactivityTimerExpiration()
      The inactivity timer is active after the EOF ACK has been received
      Specified by:
      onInactivityTimerExpiration in class OngoingCfdpTransfer
    • suspend

      protected void suspend()
      Specified by:
      suspend in class OngoingCfdpTransfer
    • resume

      protected void resume()
      Specified by:
      resume in class OngoingCfdpTransfer
    • getCfdpState

      public org.yamcs.cfdp.CfdpOutgoingTransfer.OutTxState getCfdpState()
    • cancel

      protected void cancel(ConditionCode conditionCode)
      Specified by:
      cancel in class OngoingCfdpTransfer
    • getDirection

      public TransferDirection getDirection()
    • getTotalSize

      public long getTotalSize()
      Description copied from interface: FileTransfer
      return the file size in bytes or -1 if the size is not known.

      For the CFDP service the incoming files can be unbounded (but this is not yet supported) or the size will be part of the metadata packet which may be missing.

    • getBucketName

      public String getBucketName()
      Description copied from interface: FileTransfer
      return the name of the bucket where the file is being transfered to/from.

      Could be null for incoming transfers. For the CFDP service, the bucket is determined by the source or destination entity id and it is not null. However if the bucket was determined by the filename which is known only when the metadata packet is received, this could be null.

    • getObjectName

      public String getObjectName()
      Description copied from interface: FileTransfer
      return the name of the object (file) which is being transfered. This is the filename on the local (Yamcs) site.

      Can be null for incoming transfers - for example CFDP can start a transfer without knowing the filename if the first metadata packet has been lost.

    • getRemotePath

      public String getRemotePath()
      Description copied from interface: FileTransfer
      return the remote path of the file which is being transfered.

      Can be null for incoming transfers - for example CFDP can start a transfer without having this information if the first metadata packet has been lost.

    • getTransferredSize

      public long getTransferredSize()