Constructors Summary |
---|
public FacebookJaxbRestClient(String apiKey, String secret)Constructor.
this(SERVER_URL, apiKey, secret, null);
|
public FacebookJaxbRestClient(String apiKey, String secret, String sessionKey)Constructor.
this(SERVER_URL, apiKey, secret, sessionKey);
|
public FacebookJaxbRestClient(String serverAddr, String apiKey, String secret, String sessionKey)Constructor.
this(new URL(serverAddr), apiKey, secret, sessionKey);
|
public FacebookJaxbRestClient(URL serverUrl, String apiKey, String secret, String sessionKey)Constructor.
super(serverUrl, apiKey, secret, sessionKey);
|
Methods Summary |
---|
public java.lang.String | auth_getSession(java.lang.String authToken)Call this function to retrieve the session information after your user has
logged in.
if (null != this._sessionKey) {
return this._sessionKey;
}
SessionInfo d =
(SessionInfo) this.callMethod(FacebookMethod.AUTH_GET_SESSION,
new Pair<String, CharSequence>("auth_token", authToken.toString()));
this._sessionKey = d.getSessionKey();
this._userId = d.getUid();
if (this._isDesktop) {
this._sessionSecret =
d.getSecret();
}
return this._sessionKey;
|
public java.lang.String | data_getUserPreference(java.lang.Integer prefId)
throw new FacebookException(ErrorCode.GEN_UNKNOWN_METHOD, "The FacebookJsonRestClient does not support this API call. Please use an instance of FacebookRestClient instead.");
|
public java.util.Map | data_getUserPreferences()
throw new FacebookException(ErrorCode.GEN_UNKNOWN_METHOD, "The FacebookJsonRestClient does not support this API call. Please use an instance of FacebookRestClient instead.");
|
public void | data_setUserPreference(java.lang.Integer prefId, java.lang.String value)
throw new FacebookException(ErrorCode.GEN_UNKNOWN_METHOD, "The FacebookJsonRestClient does not support this API call. Please use an instance of FacebookRestClient instead.");
|
public void | data_setUserPreferences(java.util.Map values, boolean replace)
throw new FacebookException(ErrorCode.GEN_UNKNOWN_METHOD, "The FacebookJsonRestClient does not support this API call. " +
"Please use an instance of FacebookRestClient instead.");
|
protected boolean | extractBoolean(java.lang.Object val)Extracts a Boolean from a result that consists of a Boolean only.
String result = parse();
if (("1".equals(result)) || ("true".equalsIgnoreCase(result))) {
return true;
}
return false;
|
protected int | extractInt(java.lang.Object val)Extracts an Integer from a result that consists of an Integer only.
try {
return Integer.parseInt(parse());
} catch (Exception cce) {
logException(cce);
return 0;
}
|
protected java.lang.Long | extractLong(java.lang.Object val)Extracts a Long from a result that consists of an Long only.
try {
return Long.parseLong(parse());
} catch (Exception cce) {
logException(cce);
return null;
}
|
public java.lang.String | extractString(java.lang.Object val)Extracts a String from a result consisting entirely of a String.
return parse();
|
protected java.net.URL | extractURL(java.lang.Object url)Extracts a URL from a result that consists of a URL only.
For JSON, that result is simply a String.
String result = parse();
if (result != null) {
return new URL(result);
}
return null;
|
public java.lang.String | getResponseFormat()The response format in which results to FacebookMethod calls are returned
return "xml";
|
public java.util.List | marketplace_getListings(java.util.List listingIds, java.util.List uids)
MarketplaceGetListingsResponse resp = (MarketplaceGetListingsResponse)this.marketplace_getListings(listingIds, uids);
return resp.getListing();
|
public java.util.List | marketplace_getSubCategories()
MarketplaceGetSubCategoriesResponse resp = (MarketplaceGetSubCategoriesResponse)this.marketplace_getSubCategories(null);
return resp.getMarketplaceSubcategory();
|
public java.util.List | marketplace_search(com.facebook.api.MarketListingCategory category, com.facebook.api.MarketListingSubcategory subcategory, java.lang.String searchTerm)
MarketplaceSearchResponse resp = (MarketplaceSearchResponse)this.marketplace_search(category.getName(), subcategory.getName(), searchTerm);
return resp.getListing();
|
private java.lang.String | parse()
String xml = this.rawResponse;
if ((xml == null) || ("".equals(xml))) {
return null;
}
if (! xml.contains("</")) {
return null;
}
xml = xml.substring(0, xml.indexOf("</"));
xml = xml.substring(xml.lastIndexOf(">" + 1));
return xml;
|
protected java.lang.Object | parseCallResult(java.io.InputStream data, com.facebook.api.IFacebookMethod method)Parses the result of an API call from XML into JAXB Objects.
if (isDebug()) {
System.out.println("Facebook response: " + this.rawResponse);
}
Object res = this.getResponsePOJO();
if (res instanceof FacebookApiException) {
FacebookApiException error = (FacebookApiException)res;
int errorCode = error.getErrorCode();
String message = error.getErrorMsg();
throw new FacebookException(errorCode, message);
}
return this.getResponsePOJO();
|
public java.lang.Integer | sms_send(java.lang.String message, java.lang.Integer smsSessionId, boolean makeNewSession)
throw new FacebookException(ErrorCode.GEN_UNKNOWN_METHOD, "The FacebookJsonRestClient does not support this API call. " +
"Please use an instance of FacebookRestClient instead.");
|
public java.lang.Integer | sms_send(java.lang.Long userId, java.lang.String message, java.lang.Integer smsSessionId, boolean makeNewSession)
throw new FacebookException(ErrorCode.GEN_UNKNOWN_METHOD, "The FacebookJsonRestClient does not support this API call. " +
"Please use an instance of FacebookRestClient instead.");
|