CitySDK iOS Library
 All Classes Functions Variables Enumerations Enumerator Properties
Instance Methods | List of all members
TourismClient Class Reference

Stub used for the CitySDK Tourism API. It abstracts applications from the different requests allowed in the API and returns the correct data objects from such calls. More...

Inheritance diagram for TourismClient:

Instance Methods

(id) - initWithResources:andHomeUrl:
 Initializes with a given resource for a given home URL. More...
 
(void) - setResources:andHomeUrl:
 Sets the client stub with a given resources for a given homeUrl. More...
 
(void) - setVersion:
 Sets the client stub to use a given version. More...
 
(NSArray *) - getAvailableResources:
 Gets all the available capacities for the queried servers. More...
 
(BOOL) - hasResource::
 Checks whether a given resource is available for the queried server. More...
 
(BOOL) - hasAnyResourcesOf::
 Checks whether the server has a given resource. More...
 
(BOOL) - hasResource:withParameter::
 Checks whether a given resource is presented with a given parameter. More...
 
(ListPointOfInterest *) - getPois::
 Returns a list of POIs following the desired parameters. More...
 
(ListEvent *) - getEvents::
 Returns a list of Events following the desired parameters. More...
 
(ListRoute *) - getRoutes::
 Returns a list of Routes following the desired parameters. More...
 
(Category *) - getCategories::
 Returns the list of Category available. List should contain a parameter its value set to one of the following: More...
 
(ListTag *) - getTags::
 Returns the list of Tag available. List should contain a parameter its value set to one of the following: More...
 
(PointOfInterest *) - getPoi:withId::
 Returns the complete description of a given POI. More...
 
(Event *) - getEvent:withID::
 Returns the a given Event. More...
 
(Route *) - getRoute:withID::
 Returns the a given Route. More...
 

Detailed Description

Stub used for the CitySDK Tourism API. It abstracts applications from the different requests allowed in the API and returns the correct data objects from such calls.

Author
Pedro Cruz

Method Documentation

- (NSArray *) getAvailableResources: (NSError **)  err

Gets all the available capacities for the queried servers.

Parameters
errto indicate a given error.
Returns
a set of terms allowed for the server or nil (and an error description).
- (Category *) getCategories: (ParameterList *)  list
: (NSError **)  err 

Returns the list of Category available. List should contain a parameter its value set to one of the following:

  • poi;
  • event;
  • route.
Parameters
listthe parameters that should be followed
errerror can be set to the following:
  • if the given parameterList contains invalid Category parameters;
  • in case of socket errors;
  • if the server does not support the a term found in the parameterList;
  • in case of unforeseen errors;
  • if the server returns a code different from HTTP 200 OK.
Returns
a Category.
- (Event *) getEvent: (NSString *)  eventBase
withID: (NSString *)  eventID
: (NSError **)  err 

Returns the a given Event.

Parameters
eventBasethe base URL of the Event.
eventIDthe ID of the Event.
errerror can be set to the following:
  • in case of socket errors;
  • in case of unforeseen errors;
  • if the server returns a code different from HTTP 200 OK.
Returns
a Event containing the description of the Event.
- (ListEvent *) getEvents: (ParameterList *)  list
: (NSError **)  err 

Returns a list of Events following the desired parameters.

If such parameters are not valid terms for an Event, it will set an error.

Parameters
listthe parameters that should be followed.
errerror can be set to the following:
  • if the given parameterList contains invalid Event terms;
  • in case of socket errors;
  • if the server does not support the a term found in the parameterList;
  • in case of unforeseen errors;
  • if the server returns a code different from HTTP 200 OK.
Returns
a ListEvent.
- (PointOfInterest *) getPoi: (NSString *)  poiBase
withId: (NSString *)  poiID
: (NSError **)  err 

Returns the complete description of a given POI.

Parameters
poiBasethe base URL of the POI.
poiIDthe ID of the POI.
errerror can be set to the following:
  • in case of socket errors;
  • in case of unforeseen errors;
  • if the server returns a code different from HTTP 200 OK.
Returns
a PointOfInterest containing a complete description of the POI.
- (ListPointOfInterest *) getPois: (ParameterList *)  list
: (NSError **)  err 

Returns a list of POIs following the desired parameters.

If such parameters are not valid terms for a POI, it will set an error.

Parameters
listthe parameters that should be followed.
errerror can be set to the following:
  • if the given parameterList contains invalid POI terms;
  • in case of socket errors;
  • if the server does not support the a term found in the parameterList;
  • in case of unforeseen errors;
  • if the server returns a code different from HTTP 200 OK.
Returns
a ListPointOfInterest.
- (Route *) getRoute: (NSString *)  routeBase
withID: (NSString *)  routeID
: (NSError **)  err 

Returns the a given Route.

Parameters
routeBasethe base URL of the Route.
routeIDthe ID of the Route.
errerror can be set to the following:
  • in case of socket errors;
  • in case of unforeseen errors;
  • if the server returns a code different from HTTP 200 OK.
Returns
a Route containing the description of the Route.
- (ListRoute *) getRoutes: (ParameterList *)  list
: (NSError **)  err 

Returns a list of Routes following the desired parameters.

If such parameters are not valid terms for a Route, it will set an error.

Parameters
listthe parameters that should be followed.
errerror can be set to the following:
  • if the given parameterList contains invalid Route terms;
  • in case of socket errors;
  • if the server does not support the a term found in the parameterList;
  • in case of unforeseen errors;
  • if the server returns a code different from HTTP 200 OK.
Returns
a ListRoute.
- (ListTag *) getTags: (ParameterList *)  list
: (NSError **)  err 

Returns the list of Tag available. List should contain a parameter its value set to one of the following:

  • poi;
  • event;
  • route.
Parameters
listthe parameters that should be followed
errerror can be set to the following:
  • if the given parameterList contains invalid Tag parameters;
  • in case of socket errors;
  • if the server does not support the a term found in the parameterList;
  • in case of unforeseen errors;
  • if the server returns a code different from HTTP 200 OK.
Returns
a ListTag.
- (BOOL) hasAnyResourcesOf: (ResourceType)  type
: (NSError **)  err 

Checks whether the server has a given resource.

Parameters
typethe type to search for.
errto indicate a given error.
Returns
true if the server has any given resource of the referred type false otherwise.
- (BOOL) hasResource: (ResourceTerm)  term
: (NSError **)  err 

Checks whether a given resource is available for the queried server.

Parameters
terma given term.
errto indicate a given error.
Returns
true if available, false otherwise. In case of negative return, err may contain an error description.
- (BOOL) hasResource: (ResourceTerm)  resource
withParameter: (ParameterTerm)  parameter
: (NSError **)  err 

Checks whether a given resource is presented with a given parameter.

Parameters
resourcethe resource term.
parameterthe parameter term to check.
errto indicate a given error.
Returns
true if the resource has a given parameter or false otherwise.
- (id) initWithResources: (Resources *)  resources
andHomeUrl: (NSString *)  homeUrl 

Initializes with a given resource for a given home URL.

Parameters
resourcesthe resources of the server
homeUrlthe home URI of the server
- (void) setResources: (Resources *)  resources
andHomeUrl: (NSString *)  homeUrl 

Sets the client stub with a given resources for a given homeUrl.

Parameters
resourcesthe resources of the server
homeUrlthe home URI of the server
- (void) setVersion: (NSString *)  version

Sets the client stub to use a given version.

Parameters
versionthe version to be used.

The documentation for this class was generated from the following files: