com.lmax.api.account
Class LoginRequest

java.lang.Object
  extended by com.lmax.api.account.LoginRequest
All Implemented Interfaces:
com.lmax.api.internal.Request

public class LoginRequest
extends java.lang.Object
implements com.lmax.api.internal.Request

Encapsulates a request to login to LMAX.


Nested Class Summary
static class LoginRequest.ProductType
          The product type to use to connect to lmax.
 
Constructor Summary
LoginRequest(java.lang.String username, java.lang.String password)
          Constructs a request to login to LMAX, will default the product type to CFD_LIVE.
LoginRequest(java.lang.String username, java.lang.String password, LoginRequest.ProductType productType)
          Constructs a request to login to LMAX.
LoginRequest(java.lang.String username, java.lang.String password, LoginRequest.ProductType productType, boolean checkProtocolVersion)
          Constructs a request to login to LMAX.
 
Method Summary
 java.lang.String getUri()
          Returns the path to the login request.
 void writeTo(com.lmax.api.internal.xml.StructuredWriter writer)
          Internal: Output this request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginRequest

public LoginRequest(java.lang.String username,
                    java.lang.String password,
                    LoginRequest.ProductType productType,
                    boolean checkProtocolVersion)
Constructs a request to login to LMAX.

Parameters:
username - The username
password - The password
productType - The product type (CFD_LIVE or CFD_DEMO)
checkProtocolVersion - true to ensure that the protocol version used by the client and server are the same. Setting this to false may cause errors or incorrect behaviour due to protocol changes.

LoginRequest

public LoginRequest(java.lang.String username,
                    java.lang.String password,
                    LoginRequest.ProductType productType)
Constructs a request to login to LMAX.

Parameters:
username - The username
password - The password
productType - The product type (CFD_LIVE or CFD_DEMO)

LoginRequest

public LoginRequest(java.lang.String username,
                    java.lang.String password)
Constructs a request to login to LMAX, will default the product type to CFD_LIVE.

Parameters:
username - the username
password - the password
Method Detail

getUri

public java.lang.String getUri()
Returns the path to the login request.

Specified by:
getUri in interface com.lmax.api.internal.Request
Returns:
The path to the login request.

writeTo

public void writeTo(com.lmax.api.internal.xml.StructuredWriter writer)
Internal: Output this request.

Specified by:
writeTo in interface com.lmax.api.internal.Request
Parameters:
writer - The destination for the content of this request