com.elasticpath.service.rules.impl
Class RuleElementServiceImpl

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

public class RuleElementServiceImpl
extends AbstractEpPersistenceServiceImpl
implements RuleElementService

Provides rule condition component related services.


Constructor Summary
RuleElementServiceImpl()
           
 
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).
 java.lang.Object getObject(long uid)
          Generic get method for all persistable domain models.
 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 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

RuleElementServiceImpl

public RuleElementServiceImpl()
Method Detail

add

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

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

get

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

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

get

public 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.

Specified by:
get in interface RuleElementService
Parameters:
ruleElementUid - the ruleElement UID
ruleElementType - the ruleElement 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 RuleElement load(long ruleElementUid)
                 throws EpServiceException
Load the ruleElement with the given UID. Throw an unrecoverable exception if there is no matching database row.

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

load

public 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.

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

remove

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

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

update

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

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