コード例 #1
0
  /** Retrieve the marketplace for the given subscription in order to login */
  private VOMarketplace determineMarketplaceForSubscription(
      HttpServletRequest httpRequest, AuthorizationRequestData rdo) throws ObjectNotFoundException {
    Map<String, VOMarketplace> cachedMarketplaces =
        getMarketplaceMapFromSession(httpRequest.getSession());
    VOMarketplace mpl = cachedMarketplaces.get(rdo.getSubscriptionKey());
    if (mpl == null) {
      MarketplaceService marketplaceService =
          ServiceAccess.getServiceAcccessFor(httpRequest.getSession())
              .getService(MarketplaceService.class);
      mpl =
          marketplaceService.getMarketplaceForSubscription(
              ADMStringUtils.parseUnsignedLong(rdo.getSubscriptionKey()), "en");

      // Bug 9588: Marketplace may have been deleted
      if (mpl != null) {
        cachedMarketplaces.put(rdo.getSubscriptionKey(), mpl);
      }
    }
    return mpl;
  }