org.springframework.social.greenhouse
Class GreenhouseTemplate

java.lang.Object
  extended by org.springframework.social.greenhouse.GreenhouseTemplate
All Implemented Interfaces:
GreenhouseOperations

public class GreenhouseTemplate
extends java.lang.Object
implements GreenhouseOperations

This is the central class for interacting with Greenhouse.

Greenhouse operations require OAuth authentication with the server. Therefore, GreenhouseTemplate must be constructed with the minimal information required to sign requests with and OAuth 1 Authorization header.


Constructor Summary
GreenhouseTemplate(java.lang.String apiKey, java.lang.String apiSecret, java.lang.String accessToken, java.lang.String accessTokenSecret)
           Constructs a GreenhouseTemplate with the minimal amount of information required to sign requests with an OAuth 1 Authorization header.
GreenhouseTemplate(java.lang.String apiKey, java.lang.String apiSecret, java.lang.String accessToken, java.lang.String accessTokenSecret, java.lang.String baseUrl)
           Constructs a GreenhouseTemplate with the minimal amount of information required to sign requests with an OAuth 1 Authorization header.
 
Method Summary
 java.util.List<Event> getEventsAfter(java.util.Date date)
          Retrieve a list of events that take place after a given time.
 java.util.List<EventSession> getSessionsOnDay(long eventId, java.util.Date date)
          Retrieves a list of sessions for an event that take place on a given day.
 java.util.List<Event> getUpcomingEvents()
          Retrieve a list of upcoming events.
 GreenhouseProfile getUserProfile()
          Retrieve the current user's Greenhouse profile information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GreenhouseTemplate

public GreenhouseTemplate(java.lang.String apiKey,
                          java.lang.String apiSecret,
                          java.lang.String accessToken,
                          java.lang.String accessTokenSecret)

Constructs a GreenhouseTemplate with the minimal amount of information required to sign requests with an OAuth 1 Authorization header.

This constructor assumes that the application will be conversing with the production Greenhouse server at http://springsource.greenhouse.org.

Parameters:
apiKey - The application's API Key as assigned when registering the application with Greenhouse
apiSecret - The application's API Secret as assigned when registering the application with Greenhouse
accessToken - An access token acquired through successful OAuth 1 authentication with Greenhouse
accessTokenSecret - An access token secret acquired through successful OAuth 1 authentication with Greenhouse

GreenhouseTemplate

public GreenhouseTemplate(java.lang.String apiKey,
                          java.lang.String apiSecret,
                          java.lang.String accessToken,
                          java.lang.String accessTokenSecret,
                          java.lang.String baseUrl)

Constructs a GreenhouseTemplate with the minimal amount of information required to sign requests with an OAuth 1 Authorization header.

This constructor allows the application to specify the base URL of the Greenhouse server, enabling the template to converse with a development or test server.

Parameters:
apiKey - The application's API Key as assigned when registering the application with Greenhouse
apiSecret - The application's API Secret as assigned when registering the application with Greenhouse
accessToken - An access token acquired through successful OAuth 1 authentication with Greenhouse
accessTokenSecret - An access token secret acquired through successful OAuth 1 authentication with Greenhouse
baseUrl - The base URL of the Greenhouse server
Method Detail

getUserProfile

public GreenhouseProfile getUserProfile()
Description copied from interface: GreenhouseOperations
Retrieve the current user's Greenhouse profile information.

Specified by:
getUserProfile in interface GreenhouseOperations
Returns:
the user's profile information.

getUpcomingEvents

public java.util.List<Event> getUpcomingEvents()
Description copied from interface: GreenhouseOperations
Retrieve a list of upcoming events.

Specified by:
getUpcomingEvents in interface GreenhouseOperations
Returns:
A list of events that take place after the current time.

getEventsAfter

public java.util.List<Event> getEventsAfter(java.util.Date date)
Description copied from interface: GreenhouseOperations
Retrieve a list of events that take place after a given time.

Specified by:
getEventsAfter in interface GreenhouseOperations
Parameters:
date - the starting point used to filter the list of events.
Returns:
a list of events that take place after the given time.

getSessionsOnDay

public java.util.List<EventSession> getSessionsOnDay(long eventId,
                                                     java.util.Date date)
Description copied from interface: GreenhouseOperations
Retrieves a list of sessions for an event that take place on a given day.

Specified by:
getSessionsOnDay in interface GreenhouseOperations
Parameters:
eventId - the ID of the event
date - the day to retrieve events for
Returns:
a list of sessions for the given event and day