public class CafetAPI extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BUILD |
static String |
NAME |
static String |
RELEASE_DATE |
static String |
VERSION |
public static final String NAME
public static final String VERSION
public static final String BUILD
public static final String RELEASE_DATE
public CafetAPI(URL url)
public static String getVersion()
public static CafetAPI getInstance()
public static void setInstance(CafetAPI instance)
public final String getServerVersion()
public final User getUser()
public final URL getUrl()
public final void setUrl(URL url)
public LoginResult login(String email, String password) throws IOException, APIException
IOExceptionAPIExceptionpublic void asyncLogin(AsyncHandler.AsyncLoginHandler handler, String email, String password)
public ArrayResult<Client> getClients() throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetClients(AsyncHandler.AsyncArrayHandler<Client> handler)
public DataResult<Client> getClient(int id) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetClient(AsyncHandler.AsyncDataHandler<Client> handler, int id)
public ArrayResult<Reload> getClientReloads(int id) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetClientReloads(AsyncHandler.AsyncArrayHandler<Reload> handler, int id)
public ArrayResult<Expense> getClientExpenses(int id) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetClientExpenses(AsyncHandler.AsyncArrayHandler<Expense> handler, int id)
public ArrayResult<ExpenseDetail> getExpenseDetails(int id) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetExpenseDetails(AsyncHandler.AsyncArrayHandler<ExpenseDetail> handler, int id)
public DataResult<ProductBought> getProductBought(int id) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetProductBought(AsyncHandler.AsyncDataHandler<ProductBought> handler, int id)
public DataResult<FormulaBought> getFormulaBought(int id) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetFormulaBought(AsyncHandler.AsyncDataHandler<FormulaBought> handler, int id)
public ArrayResult<ProductGroup> getProductGroups() throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetProductGroups(AsyncHandler.AsyncArrayHandler<ProductGroup> handler)
public DataResult<ProductGroup> getProductGroup(int id) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetProductGroup(AsyncHandler.AsyncDataHandler<ProductGroup> handler, int id)
public ArrayResult<Product> getGroupProducts(int id, boolean showUnviewable) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetGroupProducts(AsyncHandler.AsyncArrayHandler<Product> handler, int id, boolean showUnviewable)
public ArrayResult<ProductBought> getFormumaBoughtProducts(int id) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetFormumaBoughtProducts(AsyncHandler.AsyncArrayHandler<ProductBought> handler, int id)
public DataResult<Product> getProduct(int id) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetProduct(AsyncHandler.AsyncDataHandler<Product> handler, int id)
public ArrayResult<Formula> getFormulas(boolean showUnviewable) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetFormulas(AsyncHandler.AsyncArrayHandler<Formula> handler, boolean showUnviewable)
public DataResult<Formula> getFormula(int id) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetFormula(AsyncHandler.AsyncDataHandler<Formula> handler, int id)
public ArrayResult<Choice> getFormulaChoices(int id) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetFormulaChoices(AsyncHandler.AsyncArrayHandler<Choice> handler, int id)
public DataResult<Choice> getChoice(int id) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncGetChoice(AsyncHandler.AsyncDataHandler<Choice> handler, int id)
public ArrayResult<Client> searchClient(String expression) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSearchClient(AsyncHandler.AsyncArrayHandler<Client> handler, String expression)
public DataResult<ProductGroup> addProductGroup(String name) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncAddProductGroup(AsyncHandler.AsyncDataHandler<ProductGroup> handler, String name)
public DataResult<Product> addProduct(String name, int groupId) throws APIException, IOException
APIExceptionIOExceptionpublic DataResult<Product> addProduct(String name, int groupId, double price, boolean viewable) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncAddProduct(AsyncHandler.AsyncDataHandler<Product> handler, String name, int groupId)
public DataResult<Formula> addFormula(String name) throws APIException, IOException
APIExceptionIOExceptionpublic DataResult<Formula> addFormula(String name, double price, boolean viewable) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncAddFormula(AsyncHandler.AsyncDataHandler<Formula> handler, String name)
public DataResult<Choice> addChoice(String name, int formulaId) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncAddChoice(AsyncHandler.AsyncDataHandler<Choice> handler, String name, int formulaId)
public Result addProductToChoice(int choiceId, int... productIds) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncAddProductToChoice(AsyncHandler.AsyncSuccessHandler handler, int choiceId, int productId)
public Result setProductGroupDisplayName(int groupId, String displayName) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSetProductGroupDisplayName(AsyncHandler.AsyncSuccessHandler handler, int groupId, String displayName)
public Result setProductGroupName(int groupId, String name) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSetProductGroupName(AsyncHandler.AsyncSuccessHandler handler, int groupId, String name)
public Result setProductName(int productId, String name) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSetProductName(AsyncHandler.AsyncSuccessHandler handler, int productId, String name)
public Result setProductPrice(int productId, float price) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSetProductPrice(AsyncHandler.AsyncSuccessHandler handler, int productId, float price)
public Result setProductGroup(int productId, int groupId) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSetProductGroup(AsyncHandler.AsyncSuccessHandler handler, int productId, int groupId)
public Result setProductImage(int productId, Image image, String format) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSetProductImage(AsyncHandler.AsyncSuccessHandler handler, int productId, Image image, String format)
public Result setProductVisibility(int productId, boolean visilility) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSetProductVisibility(AsyncHandler.AsyncSuccessHandler handler, int productId, boolean visilility)
public Result setFormulaName(int formulaId, String name) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSetFormulaName(AsyncHandler.AsyncSuccessHandler handler, int formulaId, String name)
public Result setFormulaPrice(int formulaId, float price) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSetFormulaPrice(AsyncHandler.AsyncSuccessHandler handler, int formulaId, float price)
public Result setFormulaImage(int formulaId, Image image, String format) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSetFormulaImage(AsyncHandler.AsyncSuccessHandler handler, int formulaId, Image image, String format)
public Result setFormulaVisibility(int formulaId, boolean visilility) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSetFormulaVisibility(AsyncHandler.AsyncSuccessHandler handler, int formulaId, boolean visilility)
public Result setChoiceName(int choiceId, String name) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSetChoiceName(AsyncHandler.AsyncSuccessHandler handler, int choiceId, String name)
public Result removeProductFromChoice(int choiceId, int... productIds) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncRemoveProductFromChoice(AsyncHandler.AsyncSuccessHandler handler, int choiceId, int productId)
public Result removeProduct(int productId) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncRemoveProduct(AsyncHandler.AsyncSuccessHandler handler, int productId)
public Result removeProductGroup(int groupId) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncRemoveProductGroup(AsyncHandler.AsyncSuccessHandler handler, int groupId)
public Result removeFormula(int formulaId) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncRemoveFormula(AsyncHandler.AsyncSuccessHandler handler, int formulaId)
public Result removeFormulaChoice(int choiceId) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncRemoveFormulaChoice(AsyncHandler.AsyncSuccessHandler handler, int choiceId)
public Result saveReload(int clientId, float amount) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSaveReload(AsyncHandler.AsyncSuccessHandler handler, int clientId, float amount)
public Result saveOrder(int clientId, Map<Product,Integer> products, Map<OrderBuilder.FormulaBuilder,Product[]> formulas) throws APIException, IOException
APIExceptionIOExceptionpublic void asyncSaveOrder(AsyncHandler.AsyncSuccessHandler handler, int clientId, Map<Product,Integer> products, Map<OrderBuilder.FormulaBuilder,Product[]> formulas)
Copyright © 2019 Nowtryz. All rights reserved.