org.springframework.social.tripit.api.impl
Class TripItTemplate

java.lang.Object
  extended by org.springframework.social.tripit.api.impl.TripItTemplate
All Implemented Interfaces:
TripItApi

public class TripItTemplate
extends java.lang.Object
implements TripItApi

The central class for interacting with TripIt.

TripIt operations require OAuth 1 authentication. Therefore TripIt template must be given the minimal amount of information required to sign requests to the TripIt API with an OAuth Authorization header.


Constructor Summary
TripItTemplate(java.lang.String apiKey, java.lang.String apiSecret, java.lang.String accessToken, java.lang.String accessTokenSecret)
          Constructs a TripItTemplate with the minimal amount of information required to sign requests with an OAuth Authorization header.
 
Method Summary
 java.lang.String getProfileId()
          Retrieves the user's TripIt profile ID.
 java.lang.String getProfileUrl()
          Retrieves a URL to the user's public profile page.
protected  RestTemplate getRestTemplate()
           
 java.util.List<Trip> getUpcomingTrips()
          Retrieves a list of upcoming trips for the current user.
 TripItProfile getUserProfile()
          Retrieves the current user's TripIt profile details.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TripItTemplate

public TripItTemplate(java.lang.String apiKey,
                      java.lang.String apiSecret,
                      java.lang.String accessToken,
                      java.lang.String accessTokenSecret)
Constructs a TripItTemplate with the minimal amount of information required to sign requests with an OAuth Authorization header.

Parameters:
apiKey - the application's API key
apiSecret - the application's API secret
accessToken - an access token acquired through OAuth authentication with LinkedIn
accessTokenSecret - an access token secret acquired through OAuth authentication with LinkedIn
Method Detail

getProfileId

public java.lang.String getProfileId()
Description copied from interface: TripItApi
Retrieves the user's TripIt profile ID.

Specified by:
getProfileId in interface TripItApi
Returns:
the user's TripIt profile ID.

getProfileUrl

public java.lang.String getProfileUrl()
Description copied from interface: TripItApi
Retrieves a URL to the user's public profile page.

Specified by:
getProfileUrl in interface TripItApi
Returns:
a URL to the user's public profile page.

getUserProfile

public TripItProfile getUserProfile()
Description copied from interface: TripItApi
Retrieves the current user's TripIt profile details.

Specified by:
getUserProfile in interface TripItApi
Returns:
the user's profile data.

getUpcomingTrips

public java.util.List<Trip> getUpcomingTrips()
Description copied from interface: TripItApi
Retrieves a list of upcoming trips for the current user.

Specified by:
getUpcomingTrips in interface TripItApi
Returns:
the user's upcoming trips.

getRestTemplate

protected RestTemplate getRestTemplate()