public interface NetworkOperation extends LongOperation<NetworkResource>, RemoteOperation<NetworkResource>
When starting a network operation, it seeks network resource from each provisioner in the allocated Route
and
keeps running until its entire length is processed, until a failure happens or until it is explicitly stopped (using appropriate method).
You must ensure that both the parent Job and the destination Job are started in order to start this operation, otherwise an IllegalStateException is thrown.
If you start this operation while it has a null parent, or a null destination Job then a NullPointerException is thrown.
If this operation has no allocated Route
, then it will fail to start.
Besides, each link in the Route
must have a non null provisioner otherwise a NullPointerException
is thrown.
When starting the operation, implementations must take care to register appropriate listeners on each device on the route, and on the source and destination jobs (and VMs) to ensure that the operation is stopped or updated accordingly when:
NotificationCodes.OPERATION_RESOURCE_INVALIDATED
the allocated BW on the route has changed;
NotificationCodes.RP_ROUTING_UPDATED
the route is no longer valid (ex: because a device or interface has failed).
Job
that specifies the destination job. The second argument
is a long that specifies the operation length (length of the transmission).RunnableEntity.RunnableState
Modifier and Type | Method and Description |
---|---|
NetworkOperation |
clone()
Creates a clone of this entity and sets its parent to null.
|
Route |
getAllocatedRoute()
Returns the route that is assigned for this operation or null.
|
boolean |
isRetransmitOnError()
Returns true if data should be retransmitted on error.
|
getCompletedLength, getLength, getResourceMax, getResourceMin, setResourceMax, setResourceMin
getDestinationJob, setDestinationJob, unplace
getAllocatedResource, getParent, getRemainingDelay, getTotalRunningTime, isDelayed, isDelayedBeforeCompletion
canRestart, canStart, doCancel, doFail, doPause, doRestart, doStart, doTerminate, getRunnableState, isRunning, isTerminated
NetworkOperation clone()
Entity
This is a deep clone method which also clones almost all children entities and sets their parents
to the newly created clone.
The only children which are not cloned are those implementing the UncloneableEntity
interface.
Implementations must ensure that the new clone will be independent from the current entity.
clone
in interface Entity
clone
in interface Notifier
clone
in interface Operation<NetworkResource>
clone
in interface RemoteOperation<NetworkResource>
clone
in interface RunnableEntity
boolean isRetransmitOnError()
If false that means that the loss rate between nodes is not taken into account, which may be used to simulate communications where data integrity doesn't matter a lot.
Route getAllocatedRoute()
null is returned if no route is assigned yet.