use of com.willshex.blogwt.shared.api.blog.call.SetupBlogResponse in project blogwt by billy1380.
the class PropertyController method setupBlog.
public void setupBlog(List<Property> properties, List<User> users) {
final SetupBlogRequest input = ApiHelper.setAccessCode(new SetupBlogRequest()).properties(properties).users(users);
BlogService blogService = ApiHelper.createBlogClient();
blogService.setupBlog(input, new AsyncCallback<SetupBlogResponse>() {
@Override
public void onSuccess(SetupBlogResponse output) {
DefaultEventBus.get().fireEventFromSource(new SetupBlogSuccess(input, output), PropertyController.this);
}
@Override
public void onFailure(Throwable caught) {
DefaultEventBus.get().fireEventFromSource(new SetupBlogFailure(input, caught), PropertyController.this);
}
});
}
use of com.willshex.blogwt.shared.api.blog.call.SetupBlogResponse in project blogwt by billy1380.
the class BlogService method setupBlog.
public Request setupBlog(SetupBlogRequest input, AsyncSuccess<SetupBlogRequest, SetupBlogResponse> onSuccess, AsyncFailure<SetupBlogRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodSetupBlog, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
SetupBlogResponse outputParameter = new SetupBlogResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodSetupBlog, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodSetupBlog, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodSetupBlog, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodSetupBlog, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodSetupBlog, input, exception);
}
return handle;
}
Aggregations