@Override
  public final OnlineBuyer getBuyr(final Map<String, Object> pRqVs,
    final IRequestData pRqDt) throws Exception {
    Long buyerId = null;
    String buyerIdStr = pRqDt.getCookieValue("cBuyerId");
    if (buyerIdStr != null && buyerIdStr.length() > 0) {
       buyerId = Long.valueOf(buyerIdStr);
    }
    OnlineBuyer buyer = null;
    if (buyerId != null) {
      buyer = getSrvOrm().retrieveEntityById(pRqVs, OnlineBuyer.class, buyerId);
    }
    if (buyer != null && buyer.getRegEmail() != null
      && buyer.getBuSeId() != null) {
      String buSeId = pRqDt.getCookieValue("buSeId");
      if (!buyer.getBuSeId().equals(buSeId)) {
        this.spamHnd.handle(pRqVs, pRqDt, 100,
          "Buyer. Authorized invasion? cBuyerId: " + buyerIdStr);
        //buyer also might clears cookie, so it's need new authorization
        //new/free buyer will be used till authorization:
        buyer = null;
      }
    }
    return buyer;
  }
@ Override public final OnlineBuyer getBuyr ( final Map < String , Object > pRqVs , final IRequestData pRqDt ) throws Exception { Long buyerId = null ; String buyerIdStr = pRqDt . getCookieValue ( "cBuyerId" ) ; if ( buyerIdStr != null && buyerIdStr . length ( ) > 0 ) { buyerId = Long . valueOf ( buyerIdStr ) ; } OnlineBuyer buyer = null ; if ( buyerId != null ) { buyer = getSrvOrm ( ) . retrieveEntityById ( pRqVs , OnlineBuyer . class , buyerId ) ; } if ( buyer != null && buyer . getRegEmail ( ) != null && buyer . getBuSeId ( ) != null ) { String buSeId = pRqDt . getCookieValue ( "buSeId" ) ; if ( ! buyer . getBuSeId ( ) . equals ( buSeId ) ) { this . spamHnd . handle ( pRqVs , pRqDt , 100 , "Buyer. Authorized invasion? cBuyerId: " + buyerIdStr ) ; buyer = null ; } } return buyer ; }
<p>Get authorized or not buyer.</p>
@param pRqVs request scoped vars
@param pRqDt Request Data
@return buyer or null
@throws Exception - an exception