Added comments and licenses.

This commit is contained in:
b00lean 2014-12-13 01:15:18 +01:00
parent 48e67f5709
commit 1d2716fa7f
2 changed files with 79 additions and 7 deletions

View File

@ -1,10 +1,35 @@
/*************************************************************************************
* Copyright (C) 2014 GENERAL BYTES s.r.o. All rights reserved.
*
* This software may be distributed and modified under the terms of the GNU
* General Public License version 2 (GPL2) as published by the Free Software
* Foundation and appearing in the file GPL2.TXT included in the packaging of
* this file. Please note that GPL2 Section 2[b] requires that all works based
* on this software must also be made publicly available under the terms of
* the GPL2 ("Copyleft").
*
* Contact information
* -------------------
*
* GENERAL BYTES s.r.o.
* Web : http://www.generalbytes.com
*
************************************************************************************/
package com.generalbytes.batm.server.extensions; package com.generalbytes.batm.server.extensions;
import java.math.BigDecimal; import java.math.BigDecimal;
/**
* Created by b00lean on 12/12/14.
*/
public interface IExchangeAdvanced extends IExchange{ public interface IExchangeAdvanced extends IExchange{
/**
* This method is used for instantiating task that is later called to purchase coins on the exchange using specified fiat currency to use.
* If something fails this method should return NULL otherwise it should return orderId or any other identifier that exchange provides for later tracking
*
* @param amount
* @param cryptoCurrency
* @param fiatCurrencyToUse
* @param description
* @return
*/
public ITask createPurchaseCoinsTask(BigDecimal amount, String cryptoCurrency, String fiatCurrencyToUse, String description); public ITask createPurchaseCoinsTask(BigDecimal amount, String cryptoCurrency, String fiatCurrencyToUse, String description);
} }

View File

@ -1,14 +1,61 @@
/*************************************************************************************
* Copyright (C) 2014 GENERAL BYTES s.r.o. All rights reserved.
*
* This software may be distributed and modified under the terms of the GNU
* General Public License version 2 (GPL2) as published by the Free Software
* Foundation and appearing in the file GPL2.TXT included in the packaging of
* this file. Please note that GPL2 Section 2[b] requires that all works based
* on this software must also be made publicly available under the terms of
* the GPL2 ("Copyleft").
*
* Contact information
* -------------------
*
* GENERAL BYTES s.r.o.
* Web : http://www.generalbytes.com
*
************************************************************************************/
package com.generalbytes.batm.server.extensions; package com.generalbytes.batm.server.extensions;
/**
* Created by b00lean on 12/12/14.
*/
public interface ITask { public interface ITask {
/**
* Called when task is created
* @return
*/
public boolean onCreate(); public boolean onCreate();
/**
* Called periodically to perform repeating jobs
* @return
*/
public boolean onDoStep(); public boolean onDoStep();
/**
* Called when task is finished
* @return
*/
public void onFinish(); public void onFinish();
/**
* This method is called by task manager to test if it should be removed from list of tasks
* @return
*/
public boolean isFinished(); public boolean isFinished();
public String getResult();
/**
* Called to obtain result of task
* @return
*/
public Object getResult();
/**
* Called to check if task has failed
* @return
*/
public boolean isFailed(); public boolean isFailed();
/**
* Called by task manager to correctly schedule next call of onDoStep
* @return
*/
public long getShortestTimeForNexStepInvocation(); public long getShortestTimeForNexStepInvocation();
} }