com.elasticpath.service.rules
Interface RuleElementService

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

public interface RuleElementService
extends EpPersistenceService

Provides rule element (eligibility, condition and action) related services.


Method Summary
 RuleElement add(RuleElement ruleElement)
          Adds the given ruleElement.
 RuleElement get(long ruleElementUid)
          Get the ruleElement with the given UID.
 RuleElement get(long ruleElementUid, java.lang.String ruleElementType)
          Get the ruleElement with the given UID if it is greater than 0; otherwise get new instance of the ruleElement of the given ruleElementType from the spring beanFactory (assuming bean id is the same as the ruleElementType).
 RuleElement load(long ruleElementUid)
          Load the ruleElement with the given UID.
 RuleElement load(long ruleElementUid, java.lang.String ruleElementType)
          Load the ruleElement with the given UID if it is greater than 0; otherwise get new instance of the ruleElement of the given ruleElementType from the spring beanFactory (assuming bean id is the same as the ruleElementType).
 void remove(RuleElement ruleElement)
          Delete the ruleElement.
 void update(RuleElement ruleElement)
          Updates the given ruleElementle.
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getObject, getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Method Detail

add

RuleElement add(RuleElement ruleElement)
                throws EpServiceException
Adds the given ruleElement.

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

get

RuleElement get(long ruleElementUid)
                throws EpServiceException
Get the ruleElement with the given UID. Return null if no matching record exists.

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

get

RuleElement get(long ruleElementUid,
                java.lang.String ruleElementType)
                throws EpServiceException
Get the ruleElement with the given UID if it is greater than 0; otherwise get new instance of the ruleElement of the given ruleElementType from the spring beanFactory (assuming bean id is the same as the ruleElementType). Return null if no matching record exists.

Parameters:
ruleElementUid - the ruleElement UID
ruleElementType - the ruleElement type
Returns:
the rule if it exists, otherwise null.
Throws:
EpServiceException - in case of errors.

load

RuleElement load(long ruleElementUid)
                 throws EpServiceException
Load the ruleElement with the given UID. Throw an unrecoverable exception if there is no matching database row.

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

load

RuleElement load(long ruleElementUid,
                 java.lang.String ruleElementType)
                 throws EpServiceException
Load the ruleElement with the given UID if it is greater than 0; otherwise get new instance of the ruleElement of the given ruleElementType from the spring beanFactory (assuming bean id is the same as the ruleElementType). Throw an unrecoverable exception if there is no matching database row.

Parameters:
ruleElementUid - the ruleElement UID
ruleElementType - the ruleElement type
Returns:
the rule if it exists, otherwise null.
Throws:
EpServiceException - in case of errors.

remove

void remove(RuleElement ruleElement)
            throws EpServiceException
Delete the ruleElement.

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

update

void update(RuleElement ruleElement)
            throws EpServiceException
Updates the given ruleElementle.

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