com.elasticpath.service.rules.impl
Class RuleActionServiceImpl

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

public class RuleActionServiceImpl
extends AbstractEpPersistenceServiceImpl
implements RuleActionService

Provides rule action component related services.


Constructor Summary
RuleActionServiceImpl()
           
 
Method Summary
 RuleAction add(RuleAction ruleAction)
          Adds the given ruleAction.
 RuleAction get(long ruleActionUid)
          Get the ruleAction with the given UID.
 RuleAction get(long ruleActionUid, java.lang.String ruleActionType)
          Get the ruleAction with the given UID if it is greater than 0; otherwise get new instance of the ruleAction of the given ruleActionType from the spring beanFactory (assuming bean id is the same as the ruleActionType).
 java.lang.Object getObject(long uid)
          Generic get method for all persistable domain models.
 RuleAction load(long ruleActionUid)
          Load the ruleAction with the given UID.
 RuleAction load(long ruleActionUid, java.lang.String ruleActionType)
          Load the ruleAction with the given UID if it is greater than 0; otherwise get new instance of the ruleAction of the given ruleActionType from the spring beanFactory (assuming bean id is the same as the ruleActionType).
 void remove(RuleAction ruleAction)
          Delete the ruleAction.
 void update(RuleAction ruleAction)
          Updates the given ruleActionle.
 
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

RuleActionServiceImpl

public RuleActionServiceImpl()
Method Detail

add

public RuleAction add(RuleAction ruleAction)
               throws EpServiceException
Adds the given ruleAction.

Specified by:
add in interface RuleActionService
Parameters:
ruleAction - the ruleAction to add
Returns:
the persisted instance of ruleAction
Throws:
EpServiceException - - in case of any errors

get

public RuleAction get(long ruleActionUid)
               throws EpServiceException
Get the ruleAction with the given UID. Return null if no matching record exists.

Specified by:
get in interface RuleActionService
Parameters:
ruleActionUid - the ruleAction UID
Returns:
the ruleAction if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

get

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

Specified by:
get in interface RuleActionService
Parameters:
ruleActionUid - the ruleAction UID
ruleActionType - the ruleAction 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 RuleAction load(long ruleActionUid)
                throws EpServiceException
Load the ruleAction with the given UID. Throw an unrecoverable exception if there is no matching database row.

Specified by:
load in interface RuleActionService
Parameters:
ruleActionUid - the ruleAction UID
Returns:
the rule if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

load

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

Specified by:
load in interface RuleActionService
Parameters:
ruleActionUid - the ruleAction UID
ruleActionType - the ruleAction type
Returns:
the rule if it exists, otherwise null.
Throws:
EpServiceException - in case of errors.

remove

public void remove(RuleAction ruleAction)
            throws EpServiceException
Delete the ruleAction.

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

update

public void update(RuleAction ruleAction)
            throws EpServiceException
Updates the given ruleActionle.

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