Class CfdpOutgoingTransfer
- All Implemented Interfaces:
CfdpFileTransfer,FileTransfer
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.yamcs.cfdp.CfdpFileTransfer
CfdpFileTransfer.PredefinedTransferTypes -
Field Summary
Fields inherited from class org.yamcs.cfdp.OngoingCfdpTransfer
acknowledged, cfdpTransactionId, creationTime, eventProducer, executor, inactivityFuture, log, startTime, state, transferType, wallclockStartTime -
Constructor Summary
ConstructorsConstructorDescriptionCfdpOutgoingTransfer(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. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcancel(ConditionCode conditionCode) return the name of the bucket where the file is being transfered to/from.org.yamcs.cfdp.CfdpOutgoingTransfer.OutTxStatereturn the name of the object (file) which is being transfered.return the remote path of the file which is being transfered.longreturn the file size in bytes or -1 if the size is not known.longprotected voidThe inactivity timer is active after the EOF ACK has been receivedvoidprocessPacket(CfdpPacket packet) protected voidresume()voidstart()Start the transferprotected voidsuspend()Methods inherited from class org.yamcs.cfdp.OngoingCfdpTransfer
abandonTransfer, cancelInactivityTimer, cancellable, cancelTransfer, changeState, failTransfer, getCreationTime, getDestinationId, getFailuredReason, getFaultHandlingAction, getId, getInitiatorEntityId, getStartTime, getTransactionId, getTransferState, getTransferType, getTransferType, isOngoing, isReliable, pausable, pauseTransfer, pushError, rescheduleInactivityTimer, resumeTransfer, sendInfoEvent, sendPacket, sendWarnEvent, toEventMsgMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.yamcs.cfdp.CfdpFileTransfer
getLocalEntityId, getRemoteEntityId
-
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 createdexecutor- - 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 becustomPduSize- - if not null, size to overwrite the config maxPduSizecustomPduDelay- - if not null, delay to overwrite the config sleepBetweenPduseventProducer- - used to send events when important things happenmonitor- - will be notified when transaction status changesfaultHandlerActions- - 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
- Specified by:
processPacketin classOngoingCfdpTransfer
-
onInactivityTimerExpiration
protected void onInactivityTimerExpiration()The inactivity timer is active after the EOF ACK has been received- Specified by:
onInactivityTimerExpirationin classOngoingCfdpTransfer
-
suspend
protected void suspend()- Specified by:
suspendin classOngoingCfdpTransfer
-
resume
protected void resume()- Specified by:
resumein classOngoingCfdpTransfer
-
getCfdpState
public org.yamcs.cfdp.CfdpOutgoingTransfer.OutTxState getCfdpState() -
cancel
- Specified by:
cancelin classOngoingCfdpTransfer
-
getDirection
-
getTotalSize
public long getTotalSize()Description copied from interface:FileTransferreturn 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
Description copied from interface:FileTransferreturn 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
Description copied from interface:FileTransferreturn 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
Description copied from interface:FileTransferreturn 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()
-