com.parse.ParseQueryController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of parse-android Show documentation
Show all versions of parse-android Show documentation
A library that gives you access to the powerful Parse cloud platform from your Android app.
/*
* Copyright (c) 2015-present, Parse, LLC.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package com.parse;
import java.util.List;
import bolts.Task;
/**
* A {@code ParseQueryController} defines how a {@link ParseQuery} is executed.
*/
/** package */ interface ParseQueryController {
/**
* Executor for {@code find} queries.
* @param state Immutable query state to execute.
* @param user The user executing the query that can be used to match ACLs.
* @param cancellationToken Cancellation token.
* @return A {@link Task} that resolves to the results of the find.
*/
public Task> findAsync(ParseQuery.State state, ParseUser user,
Task cancellationToken);
/**
* Executor for {@code count} queries.
* @param state Immutable query state to execute.
* @param user The user executing the query that can be used to match ACLs.
* @param cancellationToken Cancellation token.
* @return A {@link Task} that resolves to the results of the count.
*/
public Task countAsync(ParseQuery.State state, ParseUser user,
Task cancellationToken);
/**
* Executor for {@code getFirst} queries.
* @param state Immutable query state to execute.
* @param user The user executing the query that can be used to match ACLs.
* @param cancellationToken Cancellation token.
* @return A {@link Task} that resolves to the the first result of the query if successful and
* there is at least one result or {@link ParseException#OBJECT_NOT_FOUND} if there are no
* results.
*/
public Task getFirstAsync(ParseQuery.State state, ParseUser user,
Task cancellationToken);
}