citysdk.tourism.client.requests
Class TourismClientFactory

java.lang.Object
  extended by citysdk.tourism.client.requests.TourismClientFactory

public class TourismClientFactory
extends java.lang.Object

Factory class allowing the creation of a TourismClient. For each link, it makes only one HTTP call, fills a TourismClient, returns it and saves it. In future creations, it verifies if it was already called and if positive returns the result without making a new HTTP call.

Author:
Pedro Cruz

Method Summary
 TourismClient getClient(java.lang.String homeUrl)
          Gets a new TourismClient stub.
static TourismClientFactory getInstance()
          Gets the instance of this factory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static TourismClientFactory getInstance()
Gets the instance of this factory.

Returns:
the singleton instance of TourismClientFactory.

getClient

public TourismClient getClient(java.lang.String homeUrl)
                        throws java.io.IOException,
                               UnknownErrorException,
                               ServerErrorException
Gets a new TourismClient stub.

Parameters:
homeUrl - the entrypoint of the home URL to query.
Throws:
java.io.IOException - thrown in case of socket errors.
UnknownErrorException - thrown in case of unforeseen errors.
ServerErrorException - thrown if the server returns a code different from HTTP 200 OK.