Making the GetLimitOrders and TransactionBroadcastSequence implement the BaseGrapheneHandler interface

This commit is contained in:
Nelson R. Perez 2017-04-10 12:08:51 -05:00
parent 716dee58d5
commit 66a5ba497d
2 changed files with 29 additions and 18 deletions

View file

@ -3,9 +3,15 @@ package de.bitsharesmunich.graphenej.api;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.neovisionaries.ws.client.WebSocket; import com.neovisionaries.ws.client.WebSocket;
import com.neovisionaries.ws.client.WebSocketAdapter;
import com.neovisionaries.ws.client.WebSocketException; import com.neovisionaries.ws.client.WebSocketException;
import com.neovisionaries.ws.client.WebSocketFrame; import com.neovisionaries.ws.client.WebSocketFrame;
import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import de.bitsharesmunich.graphenej.AssetAmount; import de.bitsharesmunich.graphenej.AssetAmount;
import de.bitsharesmunich.graphenej.LimitOrder; import de.bitsharesmunich.graphenej.LimitOrder;
import de.bitsharesmunich.graphenej.RPC; import de.bitsharesmunich.graphenej.RPC;
@ -15,16 +21,10 @@ import de.bitsharesmunich.graphenej.models.ApiCall;
import de.bitsharesmunich.graphenej.models.BaseResponse; import de.bitsharesmunich.graphenej.models.BaseResponse;
import de.bitsharesmunich.graphenej.models.WitnessResponse; import de.bitsharesmunich.graphenej.models.WitnessResponse;
import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/** /**
* Created by nelson on 11/15/16. * Created by nelson on 11/15/16.
*/ */
public class GetLimitOrders extends WebSocketAdapter { public class GetLimitOrders extends BaseGrapheneHandler {
private String a; private String a;
private String b; private String b;
@ -32,6 +32,7 @@ public class GetLimitOrders extends WebSocketAdapter {
private WitnessResponseListener mListener; private WitnessResponseListener mListener;
public GetLimitOrders(String a, String b, int limit, WitnessResponseListener mListener) { public GetLimitOrders(String a, String b, int limit, WitnessResponseListener mListener) {
super(mListener);
this.a = a; this.a = a;
this.b = b; this.b = b;
this.limit = limit; this.limit = limit;

View file

@ -1,27 +1,36 @@
package de.bitsharesmunich.graphenej.api; package de.bitsharesmunich.graphenej.api;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.neovisionaries.ws.client.WebSocket;
import com.neovisionaries.ws.client.WebSocketException;
import com.neovisionaries.ws.client.WebSocketFrame;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.ArrayList;
import com.google.gson.Gson; import java.util.Date;
import com.google.gson.GsonBuilder; import java.util.List;
import com.google.gson.reflect.TypeToken; import java.util.Map;
import de.bitsharesmunich.graphenej.*; import java.util.TimeZone;
import de.bitsharesmunich.graphenej.Asset;
import de.bitsharesmunich.graphenej.AssetAmount;
import de.bitsharesmunich.graphenej.BlockData;
import de.bitsharesmunich.graphenej.RPC;
import de.bitsharesmunich.graphenej.Transaction;
import de.bitsharesmunich.graphenej.interfaces.WitnessResponseListener; import de.bitsharesmunich.graphenej.interfaces.WitnessResponseListener;
import de.bitsharesmunich.graphenej.models.ApiCall; import de.bitsharesmunich.graphenej.models.ApiCall;
import de.bitsharesmunich.graphenej.models.BaseResponse; import de.bitsharesmunich.graphenej.models.BaseResponse;
import de.bitsharesmunich.graphenej.models.DynamicGlobalProperties; import de.bitsharesmunich.graphenej.models.DynamicGlobalProperties;
import de.bitsharesmunich.graphenej.models.WitnessResponse; import de.bitsharesmunich.graphenej.models.WitnessResponse;
import com.neovisionaries.ws.client.WebSocket;
import com.neovisionaries.ws.client.WebSocketAdapter;
import com.neovisionaries.ws.client.WebSocketException;
import com.neovisionaries.ws.client.WebSocketFrame;
/** /**
* Class that will handle the transaction publication procedure. * Class that will handle the transaction publication procedure.
*/ */
public class TransactionBroadcastSequence extends WebSocketAdapter { public class TransactionBroadcastSequence extends BaseGrapheneHandler {
private final String TAG = this.getClass().getName(); private final String TAG = this.getClass().getName();
private final static int LOGIN_ID = 1; private final static int LOGIN_ID = 1;
@ -45,6 +54,7 @@ public class TransactionBroadcastSequence extends WebSocketAdapter {
* of the transaction broadcast operation. * of the transaction broadcast operation.
*/ */
public TransactionBroadcastSequence(Transaction transaction, Asset feeAsset, WitnessResponseListener listener){ public TransactionBroadcastSequence(Transaction transaction, Asset feeAsset, WitnessResponseListener listener){
super(listener);
this.transaction = transaction; this.transaction = transaction;
this.feeAsset = feeAsset; this.feeAsset = feeAsset;
this.mListener = listener; this.mListener = listener;