org.otfeed.protocol.request
Class HeartbeatRequest

java.lang.Object
  extended by org.otfeed.protocol.request.AbstractRequest
      extended by org.otfeed.protocol.request.HeartbeatRequest

public final class HeartbeatRequest
extends AbstractRequest

Heartbeat request. No response is expected.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.otfeed.protocol.request.AbstractRequest
AbstractRequest.JobStatus
 
Constructor Summary
HeartbeatRequest(int requestId)
           
 
Method Summary
 void fireCompleted(OTError error)
          Internal method: used to wake up threads sleeping in waitForCompletion().
 OTError getError()
           
 void handleError(OTError error)
           
 boolean isCompleted()
           
 void waitForCompletion()
          Convenience method: blocks calling thread until request finishes.
 boolean waitForCompletion(long millis)
          Convenience method: blocks calling thread until request finishes, or the specified number of milliseconds elapses.
 
Methods inherited from class org.otfeed.protocol.request.AbstractRequest
getCommand, getRequestId, handleMessage, toString, writeRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HeartbeatRequest

public HeartbeatRequest(int requestId)
Method Detail

handleError

public void handleError(OTError error)

getError

public final OTError getError()

fireCompleted

public final void fireCompleted(OTError error)
Internal method: used to wake up threads sleeping in waitForCompletion().


isCompleted

public final boolean isCompleted()

waitForCompletion

public final boolean waitForCompletion(long millis)
Convenience method: blocks calling thread until request finishes, or the specified number of milliseconds elapses. Note that if request was not submitted, this method returns immediately with no error.

Parameters:
millis - how long to wait for completion.

waitForCompletion

public final void waitForCompletion()
Convenience method: blocks calling thread until request finishes. Note that if request was not submitted, this method returns immediately with no error.



Copyright © 2007 Mike Kroutikov. All Rights Reserved.