com.konakartadmin.bl
Class AdminRewardPointMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminRewardPointMgr
All Implemented Interfaces:
AdminRewardPointMgrIf

public class AdminRewardPointMgr
extends AdminBaseMgr
implements AdminRewardPointMgrIf

The AdminRewardPointMgr - Uses RewardPointCore for business logic


Nested Class Summary
 
Nested classes/interfaces inherited from class com.konakartadmin.bl.AdminBaseMgr
AdminBaseMgr.StaticData
 
Field Summary
protected static org.apache.commons.logging.Log log
          the log
 
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
 
Constructor Summary
AdminRewardPointMgr(KKAdminIf eng)
          Constructor
 
Method Summary
 int addPoints(int customerId, int points, java.lang.String code, java.lang.String description)
          Adds a number of reward points to the total for customer identified by the sessionId parameter.
protected  void addRewardPointConstraints(com.konakart.bl.KKCriteria c, AdminRewardPointSearch search)
          Used to add constraints to the query
protected  void addRewardPointOrderBy(com.konakart.bl.KKCriteria c, AdminRewardPointSearch search)
          Used to add sort order to the query
 int deletePoints(int customerId, int points, java.lang.String code, java.lang.String description)
          Deletes a number of reward points from the total for the customer identified by the sessionId parameter.
 void deleteReservedPoints(int customerId, int reservationId, java.lang.String code, java.lang.String description)
          Verifies that the reservationId parameter exists and that it belongs to the customer identified by the sessionId parameter.
 int freeReservedPoints(int customerId, int reservationId)
          Verifies that the reservationId parameter exists and that it belongs to the customer identified by the sessionId parameter.
protected  int getReservationId()
          Get a unique reservation id from the counter table
protected  int getRewardPointCount(org.apache.torque.util.Criteria c)
          This method is mainly used for paging.
 AdminRewardPointSearchResult getRewardPoints(AdminRewardPointSearch search, int offset, int size)
          Used to search for reward points belonging to a customer.
 int pointsAvailable(int customerId)
          Calculates the number of reward points available for the customer identified by the sessionId parameter.
 int reservePoints(int customerId, int points)
          Removes a number of reward points from the total for the customer identified by the sessionId parameter.
 
Methods inherited from class com.konakartadmin.bl.AdminBaseMgr
addInsertAttr, addInsertAttr, checkIntIsSet, checkRequired, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminHtmlMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminPublishProdMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getExportXMLData, getIntFromString, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getPostSearchText, getPreSearchText, getPropertyValue, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, manageException, refreshConfigs, removeCData, setAdminEng, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log

Constructor Detail

AdminRewardPointMgr

public AdminRewardPointMgr(KKAdminIf eng)
                    throws java.lang.Exception
Constructor

Parameters:
eng -
Throws:
java.lang.Exception
Method Detail

pointsAvailable

public int pointsAvailable(int customerId)
                    throws java.lang.Exception
Calculates the number of reward points available for the customer identified by the sessionId parameter.

Specified by:
pointsAvailable in interface AdminRewardPointMgrIf
Parameters:
customerId -
Returns:
Returns the number of points available for spending
Throws:
java.lang.Exception

addPoints

public int addPoints(int customerId,
                     int points,
                     java.lang.String code,
                     java.lang.String description)
              throws java.lang.Exception
Adds a number of reward points to the total for customer identified by the sessionId parameter.

Specified by:
addPoints in interface AdminRewardPointMgrIf
Parameters:
customerId -
points -
code - An optional code to categorize the reason for awarding the points
description - An optional description describing why the points were awarded
Returns:
Returns the new number of points available for spending
Throws:
java.lang.Exception

deletePoints

public int deletePoints(int customerId,
                        int points,
                        java.lang.String code,
                        java.lang.String description)
                 throws java.lang.Exception
Deletes a number of reward points from the total for the customer identified by the sessionId parameter.

Specified by:
deletePoints in interface AdminRewardPointMgrIf
Parameters:
customerId -
points -
code - An optional code to categorize the reason for redeeming the points
description - An optional description describing how the points were redeemed
Returns:
Returns the new number of points available for spending
Throws:
java.lang.Exception

reservePoints

public int reservePoints(int customerId,
                         int points)
                  throws java.lang.Exception
Removes a number of reward points from the total for the customer identified by the sessionId parameter. The removed points are not deleted but reserved, so that they are no longer available for spending but may be deleted once the order has been paid for or shipped. If the order is never fulfilled, then the reserved points may be freed and returned to the available total.

Specified by:
reservePoints in interface AdminRewardPointMgrIf
Parameters:
customerId -
points -
Returns:
Returns the reservation id of the reserved points
Throws:
java.lang.Exception

deleteReservedPoints

public void deleteReservedPoints(int customerId,
                                 int reservationId,
                                 java.lang.String code,
                                 java.lang.String description)
                          throws java.lang.Exception
Verifies that the reservationId parameter exists and that it belongs to the customer identified by the sessionId parameter. The reserved points are normally deleted once the order has been paid for or shipped. If the order is never fulfilled, then the reserved points may be freed and returned to the available total. Once deleted. the points can no longer be returned to the total.

Specified by:
deleteReservedPoints in interface AdminRewardPointMgrIf
Parameters:
customerId -
reservationId -
code - An optional code to categorize the reason for redeeming the points
description - An optional description describing how the points were redeemed
Throws:
java.lang.Exception

freeReservedPoints

public int freeReservedPoints(int customerId,
                              int reservationId)
                       throws java.lang.Exception
Verifies that the reservationId parameter exists and that it belongs to the customer identified by the sessionId parameter. The reserved points may be freed and returned to the available total using this API call. The method checks to see whether some or all of the points have expired while they were in the reserved state.

Specified by:
freeReservedPoints in interface AdminRewardPointMgrIf
Parameters:
customerId -
reservationId -
Returns:
Returns the number of points available for spending
Throws:
java.lang.Exception

getReservationId

protected int getReservationId()
                        throws java.lang.Exception
Get a unique reservation id from the counter table

Returns:
Returns a unique reservation id
Throws:
org.apache.torque.TorqueException
com.konakart.app.KKException
java.lang.Exception

getRewardPoints

public AdminRewardPointSearchResult getRewardPoints(AdminRewardPointSearch search,
                                                    int offset,
                                                    int size)
                                             throws KKAdminException,
                                                    org.apache.torque.TorqueException,
                                                    com.workingdogs.village.DataSetException
Used to search for reward points belonging to a customer.

Specified by:
getRewardPoints in interface AdminRewardPointMgrIf
Parameters:
search -
offset -
size -
Returns:
Returns a AdminRewardPointSearchResult object
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getRewardPointCount

protected int getRewardPointCount(org.apache.torque.util.Criteria c)
                           throws org.apache.torque.TorqueException,
                                  com.workingdogs.village.DataSetException
This method is mainly used for paging.

Parameters:
c -
Returns:
The number of records present in the database matching the given criteria
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

addRewardPointOrderBy

protected void addRewardPointOrderBy(com.konakart.bl.KKCriteria c,
                                     AdminRewardPointSearch search)
Used to add sort order to the query

Parameters:
c -
search -

addRewardPointConstraints

protected void addRewardPointConstraints(com.konakart.bl.KKCriteria c,
                                         AdminRewardPointSearch search)
Used to add constraints to the query

Parameters:
c -
search -


Copyright © 2011 DS Data Systems UK Ltd.