Package org.brerp.base.util
Class AddressLookupBR
java.lang.Object
org.brerp.base.util.AddressLookupBR
- All Implemented Interfaces:
AddressLookupInterface
AddressLookupBR
Pesquisa de informações de endereço pelo CEP
- Version:
- $Id: AddressLookupBR.java, v1.0 2012/10/30 23:33:13 PM, muriloht Exp $
- Author:
- Murilo H. Torquato (devCoffee, www.devcoffee.com.br)
-
Constructor Summary
ConstructorDescriptionCreates a new instance of AddressLookup.AddressLookupBR
(String serverUrl, String serialNo, String password) Creates a new instance of AddressLookup. -
Method Summary
Modifier and TypeMethodDescriptionint
lookupPostcode
(String postcode) Performs a postcode lookup fetching a set of addresses from server.Creates a new instance of PostcodeLookup.void
setClientID
(String clientID) void
setPassword
(String password) void
setServerUrl
(String serverUrl)
-
Constructor Details
-
AddressLookupBR
public AddressLookupBR()Creates a new instance of AddressLookup. -
AddressLookupBR
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 Details
-
getPassword
- Returns:
- the accessCode
-
getAddressData
- Specified by:
getAddressData
in interfaceAddressLookupInterface
-
getClientID
- Returns:
- the clientID
-
getServerUrl
- Returns:
- the serverUrl
-
lookupPostcode
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
- Specified by:
setPassword
in interfaceAddressLookupInterface
- Parameters:
accessCode
- the accessCode to set
-
setClientID
- Specified by:
setClientID
in interfaceAddressLookupInterface
- Parameters:
clientID
- the clientID to set
-
setServerUrl
- Specified by:
setServerUrl
in interfaceAddressLookupInterface
- Parameters:
serverUrl
- the serverUrl to set
-
newInstance
Creates a new instance of PostcodeLookup.- Specified by:
newInstance
in interfaceAddressLookupInterface
-