Class CommonProcess

java.lang.Object
com.skava.subscription.factoryimpl.CommonProcess

@Component public class CommonProcess extends Object

The CommonProcess Class.

This class implements the interface CommonProcess

Since:
2019-07-22
Version:
8.4.0
Author:
Infosys Equinox
  • Field Details

    • commonComponents

      @Autowired public CommonComponents commonComponents
      common components - holds the infromation about the commoncomponents.
    • authTokenHandler

      @Autowired protected com.skava.core.auth.AuthTokenHandler authTokenHandler
      auth token handler - holds the infromation about the auth token.
    • VALIDATE_SUBSCRIPTION

      public static final String VALIDATE_SUBSCRIPTION
      VALIDATE_SUBSCRIPTION
      See Also:
    • IS_PREVIOUS_OR_SKIPPED

      public static final String IS_PREVIOUS_OR_SKIPPED
      IS_PREVIOUS_OR_SKIPPED
      See Also:
  • Constructor Details

    • CommonProcess

      public CommonProcess()
  • Method Details

    • validateCollection

      public CollectionDomain validateCollection(long collectionId)

      Validate Colection

      validateCollection validates the collection by it's id

      Parameters:
      collectionId - - holds the collection identifier
      Returns:
      returns the {CollectionDomain} if collection is valid
    • validateSubscription

      public SubscriptionDomain validateSubscription(long subscriptionId, long collectionId, String userId)

      ValidationSubscription

      validateSubscription validates the subscription by it's id

      Parameters:
      subscriptionId - - Holds the information about the identifier of the subscription.
      collectionId - - Holds the information about the collection.
      userId - - Holds the information about the user.
      Returns:
      SubscriptionDomain returns the {SubscriptionDomain} if subscription is validtion
    • validateUser

      public void validateUser(SubscriptionEntity subscriptionEntity, String userId, long collectionId)

      Validate User

      validateUser validates the user by its id

      Parameters:
      subscriptionEntity - The Subscription Entity
      userId - The User Identifier
      collectionId - The Collection Identifier
    • getCollectionPropertyValue

      public String getCollectionPropertyValue(long collectionId, String key)

      method getCollectionPropertyValue

      holds the infromation about the ggetCollectionPropertyValue

      Parameters:
      collectionId - The collection id.
      key - a string key to get collection property.
      Returns:
      String value of the collection property.
    • getCollectionPropertyMap

      public Map<String,CollectionPropertyEntity> getCollectionPropertyMap(CollectionDomain collectionDomain)

      method getCollectionPropertyMap

      used to get the informaton about the colelctionProperty

      Parameters:
      collectionDomain - Used to get the information about the CollectionDOmain.
      Returns:
      Map gives the output response in the form of Map.
    • isInstanceExists

      public boolean isInstanceExists(long instanceSeq, long subscriptionId)

      IsInstanceExist

      Validates the instance is exist or not.

      Parameters:
      instanceSeq - The instance sequence number.
      subscriptionId - The subscription-id of the instance.
      Returns:
      true while instance is exists, otherwise it will return false.
    • isSubscriptionIntervalExists

      public boolean isSubscriptionIntervalExists(long subscriptionId)

      method isSubscriptionIntervalExists

      used to validate whether SubscriptionIntervalExists

      Parameters:
      subscriptionId - Identifier of the subscription
      Returns:
      boolean value
    • validateEditFreeze

      public void validateEditFreeze(long collectionId, long subscriptionId)

      validateEditFreeze

      Validates edit freeze date of the subscription order, throws error if edit freeze date crossed.

      Parameters:
      collectionId - Identifier of the collection
      subscriptionId - Identifier of the subscription
    • validateSubscription

      public SubscriptionEntity validateSubscription(long subscriptionId, long collectionId)

      methodvalidateSubscription

      validateSubscription validates the subscription by it's id

      Parameters:
      subscriptionId - The subscription id to be validated.
      collectionId - The collection-id of the subscription.
      Returns:
      returns the SubscriptionEntity if subscription is valid.
    • isPreviousOrderSkipped

      public boolean isPreviousOrderSkipped(long collectionId, long subscriptionId, long id)

      isPreviousOrderSkipped

      Validates and gives true if previous instance is skipped, otherwise it will return false

      Parameters:
      collectionId - The collection-id of the subscription
      id - The identifier of the instance
      subscriptionId - the subscription-id of the instance
      Returns:
      boolean value
    • isPreviousOrderSkipped

      public boolean isPreviousOrderSkipped(long collectionId, long subscriptionId)

      isPreviousOrderSkipped

      Validates and gives true if previous instance is skipped, otherwise it will return false

      Parameters:
      collectionId - The collection-id of the subscription
      subscriptionId - the subscription-id of the instance
      Returns:
      boolean value
    • validateInstance

      public InstanceEntity validateInstance(long collectionId, long subscriptionId, long id)

      Validates instance

      ised to validation for the instance

      Parameters:
      collectionId - The collection-id of the subscription
      id - The identifier of the instance
      subscriptionId - the subscription-id of the instance
      Returns:
      InstanceEntity
    • validateSubscriptionInterval

      public SubscriptionIntervalEntity validateSubscriptionInterval(long subscriptionId, long collectionId, String userId)

      validateSubscriptionInterval

      used to validate the SubscriptionInterval

      Parameters:
      subscriptionId - the subscription-id of the instance
      collectionId - collection
      userId - user info
      Returns:
      InstanceEntity
    • reduceInterval

      public void reduceInterval(long collectionId, long subscriptionId, String userId, String authToken)

      method reduceInterval

      method used to reduce the inyerval

      Reduces the Subscription Interval

      Parameters:
      collectionId - The Collection Id
      subscriptionId - The Subscription Id
      userId - user id
      authToken - authToken