com.bigllc.retsiq.simpleclient
Class RETSConnection

java.lang.Object
  extended by com.bigllc.retsiq.simpleclient.RETSConnection

public class RETSConnection
extends java.lang.Object

RETS server connection. This class is used to configure the server details and create authenticated RETS user sessions.

Author:
Marc G. Smith

Constructor Summary
RETSConnection(java.lang.String url)
          Construct a connection factory to RETS server.
RETSConnection(java.lang.String url, java.lang.String userAgent)
          Construct a connection factory to RETS server with a custom user agent string.
RETSConnection(java.lang.String url, java.lang.String userAgent, java.lang.String userAgentPassword)
          Construct a connection factory to RETS server that requires user agent authentication.
 
Method Summary
 boolean getAutoDigest()
          Is the client set for auto digest.
 boolean getAutoLogin()
          Is the client set for auto login.
 com.bigllc.retsiq.api.RETSConstants.Version getDefaultRetsVersion()
           
 RETSUserSession getSession(java.lang.String username, java.lang.String password)
          Authenticate a user and get a session for them.
 void setAutoDigest(boolean doAutoDigest)
          Set whether auto digest should be performed.
 void setAutoLogin(boolean doAutoLogin)
          Set whether auto login should be performed.
 void setDefaultRetsVersion(com.bigllc.retsiq.api.RETSConstants.Version version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RETSConnection

public RETSConnection(java.lang.String url)
               throws java.net.MalformedURLException
Construct a connection factory to RETS server.

Parameters:
url - the full login url to the target RETS server
Throws:
java.net.MalformedURLException

RETSConnection

public RETSConnection(java.lang.String url,
                      java.lang.String userAgent)
               throws java.net.MalformedURLException
Construct a connection factory to RETS server with a custom user agent string.

Parameters:
url - the full login url to the targer RETS server
userAgent - the user agent string to be sent with request in the format USERAGENT/VERSION.
Throws:
java.net.MalformedURLException

RETSConnection

public RETSConnection(java.lang.String url,
                      java.lang.String userAgent,
                      java.lang.String userAgentPassword)
               throws java.net.MalformedURLException
Construct a connection factory to RETS server that requires user agent authentication.

Parameters:
url - the full login url to the targer RETS server
userAgent - the user agent string to be sent with request in the format USERAGENT/VERSION.
userAgentPassword - the user agent password.
Throws:
java.net.MalformedURLException
Method Detail

getAutoLogin

public boolean getAutoLogin()
Is the client set for auto login.

Returns:
true is auto login is switched on, false otherwise.

setAutoLogin

public void setAutoLogin(boolean doAutoLogin)
Set whether auto login should be performed. If a user session has expired and an authentication request is made the client will attempt to log the user in seemlessly.

Parameters:
doAutoLogin - should auto login be performed

getAutoDigest

public boolean getAutoDigest()
Is the client set for auto digest.

Returns:
true is auto digest is switched on, false otherwise.

setAutoDigest

public void setAutoDigest(boolean doAutoDigest)
Set whether auto digest should be performed.

Parameters:
doAutoDigest - should auto digest be performed

getDefaultRetsVersion

public com.bigllc.retsiq.api.RETSConstants.Version getDefaultRetsVersion()

setDefaultRetsVersion

public void setDefaultRetsVersion(com.bigllc.retsiq.api.RETSConstants.Version version)

getSession

public RETSUserSession getSession(java.lang.String username,
                                  java.lang.String password)
                           throws RETSClientException
Authenticate a user and get a session for them.

Parameters:
username - the username
password - the password
Throws:
RETSClientException