org.otfeed.protocol.request
Class LoginRequest

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

public class LoginRequest
extends AbstractRequest

Request to login. Its the only one that does not have session part.


Nested Class Summary
static class LoginRequest.Response
           
 
Nested classes/interfaces inherited from class org.otfeed.protocol.request.AbstractRequest
AbstractRequest.JobStatus
 
Constructor Summary
LoginRequest(int requestId, java.lang.String u, java.lang.String p)
          Represents response to the login request.
 
Method Summary
 void fireCompleted(OTError error)
          Internal method: used to wake up threads sleeping in waitForCompletion().
 OTError getError()
           
 java.lang.String getPassword()
           
 java.lang.String getUsername()
           
 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.
 void writeRequest(java.nio.ByteBuffer out)
          Abstract method that writes out request body.
 
Methods inherited from class org.otfeed.protocol.request.AbstractRequest
getCommand, getRequestId, handleMessage, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoginRequest

public LoginRequest(int requestId,
                    java.lang.String u,
                    java.lang.String p)
Represents response to the login request. Could be either re-direct or success.

Method Detail

getUsername

public java.lang.String getUsername()

getPassword

public java.lang.String getPassword()

writeRequest

public void writeRequest(java.nio.ByteBuffer out)
Description copied from class: AbstractRequest
Abstract method that writes out request body. This implementation only writes the request header. It is meant to be overwritten by concrete request implementation. Concrete implementation must call super.writeRequest at the top of its method body.

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

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.