2018-03-28 01:44:41 +00:00
|
|
|
package cy.agorise.crystalwallet.requestmanagers;
|
2017-10-02 01:50:12 +00:00
|
|
|
|
2018-08-15 22:36:20 +00:00
|
|
|
import android.app.Activity;
|
|
|
|
|
2017-10-02 01:50:12 +00:00
|
|
|
import cy.agorise.crystalwallet.enums.CryptoCoin;
|
|
|
|
|
|
|
|
/**
|
2017-11-12 19:20:03 +00:00
|
|
|
* An request for the managers. Is used for the asyncrhonous petition of each manager
|
|
|
|
*
|
|
|
|
*
|
2017-10-02 01:50:12 +00:00
|
|
|
* Created by Henry Varona on 1/10/2017.
|
|
|
|
*/
|
|
|
|
|
2017-10-03 02:25:58 +00:00
|
|
|
public abstract class CryptoNetInfoRequest {
|
2017-11-12 19:20:03 +00:00
|
|
|
/**
|
|
|
|
* The cryptocoin this request belongs
|
|
|
|
*/
|
2017-10-02 01:50:12 +00:00
|
|
|
protected CryptoCoin coin;
|
2017-11-12 19:20:03 +00:00
|
|
|
/**
|
|
|
|
* The listener for the answer of this petition
|
|
|
|
*/
|
2017-10-02 01:50:12 +00:00
|
|
|
protected CryptoNetInfoRequestListener listener;
|
|
|
|
|
2018-08-15 22:36:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-28 01:44:41 +00:00
|
|
|
protected CryptoNetInfoRequest(CryptoCoin coin){
|
2017-10-02 01:50:12 +00:00
|
|
|
this.coin = coin;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setListener(CryptoNetInfoRequestListener listener){
|
|
|
|
this.listener = listener;
|
|
|
|
}
|
|
|
|
|
2017-10-05 00:54:24 +00:00
|
|
|
protected void _fireOnCarryOutEvent(){
|
2018-09-16 01:25:41 +00:00
|
|
|
if (listener != null) {
|
|
|
|
listener.onCarryOut();
|
|
|
|
}
|
2018-06-11 00:10:55 +00:00
|
|
|
CryptoNetInfoRequests.getInstance().removeRequest(this);
|
2017-10-02 01:50:12 +00:00
|
|
|
}
|
2018-08-15 22:36:20 +00:00
|
|
|
|
2017-10-02 01:50:12 +00:00
|
|
|
}
|