Class OpImpl<D>

    • Constructor Summary

      Constructors 
      Constructor Description
      OpImpl()  
    • Method Summary

      Modifier and Type Method Description
      FailedOp<D> fail​(int status)
      Mark this op as failed as of the time it is called, and record the resulting status code.
      long getCurrentResponseTimeNanos()
      Return the nanos that have elapsed since this op was started at the time of this call, plus any prior waittime.
      long getCurrentServiceTimeNanos()
      Return the nanos that have elapsed since the op was started at the time of this call.
      long getCycle()
      get the cycle number associated with this element.
      D getData()  
      long getResponseTimeNanos()  
      int getResult()
      Get a result associated with some operation, according to the activity-specific result map
      long getServiceTimeNanos()  
      int getSkippedReason()  
      long getStartedAtNanos()
      Get the nanosecond instant which was recorded for this operation to be started.
      int getTries()  
      StartedOp<D> retry()
      Reset the service timer on this op, and increment the tries counter
      void setCycle​(long cycle)
      set the cycle number associated with this element.
      void setData​(D data)  
      OpImpl<D> setWaitTime​(long waitTime)
      Indicate to this op, how much wait time elapsed between the time it was expected to start and the time it actually started.
      SkippedOp<D> skip​(int reason)
      Mark that this operation is being skipped by the activity type for some reason.
      StartedOp<D> start()
      Signify to EngineBlock that the associated operation is known to have started processing in some specific way according to the implementing activity type.
      SucceededOp<D> succeed​(int status)
      Mark this op as successful as of the time it is called, and record the resulting status code.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface io.engineblock.activityapi.cyclelog.buffers.results.CycleResult

        compareTo
      • Methods inherited from interface io.engineblock.activityapi.core.ops.fluent.opfacets.OpFacets

        compareTo
    • Constructor Detail

      • OpImpl

        public OpImpl()
    • Method Detail

      • start

        public StartedOp<D> start()
        Description copied from interface: TrackedOp
        Signify to EngineBlock that the associated operation is known to have started processing in some specific way according to the implementing activity type. This should be called after any operational setup work that would not occur in a typical application client scenario. The moment this is called, the start time for the operation is marked.
        Specified by:
        start in interface TrackedOp<D>
        Returns:
        a StartedOp of the appropriate generic delegate type
      • setWaitTime

        public OpImpl<D> setWaitTime​(long waitTime)
        Description copied from interface: TrackedOp
        Indicate to this op, how much wait time elapsed between the time it was expected to start and the time it actually started. This is used to calculate the response time once service time is known.
        Specified by:
        setWaitTime in interface TrackedOp<D>
        Parameters:
        waitTime - nanosecond delay
        Returns:
        a TrackedOp for method chaining
      • succeed

        public SucceededOp<D> succeed​(int status)
        Description copied from interface: StartedOp
        Mark this op as successful as of the time it is called, and record the resulting status code.
        Specified by:
        succeed in interface StartedOp<D>
        Parameters:
        status - The status for this op, determined by individual activity types
        Returns:
        a SucceededOp
      • fail

        public FailedOp<D> fail​(int status)
        Description copied from interface: StartedOp
        Mark this op as failed as of the time it is called, and record the resulting status code.
        Specified by:
        fail in interface StartedOp<D>
        Parameters:
        status - The status for this op, determined by individual activity types
        Returns:
        A FailedOp
      • retry

        public StartedOp<D> retry()
        Description copied from interface: StartedOp
        Reset the service timer on this op, and increment the tries counter
        Specified by:
        retry in interface StartedOp<D>
        Returns:
        A StartedOp
      • skip

        public SkippedOp<D> skip​(int reason)
        Description copied from interface: TrackedOp
        Mark that this operation is being skipped by the activity type for some reason.
        Specified by:
        skip in interface TrackedOp<D>
        Parameters:
        reason - An integer code, activity type specific, to track why the operation was skipped
        Returns:
        a SkippedOp of the appropriate generic delegate type
      • getCycle

        public long getCycle()
        Description copied from interface: CycleReadable
        get the cycle number associated with this element.
        Specified by:
        getCycle in interface CycleReadable
        Returns:
        a cycle number
      • setCycle

        public void setCycle​(long cycle)
        Description copied from interface: CycleMutable
        set the cycle number associated with this element.
        Specified by:
        setCycle in interface CycleMutable
        Parameters:
        cycle - The cycle for this operation
      • getStartedAtNanos

        public long getStartedAtNanos()
        Description copied from interface: StartedOp
        Get the nanosecond instant which was recorded for this operation to be started. Specifically, this is when the operation was known to enter a native protocol or activity type section of logic which is more than just preparatory work by the client before execution.
        Specified by:
        getStartedAtNanos in interface CompletedOp<D>
        Specified by:
        getStartedAtNanos in interface StartedOp<D>
        Returns:
        nanoseconds started instant
      • setData

        public void setData​(D data)
        Specified by:
        setData in interface Payload<D>
      • getCurrentServiceTimeNanos

        public long getCurrentServiceTimeNanos()
        Description copied from interface: StartedOp
        Return the nanos that have elapsed since the op was started at the time of this call.
        Specified by:
        getCurrentServiceTimeNanos in interface StartedOp<D>
        Returns:
        nanosecond service time duration
      • getCurrentResponseTimeNanos

        public long getCurrentResponseTimeNanos()
        Description copied from interface: StartedOp
        Return the nanos that have elapsed since this op was started at the time of this call, plus any prior waittime.
        Specified by:
        getCurrentResponseTimeNanos in interface StartedOp<D>
        Returns:
        nanosecond response time duration
      • getResult

        public int getResult()
        Description copied from interface: ResultReadable
        Get a result associated with some operation, according to the activity-specific result map
        Specified by:
        getResult in interface ResultReadable
        Returns:
        an activity-specific result code
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object