private void buildAuctionEntryFromFile(String fname) { StringBuffer sb = new StringBuffer(StringTools.cat(fname)); try { long start = System.currentTimeMillis(); AuctionInfo ai = mEbay.doParse(sb); AuctionEntry ae = EntryFactory.getInstance().constructEntry(); ae.setAuctionInfo(ai); System.out.println("Took: " + (System.currentTimeMillis() - start)); JConfig.log().logMessage(ae.toXML().toString()); } catch (Exception e) { JConfig.log().handleException("Failed to load auction from file: " + fname, e); } }
private void setupAuctionResolver() { mEbay = new ebayServer(mCountry, mUsername, mPassword); mEbayUK = new ebayServer("ebay.co.uk", mUsername, mPassword); Resolver r = new Resolver() { public AuctionServerInterface getServer() { return mEbay; } }; AuctionServerManager.getInstance().setServer(mEbay); mEbay.setBackupServer(mEbayUK); EntryFactory.setResolver(r); }
public void execute() { setupAuctionResolver(); if (mRunServer) { spawnServer(); } else if (mJustMyeBay) { MQFactory.getConcrete(mEbay.getFriendlyName()) .enqueueBean(new AuctionQObject(AuctionQObject.LOAD_MYITEMS, null, null)); try { Thread.sleep(120000); } catch (Exception ignored) { } } else if (mParseFile != null) { JConfig.setHomeDirectory("./"); buildAuctionEntryFromFile(mParseFile); } else { retrieveAndVerifyAuctions(mParams); } }
public void forceLogin() { mEbay.forceLogin(); if (mEbayUK != null) mEbayUK.forceLogin(); }