This file contains hidden or 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
public interface TradingAccountManager { | |
Account createAccount(String actName, Price startingCashBalance); | |
void closeAccount(Account account); | |
} |
This file contains hidden or 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
Observable<Map.Entry<Date, TradingAccountModel>> accountHistory(Account account, Date start); |
This file contains hidden or 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
public static final ValueFactory vals = new ValueFactoryImpl(); | |
@Test | |
public void testPriceText() { | |
Price p1 = vals.newPrice(-5, -1); | |
Price p2 = vals.newPrice(-5, 0); | |
Price p3 = vals.newPrice(5, -1); | |
Price p4 = vals.newPrice(5, 0); | |
Fraction f = vals.newFraction(10, -1); |
This file contains hidden or 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
public class FilterHistoricData { | |
public static final String SYMBOL1 = "XFU4"; | |
public static final String SYMBOL2 = "XFH4"; | |
public static final String SYMBOL3 = "XFK4"; | |
/** ddf time stamp encoding/decoding mask */ | |
final static int DDF_TIME_STAMP_MASK = 0x40; | |
final static byte DDF_CENTURY = 0x14; | |
This file contains hidden or 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
HTTP Status 500 - Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.marketplace-protectedRequestContext': Invocation of init method failed; nested exception is com.blizzard.asterion.client.exception.AsterionException: javax.xml.ws.soap.SOAPFaultException: Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object | |
type Exception report | |
message Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.marketplace-protectedRequestContext': Invocation of init method failed; nested exception is com.blizzard.asterion.client.exception.AsterionException: javax.xml.ws.soap.SOAPFaultException: Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error |
This file contains hidden or 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
static final ReadableDateTime dateFromString(final String time) { | |
MutableDateTime t = new MutableDateTime(); | |
t.setYear(Integer.parseInt(time.subSequence(0,4).toString())); | |
t.setMonthOfYear(Integer.parseInt(time.subSequence(4,6).toString())); | |
t.setDayOfMonth(Integer.parseInt(time.subSequence(6,8).toString())); | |
t.setHourOfDay(Integer.parseInt(time.subSequence(8,10).toString())); | |
t.setMinuteOfHour(Integer.parseInt(time.subSequence(10, 12).toString())); | |
t.setSecondOfMinute(Integer.parseInt(time.subSequence(12,14).toString())); | |
t.setMillisOfSecond(Integer.parseInt(time.subSequence(14,17).toString())); |
This file contains hidden or 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
final static byte encodeTimeStampByte(final int timeField) { | |
return (byte) (timeField | DDF_TIME_STAMP_MASK); | |
} | |
// | |
// /** time zone information is discarded */ | |
static final void encodeTimeStamp(final ReadableDateTime dateTime, final ByteBuffer buffer) { | |
// base fields | |
buffer.put(DDF_CENTURY); // century | |
buffer.put(encodeTimeStampByte(dateTime.getYearOfCentury())); // year |
This file contains hidden or 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
public class BarchartMarketplaceReplay extends BarchartMarketplace { | |
public BarchartMarketplaceReplay(final int socketAddress) { | |
super("", ""); | |
maker = DDF_Marketplace.newInstance(new DummySubHandler()); | |
} | |
public void handleMessage(final DDF_BaseMessage message) { |
This file contains hidden or 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
public class BarchartMarketplaceReplay extends BarchartMarketplace { | |
public BarchartMarketplaceReplay(final int socketAddress) { | |
super("", ""); | |
this.connection = new HistoricReplayListenerClientDDF(socketAddress, | |
Executors.newCachedThreadPool( | |
new ThreadFactory() { |
This file contains hidden or 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
interface LastPrice { | |
/** | |
* In order of lowest to highest priority | |
*/ | |
enum Source { | |
NULL, PREV_SETTLE, LAST_TRADE, CLOSE, SETTLE | |
} | |
Source source(); |