Package org.yamcs.cfdp
Class OngoingCfdpTransfer
- java.lang.Object
-
- org.yamcs.cfdp.OngoingCfdpTransfer
-
- All Implemented Interfaces:
CfdpTransfer
- Direct Known Subclasses:
CfdpIncomingTransfer,CfdpOutgoingTransfer
public abstract class OngoingCfdpTransfer extends Object implements CfdpTransfer
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanacknowledgedprotected CfdpTransactionIdcfdpTransactionIdprotected EventProducereventProducerprotected ScheduledThreadPoolExecutorexecutorprotected StringfailureReasonprotected ScheduledFuture<?>inactivityFutureprotected Loglogprotected longstartTimeprotected org.yamcs.protobuf.TransferStatestate
-
Constructor Summary
Constructors Constructor Description OngoingCfdpTransfer(String yamcsInstance, long id, ScheduledThreadPoolExecutor executor, YConfiguration config, CfdpTransactionId cfdpTransactionId, long destinationId, Stream cfdpOut, EventProducer eventProducer, TransferMonitor monitor, Map<ConditionCode,org.yamcs.cfdp.OngoingCfdpTransfer.FaultHandlingAction> faultHandlerActions)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description OngoingCfdpTransferabandonTransfer(String reason)protected abstract voidcancel(ConditionCode code)protected voidcancelInactivityTimer()booleancancellable()OngoingCfdpTransfercancelTransfer()protected voidchangeState(org.yamcs.protobuf.TransferState newState)protected voidfailTransfer(String failureReason)longgetDestinationId()Return the entity id of the ReceiverStringgetFailuredReason()protected org.yamcs.cfdp.OngoingCfdpTransfer.FaultHandlingActiongetFaultHandlingAction(ConditionCode code)longgetId()longgetSourceId()Return the entity id of the SenderlonggetStartTime()CfdpTransactionIdgetTransactionId()org.yamcs.protobuf.TransferStategetTransferState()booleanisOngoing()booleanisReliable()protected abstract voidonInactivityTimerExpiration()booleanpausable()OngoingCfdpTransferpauseTransfer()abstract voidprocessPacket(CfdpPacket packet)protected voidrescheduleInactivityTimer()protected abstract voidresume()OngoingCfdpTransferresumeTransfer()protected voidsendAck(AckPacket ackPacket)protected voidsendPacket(CfdpPacket packet)protected abstract voidsuspend()-
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.CfdpTransfer
getBucketName, getDirection, getObjectName, getRemotePath, getTotalSize, getTransferredSize
-
-
-
-
Field Detail
-
cfdpTransactionId
protected final CfdpTransactionId cfdpTransactionId
-
state
protected org.yamcs.protobuf.TransferState state
-
executor
protected final ScheduledThreadPoolExecutor executor
-
eventProducer
protected final EventProducer eventProducer
-
acknowledged
protected boolean acknowledged
-
log
protected final Log log
-
startTime
protected final long startTime
-
inactivityFuture
protected ScheduledFuture<?> inactivityFuture
-
failureReason
protected String failureReason
-
-
Constructor Detail
-
OngoingCfdpTransfer
public OngoingCfdpTransfer(String yamcsInstance, long id, ScheduledThreadPoolExecutor executor, YConfiguration config, CfdpTransactionId cfdpTransactionId, long destinationId, Stream cfdpOut, EventProducer eventProducer, TransferMonitor monitor, Map<ConditionCode,org.yamcs.cfdp.OngoingCfdpTransfer.FaultHandlingAction> faultHandlerActions)
-
-
Method Detail
-
processPacket
public abstract void processPacket(CfdpPacket packet)
-
sendAck
protected void sendAck(AckPacket ackPacket)
-
sendPacket
protected void sendPacket(CfdpPacket packet)
-
isOngoing
public final boolean isOngoing()
-
getTransferState
public final org.yamcs.protobuf.TransferState getTransferState()
- Specified by:
getTransferStatein interfaceCfdpTransfer
-
cancellable
public boolean cancellable()
- Specified by:
cancellablein interfaceCfdpTransfer
-
pausable
public boolean pausable()
- Specified by:
pausablein interfaceCfdpTransfer
-
onInactivityTimerExpiration
protected abstract void onInactivityTimerExpiration()
-
cancelInactivityTimer
protected void cancelInactivityTimer()
-
rescheduleInactivityTimer
protected void rescheduleInactivityTimer()
-
pauseTransfer
public OngoingCfdpTransfer pauseTransfer()
-
suspend
protected abstract void suspend()
-
resumeTransfer
public OngoingCfdpTransfer resumeTransfer()
-
resume
protected abstract void resume()
-
cancelTransfer
public OngoingCfdpTransfer cancelTransfer()
-
cancel
protected abstract void cancel(ConditionCode code)
-
abandonTransfer
public OngoingCfdpTransfer abandonTransfer(String reason)
-
getTransactionId
public CfdpTransactionId getTransactionId()
- Specified by:
getTransactionIdin interfaceCfdpTransfer
-
isReliable
public boolean isReliable()
- Specified by:
isReliablein interfaceCfdpTransfer
-
getStartTime
public long getStartTime()
- Specified by:
getStartTimein interfaceCfdpTransfer
-
failTransfer
protected void failTransfer(String failureReason)
-
changeState
protected void changeState(org.yamcs.protobuf.TransferState newState)
-
getFailuredReason
public String getFailuredReason()
- Specified by:
getFailuredReasonin interfaceCfdpTransfer
-
getId
public long getId()
- Specified by:
getIdin interfaceCfdpTransfer
-
getFaultHandlingAction
protected org.yamcs.cfdp.OngoingCfdpTransfer.FaultHandlingAction getFaultHandlingAction(ConditionCode code)
-
getSourceId
public long getSourceId()
Return the entity id of the Sender- Returns:
-
getDestinationId
public long getDestinationId()
Return the entity id of the Receiver- Returns:
-
-