-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
completed ticker message handler, started on orderbook handler
- Loading branch information
1 parent
29170e4
commit 27469df
Showing
5 changed files
with
43 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/com/cf/client/poloniex/wss/model/PolonicexWSSOrderBook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
package com.cf.client.poloniex.wss.model; | ||
|
||
/** | ||
* | ||
* @author David | ||
*/ | ||
public class PolonicexWSSOrderBook { | ||
|
||
} |
22 changes: 21 additions & 1 deletion
22
src/main/java/com/cf/client/wss/handler/OrderBookMessageHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,34 @@ | ||
package com.cf.client.wss.handler; | ||
|
||
import com.cf.client.poloniex.wss.model.PolonicexWSSOrderBook; | ||
import com.google.gson.Gson; | ||
import java.util.List; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
/** | ||
* | ||
* @author David | ||
*/ | ||
public class OrderBookMessageHandler implements IMessageHandler { | ||
|
||
private final static Logger LOG = LogManager.getLogger(); | ||
private final static Gson GSON = new Gson(); | ||
|
||
@Override | ||
public void handle(String message) { | ||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. | ||
LOG.trace(message); | ||
PolonicexWSSOrderBook orderBook = this.mapMessageToPoloniexOrderBook(message); | ||
LOG.trace(orderBook); | ||
} | ||
|
||
protected PolonicexWSSOrderBook mapMessageToPoloniexOrderBook(String message) { | ||
List results = GSON.fromJson(message, List.class); | ||
if (results.size() < 3) { | ||
return null; | ||
} | ||
|
||
return null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters