Copyright (c) 2012 CloudMine LLC, http://cloudmine.me
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software")...
If you think the Android project cloudmine-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.cloudmine.api.rest;
/*fromwww.java2s.com*/import com.android.volley.NetworkResponse;
import com.android.volley.Response;
import com.cloudmine.api.CMApiCredentials;
import com.cloudmine.api.rest.options.CMServerFunction;
import com.cloudmine.api.rest.response.CMObjectResponse;
import me.cloudmine.annotations.Expand;
import me.cloudmine.annotations.Optional;
/**
* A Request for loading user profiles
* <br>Copyright CloudMine LLC. All rights reserved
* <br> See LICENSE file included with SDK for details.
*/publicclass BaseLoadUserProfilesRequest extends CloudMineRequest<CMObjectResponse> {
publicstaticfinalint REQUEST_TYPE = 410;
/**
* Create a new Request for loading all user profiles
* @param apiCredentials nullable API credentials to use instead of the default
* @param serverFunction
* @param successListener
* @param errorListener
*/
@Expand
public BaseLoadUserProfilesRequest(@Optional CMApiCredentials apiCredentials, @Optional CMServerFunction serverFunction, @Optional Response.Listener<CMObjectResponse> successListener, @Optional Response.ErrorListener errorListener){
super(Method.GET, "/account", null, null, apiCredentials, serverFunction, successListener, errorListener);
}
/**
* Create a new request for loading all user profiles that match the specified search string
* @param searchString A search string. It is recommend that {@link com.cloudmine.api.SearchQuery} is used to construct this string
* @param serverFunction
* @param successListener
* @param errorListener
*/
@Expand
public BaseLoadUserProfilesRequest(String searchString, @Optional CMApiCredentials apiCredentials, @Optional CMServerFunction serverFunction, @Optional Response.Listener<CMObjectResponse> successListener, @Optional Response.ErrorListener errorListener){
super(Method.GET, "/account/search?p=" + CMURLBuilder.encode(searchString), null, null, apiCredentials, serverFunction, successListener, errorListener);
}
@Override
protected Response<CMObjectResponse> parseNetworkResponse(NetworkResponse networkResponse) {
return Response.success(new CMObjectResponse(new String(networkResponse.data), networkResponse.statusCode), getCacheEntry(networkResponse));
}
@Override
publicint getRequestType() {
return REQUEST_TYPE;
}
}