com.elasticpath.service.rules
Interface RuleSetService

All Superinterfaces:
EpPersistenceService, EpService
All Known Implementing Classes:
RuleSetServiceImpl

public interface RuleSetService
extends EpPersistenceService

Provides rule engine-related services.


Method Summary
 RuleSet add(RuleSet ruleSet)
          Adds the given ruleSet.
 java.util.List findByModifiedDate(java.util.Date date)
          Retrieves list of RuleSets where the last modified date is later than the specified date.
 RuleSet findByScenarioId(int scenarioId)
          Find the rule set by its scenario id.
 RuleSet get(long ruleSetUid)
          Get the ruleSet with the given UID.
 java.util.List list()
          List all ruleSets stored in the database.
 RuleSet load(long ruleSetUid)
          Load the ruleSet with the given UID.
 void remove(RuleSet ruleSet)
          Delete the ruleSet.
 void update(RuleSet ruleSet)
          Updates the given ruleset.
 void updateLastModifiedTime(RuleSet ruleSet)
          Update the ruleSet's last modified timestamp.
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getObject, getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Method Detail

add

RuleSet add(RuleSet ruleSet)
            throws EpServiceException
Adds the given ruleSet.

Parameters:
ruleSet - the ruleSet to add
Returns:
the persisted instance of ruleSet
Throws:
EpServiceException - - in case of any errors

findByModifiedDate

java.util.List findByModifiedDate(java.util.Date date)
Retrieves list of RuleSets where the last modified date is later than the specified date.

Parameters:
date - date to compare with the last modified date
Returns:
list of RuleSet whose last modified date is later than the specified date

findByScenarioId

RuleSet findByScenarioId(int scenarioId)
                         throws EpServiceException
Find the rule set by its scenario id.

Parameters:
scenarioId - the id of the scenario (see Scenarios interface)
Returns:
the Rule Set if it exists, otherwise null
Throws:
EpServiceException - - in case of any errors

get

RuleSet get(long ruleSetUid)
            throws EpServiceException
Get the ruleSet with the given UID. Return null if no matching record exists.

Parameters:
ruleSetUid - the rule UID
Returns:
the ruleSet if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

list

java.util.List list()
                    throws EpServiceException
List all ruleSets stored in the database.

Returns:
a list of ruleSets
Throws:
EpServiceException - - in case of any errors

load

RuleSet load(long ruleSetUid)
             throws EpServiceException
Load the ruleSet with the given UID. Throw an unrecoverable exception if there is no matching database row.

Parameters:
ruleSetUid - the ruleSet UID
Returns:
the ruleSet if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

remove

void remove(RuleSet ruleSet)
            throws EpServiceException
Delete the ruleSet.

Parameters:
ruleSet - the ruleSet to remove
Throws:
EpServiceException - - in case of any errors

update

void update(RuleSet ruleSet)
            throws EpServiceException
Updates the given ruleset.

Parameters:
ruleSet - the ruleSet to update
Throws:
EpServiceException - - in case of any errors

updateLastModifiedTime

void updateLastModifiedTime(RuleSet ruleSet)
Update the ruleSet's last modified timestamp.

Parameters:
ruleSet - the ruleSet whose timestamp is to be updated.