Exemple #1
0
 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);
   }
 }
Exemple #2
0
  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);
  }
Exemple #3
0
  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);
    }
  }
Exemple #4
0
 public void forceLogin() {
   mEbay.forceLogin();
   if (mEbayUK != null) mEbayUK.forceLogin();
 }