public class AdminBookableProductMgr extends AdminBaseMgr implements AdminBookableProductMgrIf
AdminBaseMgr.StaticData
Modifier and Type | Field and Description |
---|---|
protected static int |
BOOKING_COUNT_RETRIES_DEFAULT
Default for number of retries when updating booking count
|
protected static int |
bookingCountMaxRetries
Number of times to retry the booking count update SQL
|
protected static java.lang.String |
bookingCountMutex
Mutex for updating booking count
|
protected static java.lang.String |
bookProdMgrMutex
Mutex for the bookable product manager
|
private static boolean |
configInit
Flag to determine whether the configs have been initialised
|
protected static org.apache.commons.logging.Log |
log
the log
|
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, debugStackTraceExclusions, kkAdminPropsFilePath, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
Constructor and Description |
---|
AdminBookableProductMgr(KKAdminIf eng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
addBookingOrderBy(com.konakart.db.KKCriteria c,
AdminBookingSearch search)
Add the order by constraints
|
protected int |
addBookingSearchCriteria(com.konakart.db.KKCriteria c,
AdminBookingSearch search,
AdminBookableProductOptions options)
Add the search criteria
|
void |
deleteBookableProduct(int productId)
Delete the bookable Product
|
void |
deleteBookableProduct(int productId,
java.sql.Connection con)
Delete the bookable Product
|
void |
deleteBooking(int bookingId,
AdminBookableProductOptions options)
Delete the booking
|
AdminBookableProduct |
getBookableProduct(int productId)
Gets a Bookable Product object for a product id
|
AdminBookableProduct |
getBookableProduct(int productId,
java.sql.Connection con)
Gets a Bookable Product object for a product id
|
AdminBooking |
getBooking(int bookingId,
AdminBookableProductOptions options)
Return a booking by Id
|
protected int |
getBookingCount(AdminBookingSearch search,
AdminBookableProductOptions options)
Get the number of bookings
|
static int |
getBookingCountMaxRetries() |
int |
getBookingQty(int bookingId,
AdminBookableProductOptions options)
Return a booking by Id
|
AdminBookingSearchResult |
getBookings(AdminBookingSearch search,
int offset,
int size,
AdminBookableProductOptions bookableProductOptions)
Method used to search for bookings.
|
private AdminConfigurationMgrIf |
getCfgMgr() |
void |
insertBookableProduct(AdminBookableProduct bProd)
Inserts a BookableProduct object into the database.
|
void |
insertBookableProduct(AdminBookableProduct bProd,
java.sql.Connection con,
com.konakart.db.KKCriteria insertC)
Inserts a BookableProduct object into the database.
|
int |
insertBooking(AdminBooking booking,
AdminBookableProductOptions options)
Inserts a Booking object into the database.
|
void |
refreshConfigs()
Refresh the configuration of the bookable product manager
|
protected void |
setBookableProductCriteriaWithStandardAttributes(com.konakart.db.KKCriteria c)
Set the standard attributes
|
static void |
setBookingCountMaxRetries(int bookingCountMaxRetries) |
protected void |
setBookingCriteriaWithStandardAttributes(com.konakart.db.KKCriteria c)
Set the standard attributes
|
protected void |
setBookingInsertCriteriaWithStandardAttributes(AdminBookableProduct bProd,
com.konakart.db.KKCriteria insertC)
Method that avoids duplication of code
|
protected void |
setBookingUpdateCriteriaWithStandardAttributes(AdminBookableProduct bProd,
com.konakart.db.KKCriteria selectC,
com.konakart.db.KKCriteria updateC)
Method that avoids duplication of code
|
void |
updateBookableProduct(AdminBookableProduct bProd)
This method is use to edit an existing bookable product.
|
void |
updateBookableProduct(AdminBookableProduct bProd,
java.sql.Connection con,
com.konakart.db.KKCriteria selectC,
com.konakart.db.KKCriteria updateC)
This method is use to edit an existing bookable product.
|
void |
updateBooking(AdminBooking booking,
AdminBookableProductOptions options)
This method is used to edit an existing booking.
|
protected void |
updateBookingCount(int productId,
AdminBookableProductOptions options,
int numBookings)
Update the number of bookings present
|
protected void |
validateBookableProduct(AdminBookableProduct bProd,
boolean checkProd)
Validate the bookable product
|
protected void |
validateBooking(AdminBooking booking,
int bookingQtyChange,
AdminBookableProductOptions options)
Validate the booking
|
addInsertAttr, addInsertAttr, addStringRuleConstraint, addStringRuleConstraint, checkAPICallEnabled, checkIntInRange, checkIntIsSet, checkRequired, executeQuery, executeQuery, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminContentMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustPwdHistMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminEngineCacheMgr, getAdminEventMgr, getAdminExecuteMgr, getAdminFileMgr, getAdminFilterMgr, getAdminHtmlMgr, getAdminImportMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminMiscPriceMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminServletMgr, getAdminShipmentMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminSuggestionMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getDebugStackTraceExclusions, getEmailThreadGracefulShutdownTimeout, getExportMgr, getExportMgr, getExportXMLData, getIntFromString, getKkAdminPropsFilePath, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getNewCriteria, getNewCriteria, getOtherModuleByName, getPostSearchText, getPreSearchText, getProductsToCategoresCriteria, getPropertyValue, getPropertyValue, getPropertyValueAsBool, getPropertyValueAsInt, getPropertyValueAsLong, getRecordCount, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, insertKKEvent, insertKKEvent, isBusiness, isBusinessOrEnterprise, isCommunity, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareCustomersOrProducts, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, isUnix, isWindows, manageException, manageThrowable, removeCData, sendMQMessages, setAdminEng, setDebugStackTraceExclusions, setKkAdminPropsFilePath, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr, updateStaticVariablesNow
protected static org.apache.commons.logging.Log log
protected static java.lang.String bookingCountMutex
protected static final int BOOKING_COUNT_RETRIES_DEFAULT
protected static int bookingCountMaxRetries
protected static java.lang.String bookProdMgrMutex
private static boolean configInit
public AdminBookableProductMgr(KKAdminIf eng) throws java.lang.Exception
eng
- the engjava.lang.Exception
- an unexpected exceptionpublic void insertBookableProduct(AdminBookableProduct bProd) throws java.lang.Exception
insertBookableProduct
in interface AdminBookableProductMgrIf
bProd
- A bookable product objectjava.lang.Exception
- an unexpected exceptionpublic void insertBookableProduct(AdminBookableProduct bProd, java.sql.Connection con, com.konakart.db.KKCriteria insertC) throws java.lang.Exception
insertBookableProduct
in interface AdminBookableProductMgrIf
bProd
- A bookable product objectcon
- Database connectioninsertC
- Criteria objectjava.lang.Exception
- an unexpected exceptionprotected void setBookingInsertCriteriaWithStandardAttributes(AdminBookableProduct bProd, com.konakart.db.KKCriteria insertC)
bProd
- the bProdinsertC
- the insertCpublic void updateBookableProduct(AdminBookableProduct bProd) throws java.lang.Exception
updateBookableProduct
in interface AdminBookableProductMgrIf
bProd
- A bookable product objectjava.lang.Exception
- an unexpected exceptionpublic void updateBookableProduct(AdminBookableProduct bProd, java.sql.Connection con, com.konakart.db.KKCriteria selectC, com.konakart.db.KKCriteria updateC) throws java.lang.Exception
updateBookableProduct
in interface AdminBookableProductMgrIf
bProd
- A bookable product objectcon
- Database connectionselectC
- Criteria objectupdateC
- Criteria objectjava.lang.Exception
- an unexpected exceptionprotected void setBookingUpdateCriteriaWithStandardAttributes(AdminBookableProduct bProd, com.konakart.db.KKCriteria selectC, com.konakart.db.KKCriteria updateC)
bProd
- the bProdselectC
- the selectCupdateC
- the updateCpublic AdminBookableProduct getBookableProduct(int productId) throws com.workingdogs.village.DataSetException, org.apache.torque.TorqueException, KKAdminException
getBookableProduct
in interface AdminBookableProductMgrIf
productId
- the productIdcom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)KKAdminException
- an unexpected exception in the KonaKart Admin enginepublic AdminBookableProduct getBookableProduct(int productId, java.sql.Connection con) throws com.workingdogs.village.DataSetException, org.apache.torque.TorqueException, KKAdminException
getBookableProduct
in interface AdminBookableProductMgrIf
productId
- the productIdcon
- Connection for Transactioncom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)KKAdminException
- an unexpected exception in the KonaKart Admin engineprotected void setBookableProductCriteriaWithStandardAttributes(com.konakart.db.KKCriteria c)
c
- the cprotected void validateBookableProduct(AdminBookableProduct bProd, boolean checkProd) throws KKAdminException
bProd
- the bProdcheckProd
- Check to see whether product existsKKAdminException
- an unexpected exception in the KonaKart Admin enginepublic int insertBooking(AdminBooking booking, AdminBookableProductOptions options) throws KKAdminException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
insertBooking
in interface AdminBookableProductMgrIf
booking
- A booking objectoptions
- AdminBookableProduct optionsKKAdminException
- an unexpected exception in the KonaKart Admin enginecom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)protected void updateBookingCount(int productId, AdminBookableProductOptions options, int numBookings) throws KKAdminException, com.workingdogs.village.DataSetException, org.apache.torque.TorqueException
productId
- the productIdoptions
- the optionsnumBookings
- Number of bookings being added or deleted (if negative)KKAdminException
- an unexpected exception in the KonaKart Admin enginecom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)private AdminConfigurationMgrIf getCfgMgr() throws KKAdminException
KKAdminException
public void updateBooking(AdminBooking booking, AdminBookableProductOptions options) throws org.apache.torque.TorqueException, KKAdminException, com.workingdogs.village.DataSetException
updateBooking
in interface AdminBookableProductMgrIf
booking
- A booking objectoptions
- AdminBookableProduct optionscom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)KKAdminException
- an unexpected exception in the KonaKart Admin engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)protected void validateBooking(AdminBooking booking, int bookingQtyChange, AdminBookableProductOptions options) throws KKAdminException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
booking
- the bookingbookingQtyChange
- an integer that holds the change to the booking qty on the bookable product prior
to the insert, update or delete of the specified booking. For inserts this number
will be greater than or equal to 0, for updates it could be any value, and deletes
it will be less than or equal to zerooptions
- AdminBookableProduct optionsKKAdminException
- an unexpected exception in the KonaKart Admin enginecom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public void deleteBooking(int bookingId, AdminBookableProductOptions options) throws java.lang.Exception
deleteBooking
in interface AdminBookableProductMgrIf
bookingId
- the bookingIdoptions
- AdminBookableProduct optionsjava.lang.Exception
- an unexpected exceptionpublic void deleteBookableProduct(int productId) throws org.apache.torque.TorqueException, KKAdminException, com.workingdogs.village.DataSetException
deleteBookableProduct
in interface AdminBookableProductMgrIf
productId
- the productIdorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)KKAdminException
- an unexpected exception in the KonaKart Admin enginecom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public void deleteBookableProduct(int productId, java.sql.Connection con) throws org.apache.torque.TorqueException, KKAdminException, com.workingdogs.village.DataSetException
deleteBookableProduct
in interface AdminBookableProductMgrIf
productId
- the productIdcon
- Connection for transactionorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)KKAdminException
- an unexpected exception in the KonaKart Admin enginecom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public AdminBooking getBooking(int bookingId, AdminBookableProductOptions options) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
getBooking
in interface AdminBookableProductMgrIf
bookingId
- the bookingIdoptions
- AdminBookableProduct optionsorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)KKAdminException
- an unexpected exception in the KonaKart Admin enginepublic int getBookingQty(int bookingId, AdminBookableProductOptions options) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
bookingId
- the booking Idoptions
- AdminBookableProductOptionsorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)KKAdminException
- an unexpected exception in the KonaKart Admin enginepublic AdminBookingSearchResult getBookings(AdminBookingSearch search, int offset, int size, AdminBookableProductOptions bookableProductOptions) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
getBookings
in interface AdminBookableProductMgrIf
search
- the searchoffset
- the offsetsize
- the sizebookableProductOptions
- the bookableProductOptionsorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)KKAdminException
- an unexpected exception in the KonaKart Admin engineprotected int getBookingCount(AdminBookingSearch search, AdminBookableProductOptions options) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
search
- the searchoptions
- the optionsorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)KKAdminException
- an unexpected exception in the KonaKart Admin engineprotected void setBookingCriteriaWithStandardAttributes(com.konakart.db.KKCriteria c)
c
- the cprotected int addBookingSearchCriteria(com.konakart.db.KKCriteria c, AdminBookingSearch search, AdminBookableProductOptions options)
c
- the csearch
- the searchoptions
- the optionsprotected void addBookingOrderBy(com.konakart.db.KKCriteria c, AdminBookingSearch search)
c
- the csearch
- the searchpublic void refreshConfigs() throws java.lang.Exception
refreshConfigs
in interface AdminBookableProductMgrIf
refreshConfigs
in class AdminBaseMgr
java.lang.Exception
- an unexpected exceptionpublic static int getBookingCountMaxRetries()
public static void setBookingCountMaxRetries(int bookingCountMaxRetries)
bookingCountMaxRetries
- the bookingCountMaxRetries to setCopyright © 2018 DS Data Systems UK Ltd.