Package org.yamcs.cfdp
Class OngoingCfdpTransfer
java.lang.Object
org.yamcs.cfdp.OngoingCfdpTransfer
- All Implemented Interfaces:
CfdpFileTransfer
,FileTransfer
- Direct Known Subclasses:
CfdpIncomingTransfer
,CfdpOutgoingTransfer
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.yamcs.cfdp.CfdpFileTransfer
CfdpFileTransfer.PredefinedTransferTypes
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected final CfdpTransactionId
protected final long
protected final EventProducer
protected final ScheduledThreadPoolExecutor
protected ScheduledFuture<?>
protected final Log
protected final long
protected TransferState
protected String
protected final long
-
Constructor Summary
ConstructorDescriptionOngoingCfdpTransfer
(String yamcsInstance, long id, long creationTime, ScheduledThreadPoolExecutor executor, YConfiguration config, CfdpTransactionId cfdpTransactionId, long destinationId, Stream cfdpOut, EventProducer eventProducer, TransferMonitor monitor, Map<ConditionCode, org.yamcs.cfdp.OngoingCfdpTransfer.FaultHandlingAction> faultHandlerActions) -
Method Summary
Modifier and TypeMethodDescriptionabandonTransfer
(String reason) protected abstract void
cancel
(ConditionCode code) protected void
boolean
protected void
changeState
(TransferState newState) protected void
failTransfer
(String failureReason) long
long
Return the entity id of the Receiverprotected org.yamcs.cfdp.OngoingCfdpTransfer.FaultHandlingAction
long
getId()
long
Return the entity id of the Senderlong
Get the CFDP transaction id.final TransferState
protected static String
getTransferType
(MetadataPacket metadata) Sets the transfer type fom the metadata packetfinal boolean
boolean
protected abstract void
boolean
pausable()
abstract void
processPacket
(CfdpPacket packet) protected void
protected void
protected abstract void
resume()
protected void
sendInfoEvent
(String type, String msg) protected void
sendPacket
(CfdpPacket packet) protected void
sendWarnEvent
(String type, String msg) protected abstract void
suspend()
protected String
toEventMsg
(MetadataPacket packet) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.yamcs.cfdp.CfdpFileTransfer
getLocalEntityId, getRemoteEntityId
Methods inherited from interface org.yamcs.filetransfer.FileTransfer
getBucketName, getDirection, getObjectName, getRemotePath, getTotalSize, getTransferredSize
-
Field Details
-
cfdpTransactionId
-
state
-
executor
-
eventProducer
-
acknowledged
protected boolean acknowledged -
log
-
startTime
protected final long startTime -
wallclockStartTime
protected final long wallclockStartTime -
creationTime
protected final long creationTime -
transferType
-
inactivityFuture
-
-
Constructor Details
-
OngoingCfdpTransfer
public OngoingCfdpTransfer(String yamcsInstance, long id, long creationTime, ScheduledThreadPoolExecutor executor, YConfiguration config, CfdpTransactionId cfdpTransactionId, long destinationId, Stream cfdpOut, EventProducer eventProducer, TransferMonitor monitor, Map<ConditionCode, org.yamcs.cfdp.OngoingCfdpTransfer.FaultHandlingAction> faultHandlerActions)
-
-
Method Details
-
getTransferType
Sets the transfer type fom the metadata packet- Parameters:
metadata
- Metadata packet
-
processPacket
-
pushError
-
sendPacket
-
isOngoing
public final boolean isOngoing() -
getTransferState
- Specified by:
getTransferState
in interfaceFileTransfer
-
cancellable
public boolean cancellable()- Specified by:
cancellable
in interfaceFileTransfer
-
pausable
public boolean pausable()- Specified by:
pausable
in interfaceFileTransfer
-
onInactivityTimerExpiration
protected abstract void onInactivityTimerExpiration() -
cancelInactivityTimer
protected void cancelInactivityTimer() -
rescheduleInactivityTimer
protected void rescheduleInactivityTimer() -
pauseTransfer
-
suspend
protected abstract void suspend() -
resumeTransfer
-
resume
protected abstract void resume() -
cancelTransfer
-
cancel
-
abandonTransfer
-
getTransactionId
Description copied from interface:CfdpFileTransfer
Get the CFDP transaction id. Returns null for queued transfers.- Specified by:
getTransactionId
in interfaceCfdpFileTransfer
-
isReliable
public boolean isReliable()- Specified by:
isReliable
in interfaceFileTransfer
-
getStartTime
public long getStartTime()- Specified by:
getStartTime
in interfaceFileTransfer
-
failTransfer
-
changeState
-
getFailuredReason
- Specified by:
getFailuredReason
in interfaceFileTransfer
-
getId
public long getId()- Specified by:
getId
in interfaceFileTransfer
-
getFaultHandlingAction
protected org.yamcs.cfdp.OngoingCfdpTransfer.FaultHandlingAction getFaultHandlingAction(ConditionCode code) -
getInitiatorEntityId
public long getInitiatorEntityId()Return the entity id of the Sender- Specified by:
getInitiatorEntityId
in interfaceCfdpFileTransfer
-
getDestinationId
public long getDestinationId()Return the entity id of the Receiver- Specified by:
getDestinationId
in interfaceCfdpFileTransfer
-
getTransferType
- Specified by:
getTransferType
in interfaceFileTransfer
-
sendInfoEvent
-
sendWarnEvent
-
toEventMsg
-
getCreationTime
public long getCreationTime()- Specified by:
getCreationTime
in interfaceFileTransfer
-