Class Request

java.lang.Object
desmoj.core.simulator.NamedObject
desmoj.core.simulator.ModelComponent
desmoj.core.simulator.Schedulable
desmoj.core.simulator.Entity
cambio.simulator.entities.NamedEntity
cambio.simulator.entities.networking.Request
Direct Known Subclasses:
InternalRequest, RequestAnswer, UserRequest

public abstract class Request extends NamedEntity
Represents a Request that can travel between two MicroserviceInstances.
Author:
Lion Wagner
  • Field Details

    • operation

      public final Operation operation
  • Constructor Details

  • Method Details

    • getDependencies

      public final Set<ServiceDependencyInstance> getDependencies()
    • getParent

      public final Request getParent()
    • hasParent

      public final boolean hasParent()
    • getRequester

      public MicroserviceInstance getRequester()
    • isCompleted

      public final boolean isCompleted()
    • isComputationCompleted

      public boolean isComputationCompleted()
    • isDependenciesCompleted

      public boolean isDependenciesCompleted()
    • getTimestampReceived

      public desmoj.core.simulator.TimeInstant getTimestampReceived()
    • getTimestampSend

      public desmoj.core.simulator.TimeInstant getTimestampSend()
    • resetSendTimeStamps

      public void resetSendTimeStamps()
    • setSendEvent

      public void setSendEvent(NetworkRequestSendEvent sendEvent)
    • setReceiveEvent

      public void setReceiveEvent(NetworkRequestReceiveEvent receiveEvent)
    • setCanceledEvent

      public void setCanceledEvent(NetworkRequestCanceledEvent canceledEvent)
    • setComputationCompleted

      public final void setComputationCompleted()
      Marks the request computation demand as fulfilled at the present time.
    • stampReceived

      public final void stampReceived(desmoj.core.simulator.TimeInstant stamp)
    • stampSendoff

      public final void stampSendoff(desmoj.core.simulator.TimeInstant stamp)
      Marks the point in time this request was send.
    • stampReceivedAtHandler

      public final void stampReceivedAtHandler(desmoj.core.simulator.TimeInstant stamp)
      Marks the point in time this request was received at a handler.
    • notifyDependencyHasFinished

      public boolean notifyDependencyHasFinished(ServiceDependencyInstance dep)
      Tells this request that one ServiceDependencyInstance has finished.
      Parameters:
      dep - dependency that was completed
      Returns:
      whether all dependencies are completed
    • getRelatedDependency

      public ServiceDependencyInstance getRelatedDependency(Request request)
      Gets the ServiceDependencyInstance that should be completed by the given request.
      Parameters:
      request - child request of this request.
      Returns:
      the ServiceDependencyInstance that is related to the given request, null otherwise. Returns null specifically, if the request was a child request, that has been canceled or replaced.
    • getResponseTime

      public final double getResponseTime()
      Calculates the response time of this request.
      Returns:
      a double, describing the response time with the reference unit.
    • getDependencyWaitTime

      public final double getDependencyWaitTime()
    • getComputeTime

      public final double getComputeTime()
    • areDependenciesCompleted

      public final boolean areDependenciesCompleted()
    • onDependenciesComplete

      protected void onDependenciesComplete()
    • onComputationComplete

      protected void onComputationComplete()
    • onCompletion

      protected void onCompletion()
    • onReceive

      protected void onReceive()
    • getHandler

      public MicroserviceInstance getHandler()
    • setHandler

      public void setHandler(MicroserviceInstance handler)
    • getUpdateListeners

      public Collection<IRequestUpdateListener> getUpdateListeners()
    • addUpdateListener

      public void addUpdateListener(IRequestUpdateListener updateListener)
      Adds a new IRequestUpdateListener to the request.
      Parameters:
      updateListener - listener to add.
    • cancelSending

      public void cancelSending()
      Cancels the sending process of this request. Also prevents it from starting.
    • cancelExecutionAtHandler

      public void cancelExecutionAtHandler()
      Use, to cancel this request.