org.otfeed.protocol.request
Class SplitRequest

java.lang.Object
  extended by org.otfeed.protocol.request.AbstractRequest
      extended by org.otfeed.protocol.request.AbstractSessionRequest
          extended by org.otfeed.protocol.request.SplitRequest

public class SplitRequest
extends AbstractSessionRequest

Request to receive split information.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.otfeed.protocol.request.AbstractRequest
AbstractRequest.JobStatus
 
Constructor Summary
SplitRequest(int requestId, java.lang.String exchangeCode, java.lang.String symbolCode, java.util.Date startDate, java.util.Date endDate, IDataDelegate<OTSplit> dataDelegate, ICompletionDelegate completionDelegate)
           
 
Method Summary
 void fireCompleted(OTError error)
          Internal method: used to wake up threads sleeping in waitForCompletion().
 OTError getError()
           
 java.lang.String getExchangeCode()
           
 java.lang.String getSymbolCode()
           
 AbstractRequest.JobStatus handleMessage(Header header, java.nio.ByteBuffer in)
          Abstract method to handle response message.
 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.
 void writeRequest(java.nio.ByteBuffer out)
          Writes out the request header and session string.
 
Methods inherited from class org.otfeed.protocol.request.AbstractSessionRequest
getCancelCommand, getSessionId, setSessionId
 
Methods inherited from class org.otfeed.protocol.request.AbstractRequest
getCommand, getRequestId, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SplitRequest

public SplitRequest(int requestId,
                    java.lang.String exchangeCode,
                    java.lang.String symbolCode,
                    java.util.Date startDate,
                    java.util.Date endDate,
                    IDataDelegate<OTSplit> dataDelegate,
                    ICompletionDelegate completionDelegate)
Method Detail

getExchangeCode

public java.lang.String getExchangeCode()

getSymbolCode

public java.lang.String getSymbolCode()

writeRequest

public void writeRequest(java.nio.ByteBuffer out)
Description copied from class: AbstractSessionRequest
Writes out the request header and session string. Subclasses must override this if needed, and their implementation must call this method as the first operation.

Overrides:
writeRequest in class AbstractSessionRequest
Parameters:
out - output buffer.

handleMessage

public AbstractRequest.JobStatus handleMessage(Header header,
                                               java.nio.ByteBuffer in)
Description copied from class: AbstractRequest
Abstract method to handle response message. This implementation only validates request and command. Must be overwritten by concrete implementation. Some concrete implementations may call this one at the beginning to check the sanity of the response.

Overrides:
handleMessage in class AbstractRequest
Parameters:
header - parsed response header.
in - input buffer with the rest of the data (after header has been parsed).

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.