|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.simpleyql.ApiImpl
public class ApiImpl
Implementation for the Yahoo! API object returned by ApiFactory
.
ApiFactory
,
Serialized FormConstructor Summary | |
---|---|
ApiImpl(java.lang.String consumerKey,
java.lang.String consumerSecret,
java.lang.String servleturl,
boolean resultsAsJson,
HttpClient httpclient)
Retrieves an object that can be used to call the API. |
Method Summary | |
---|---|
void |
askAuthorization(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String finalUrl)
Redirects the current user to the authorization page. |
QueryResult |
query(java.lang.String yql,
java.lang.String authdata)
Sends a YQL request to Yahoo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApiImpl(java.lang.String consumerKey, java.lang.String consumerSecret, java.lang.String servleturl, boolean resultsAsJson, HttpClient httpclient)
consumerKey
- Information obtained when you register your application on
YahooconsumerSecret
- Information obtained when you register your application on
Yahooservleturl
- URL that the CallBackServlet
is mapped to.resultsAsJson
- If true
, API calls will return their results as
JSON, otherwise they will return XML.httpclient
- Object that will do the back-end communcations with Yahoo. If
null, will default to URLConnectionClient
, which
is fine for most people.Method Detail |
---|
public void askAuthorization(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String finalUrl) throws java.io.IOException, OAuthException
It will store OAuth bookkeeping information at the request's session.
At the end of the process, the user will be redirected to finalURL, which will recieve the "authdata" parameter by GET (which should be stored for future use).
askAuthorization
in interface Api
java.io.IOException
OAuthException
public QueryResult query(java.lang.String yql, java.lang.String authdata) throws OAuthException, java.io.IOException
Api
query
in interface Api
yql
- Request formatted as YQL.
OAuthException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |