Package com.akunagroup.uk.postcode
Class AddressLookup
- java.lang.Object
-
- 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
Constructors Constructor Description AddressLookup()
Creates a new instance of AddressLookup.AddressLookup(String serverUrl, String serialNo, String password)
Creates a new instance of AddressLookup.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
-
-
-
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 interfaceAddressLookupInterface
-
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 interfaceAddressLookupInterface
- 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 interfaceAddressLookupInterface
- Parameters:
password
- the password to set
-
setClientID
public void setClientID(String clientID)
- Specified by:
setClientID
in interfaceAddressLookupInterface
- Parameters:
clientID
- the clientID to set
-
setServerUrl
public void setServerUrl(String serverUrl)
- Specified by:
setServerUrl
in interfaceAddressLookupInterface
- Parameters:
serverUrl
- the serverUrl to set
-
newInstance
public AddressLookupInterface newInstance()
Creates a new instance of PostcodeLookup.- Specified by:
newInstance
in interfaceAddressLookupInterface
-
-