public class SubscriptionComponentHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long | DAY_IN_MILLI_SECONDS
Constant to indicate the value of a day in milli seconds.
|
static long | HOUR_IN_MILLI_SECONDS
Constant to indicate the value of an hour in milli seconds.
|
Modifier and Type | Method and Description |
---|---|
static java.util.List | executeSelectStatement(java.lang.String query, java.util.Map parameters)
Executes a select query
|
static java.lang.String | findParentCatalogEntryID(java.lang.String catentryId)
This method is used to find the Catentry ID of the parent, given a child catentry ID
|
static CommandContext | getCommandContext()
This method returns the Command Context instance for this request.
|
static long | getDateDifferenceInDays(java.util.Date date1, java.util.Date date2)
Returns the difference between two dates in terms of days.
|
static long | getDateDifferenceInHours(java.util.Date date1, java.util.Date date2)
Returns the difference between two dates in terms of hours.
|
static JDBCQueryService | getJDBCQueryService()
Gets the JDBC query service instance.
|
static OrderType | getOrder(java.lang.String orderId)
This method retrieves the order using the order ID specified.
|
static ScheduleEvaluateCmd | getScheduleEvaluateCmd(java.lang.String scheduleType)
This method returns the schedule evaluate command based on the schedule type specified.
|
static java.lang.Integer | getStoreId()
This method returns the store ID from the business context.
|
static Subscription | getSubscriptionById(java.lang.Long subscriptionId)
This method returns the physical Subscription entity based on the subscriptionId specified.
|
static SubscriptionDetailsValidator | getSubscriptionDetailsValidator()
Gets the instance of the SubscriptionDetailsValidator which is used for perform validation of the various fields passed in the Subscription noun.
|
static java.lang.Long | getTemplateIDForSubscription(java.lang.Long catalogEntryID)
This method returns the template identifier corresponding to the input catalog entry identifier.
|
static java.lang.Long | getUserId()
This method returns the user ID from the context.
|
static boolean | isQtyUnitValid(java.lang.String qtyUnitId)
This method checks whether the given quantity unit is valid and exists in the database.
|
static boolean | isSubscriptionTypeCodeValid(java.lang.String subscriptionTypeCode)
This method checks if the given subscription type code is valid and exists in the data base.
|
static java.lang.Integer | updateSubscriptionState(java.lang.Long subscriptionId, java.lang.Integer state, boolean isTransient)
This method updates the state of the subscription as a separate transaction.
|
public static final long DAY_IN_MILLI_SECONDS
public static final long HOUR_IN_MILLI_SECONDS
public static java.lang.Integer getStoreId() throws SubscriptionApplicationException
public static java.lang.Long getUserId() throws SubscriptionApplicationException
public static CommandContext getCommandContext()
public static OrderType getOrder(java.lang.String orderId) throws SubscriptionApplicationException
public static long getDateDifferenceInDays(java.util.Date date1, java.util.Date date2)
public static long getDateDifferenceInHours(java.util.Date date1, java.util.Date date2)
public static boolean isSubscriptionTypeCodeValid(java.lang.String subscriptionTypeCode)
public static java.util.List executeSelectStatement(java.lang.String query, java.util.Map parameters) throws java.lang.Exception
public static JDBCQueryService getJDBCQueryService()
public static Subscription getSubscriptionById(java.lang.Long subscriptionId)
public static ScheduleEvaluateCmd getScheduleEvaluateCmd(java.lang.String scheduleType)
public static java.lang.Integer updateSubscriptionState(java.lang.Long subscriptionId, java.lang.Integer state, boolean isTransient)
public static java.lang.String findParentCatalogEntryID(java.lang.String catentryId)
public static boolean isQtyUnitValid(java.lang.String qtyUnitId)
public static SubscriptionDetailsValidator getSubscriptionDetailsValidator()
public static java.lang.Long getTemplateIDForSubscription(java.lang.Long catalogEntryID) throws DataMediatorException