Adempiere 3.5.2a

com.akunagroup.uk.postcode
Class AddressLookup

java.lang.Object
  extended by com.akunagroup.uk.postcode.AddressLookup
All Implemented Interfaces:
AddressLookupInterface

public class AddressLookup
extends Object
implements AddressLookupInterface

Manages connections with the postcode server, retrieves the response and parses it. The best way to use it is to first issue a postcode lookup. Please see Capscan Doucmentation located at: http://www.capscanondemand.com/docs/OnDemand.pdf

Version:
$Id$
Author:
Michael Judd

Constructor Summary
AddressLookup()
          Creates a new instance of AddressLookup.
AddressLookup(String serverUrl, String serialNo, String password)
          Creates a new instance of AddressLookup.
 
Method Summary
 HashMap<String,Object> getAddressData()
           
 String getClientID()
           
 String getPassword()
           
 String getServerUrl()
           
 int lookupPostcode(String postcode)
          Performs a postcode lookup fetching a set of addresses from server.
 AddressLookupInterface newInstance()
          Creates a new instance of PostcodeLookup.
 void setClientID(String clientID)
           
 void setPassword(String password)
           
 void setServerUrl(String serverUrl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddressLookup

public AddressLookup()
Creates a new instance of AddressLookup.


AddressLookup

public AddressLookup(String serverUrl,
                     String serialNo,
                     String password)
Creates a new instance of AddressLookup.

Parameters:
serverUrl - URL of the postcode server.
serialNo - Serial no. (used in authentication along with password)
password - Password (used in authentication along with Serial no.)
Method Detail

getPassword

public String getPassword()
Returns:
the accessCode

getAddressData

public HashMap<String,Object> getAddressData()
Specified by:
getAddressData in interface AddressLookupInterface

getClientID

public String getClientID()
Returns:
the clientID

getServerUrl

public String getServerUrl()
Returns:
the serverUrl

lookupPostcode

public int lookupPostcode(String postcode)
Performs a postcode lookup fetching a set of addresses from server.

Specified by:
lookupPostcode in interface AddressLookupInterface
Parameters:
postcode - The postcode to lookup for.
Returns:
The number of addresses fetched or -1 in case of error.

setPassword

public void setPassword(String password)
Specified by:
setPassword in interface AddressLookupInterface
Parameters:
accessCode - the accessCode to set

setClientID

public void setClientID(String clientID)
Specified by:
setClientID in interface AddressLookupInterface
Parameters:
clientID - the clientID to set

setServerUrl

public void setServerUrl(String serverUrl)
Specified by:
setServerUrl in interface AddressLookupInterface
Parameters:
serverUrl - the serverUrl to set

newInstance

public AddressLookupInterface newInstance()
Creates a new instance of PostcodeLookup.

Specified by:
newInstance in interface AddressLookupInterface

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.