com.elasticpath.service.rules.impl
Class RuleConditionServiceImpl

java.lang.Object
  extended by com.elasticpath.service.impl.AbstractEpServiceImpl
      extended by com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl
          extended by com.elasticpath.service.rules.impl.RuleConditionServiceImpl
All Implemented Interfaces:
EpPersistenceService, EpService, RuleConditionService

public class RuleConditionServiceImpl
extends AbstractEpPersistenceServiceImpl
implements RuleConditionService

Provides rule condition component related services.


Constructor Summary
RuleConditionServiceImpl()
           
 
Method Summary
 RuleCondition add(RuleCondition ruleCondition)
          Adds the given ruleCondition.
 RuleCondition get(long ruleConditionUid)
          Get the ruleCondition with the given UID.
 RuleCondition get(long ruleConditionUid, java.lang.String ruleConditionType)
          Get the ruleCondition with the given UID if it is greater than 0; otherwise get new instance of the ruleCondition of the given ruleConditionType from the spring beanFactory (assuming bean id is the same as the ruleConditionType).
 java.lang.Object getObject(long uid)
          Generic get method for all persistable domain models.
 RuleCondition load(long ruleConditionUid)
          Load the ruleCondition with the given UID.
 RuleCondition load(long ruleConditionUid, java.lang.String ruleConditionType)
          Load the ruleCondition with the given UID if it is greater than 0; otherwise get new instance of the ruleCondition of the given ruleConditionType from the spring beanFactory (assuming bean id is the same as the ruleConditionType).
 void remove(RuleCondition ruleCondition)
          Delete the ruleCondition.
 void update(RuleCondition ruleCondition)
          Updates the given ruleConditionle.
 
Methods inherited from class com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl
getPersistenceEngine, setPersistenceEngine
 
Methods inherited from class com.elasticpath.service.impl.AbstractEpServiceImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Constructor Detail

RuleConditionServiceImpl

public RuleConditionServiceImpl()
Method Detail

add

public RuleCondition add(RuleCondition ruleCondition)
                  throws EpServiceException
Adds the given ruleCondition.

Specified by:
add in interface RuleConditionService
Parameters:
ruleCondition - the ruleCondition to add
Returns:
the persisted instance of ruleCondition.
Throws:
EpServiceException - - in case of any errors

get

public RuleCondition get(long ruleConditionUid)
                  throws EpServiceException
Get the ruleCondition with the given UID. Return null if no matching record exists.

Specified by:
get in interface RuleConditionService
Parameters:
ruleConditionUid - the ruleCondition UID
Returns:
the ruleCondition if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

get

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

Specified by:
get in interface RuleConditionService
Parameters:
ruleConditionUid - the ruleCondition UID
ruleConditionType - the ruleCondition type
Returns:
the rule if it exists, otherwise null.
Throws:
EpServiceException - in case of errors.

getObject

public java.lang.Object getObject(long uid)
                           throws EpServiceException
Generic get method for all persistable domain models.

Specified by:
getObject in interface EpPersistenceService
Parameters:
uid - the persisted instance uid
Returns:
the persisted instance if exists, otherwise null
Throws:
EpServiceException - - in case of any errors

load

public RuleCondition load(long ruleConditionUid)
                   throws EpServiceException
Load the ruleCondition with the given UID. Throw an unrecoverable exception if there is no matching database row.

Specified by:
load in interface RuleConditionService
Parameters:
ruleConditionUid - the ruleCondition UID
Returns:
the rule if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

load

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

Specified by:
load in interface RuleConditionService
Parameters:
ruleConditionUid - the ruleCondition UID
ruleConditionType - the ruleCondition type
Returns:
the rule if it exists, otherwise null.
Throws:
EpServiceException - in case of errors.

remove

public void remove(RuleCondition ruleCondition)
            throws EpServiceException
Delete the ruleCondition.

Specified by:
remove in interface RuleConditionService
Parameters:
ruleCondition - the ruleCondition to remove
Throws:
EpServiceException - - in case of any errors

update

public void update(RuleCondition ruleCondition)
            throws EpServiceException
Updates the given ruleConditionle.

Specified by:
update in interface RuleConditionService
Parameters:
ruleCondition - the ruleCondition to update
Throws:
EpServiceException - - in case of any errors