org.springframework.social.tripit
Class TripItTemplate

java.lang.Object
  extended by org.springframework.social.tripit.TripItTemplate
All Implemented Interfaces:
TripItOperations

public class TripItTemplate
extends java.lang.Object
implements TripItOperations

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.
 java.util.List<Trip> getTrips()
          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 as given by TripIt when registering the application.
apiSecret - The application's API secret as given by TripIt when registering the application.
accessToken - An access token granted to the application after OAuth authentication.
accessTokenSecret - An access token secret granted to the application after OAuth authentication.
Method Detail

getProfileId

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

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

getProfileUrl

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

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

getUserProfile

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

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

getTrips

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

Specified by:
getTrips in interface TripItOperations
Returns:
the user's upcoming trips.