com.elasticpath.service.customer.impl
Class CustomerSessionServiceImpl

java.lang.Object
  extended by com.elasticpath.service.impl.AbstractEpServiceImpl
      extended by com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl
          extended by com.elasticpath.service.customer.impl.CustomerSessionServiceImpl
All Implemented Interfaces:
CustomerSessionService, EpPersistenceService, EpService

public class CustomerSessionServiceImpl
extends AbstractEpPersistenceServiceImpl
implements CustomerSessionService

Service for retrieving and saving CustomerSessions.


Constructor Summary
CustomerSessionServiceImpl()
           
 
Method Summary
 CustomerSession add(CustomerSession customerSession)
          Adds the given customer session.
 void deleteByCustomer(long customerUid)
          Delete all customerSession associated with customer with the given id.
 CustomerSession findByGuid(java.lang.String guid)
          Find the customer session with the given guid.
 CustomerSession get(long customerSessionUid)
          Get the customerSession with the given UID.
 java.lang.Object getObject(long uid)
          Generic get method for all persistable domain models.
 CustomerSession load(long customerSessionUid)
          Load the customer session with the given UID.
 void update(CustomerSession customerSession)
          Updates the given customer session.
 void update(CustomerSession customerSession, Customer customer)
          Updates the given customer session.
 
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

CustomerSessionServiceImpl

public CustomerSessionServiceImpl()
Method Detail

add

public CustomerSession add(CustomerSession customerSession)
                    throws EpServiceException
Adds the given customer session.

Specified by:
add in interface CustomerSessionService
Parameters:
customerSession - the customer session to add
Returns:
the persisted instance of customeSession
Throws:
EpServiceException - - in case of any errors

deleteByCustomer

public void deleteByCustomer(long customerUid)
                      throws EpServiceException
Delete all customerSession associated with customer with the given id.

Specified by:
deleteByCustomer in interface CustomerSessionService
Parameters:
customerUid - uid of the customer
Throws:
EpServiceException - if any thing goes wrong.

findByGuid

public CustomerSession findByGuid(java.lang.String guid)
                           throws EpServiceException
Find the customer session with the given guid.

Specified by:
findByGuid in interface CustomerSessionService
Parameters:
guid - the customer session guid
Returns:
the customer session if guid address exists, otherwise null
Throws:
EpServiceException - - in case of any errors

get

public CustomerSession get(long customerSessionUid)
                    throws EpServiceException
Get the customerSession with the given UID. Return null if no matching record exists.

Specified by:
get in interface CustomerSessionService
Parameters:
customerSessionUid - the customerSession UID
Returns:
the customerSession if UID exists, otherwise null
Throws:
EpServiceException - - in case of any 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 CustomerSession load(long customerSessionUid)
                     throws EpServiceException
Load the customer session with the given UID.

Specified by:
load in interface CustomerSessionService
Parameters:
customerSessionUid - the customer session UID
Returns:
the customer session if exists, otherwise null
Throws:
EpServiceException - - in case of any errors

update

public void update(CustomerSession customerSession)
            throws EpServiceException
Updates the given customer session.

Specified by:
update in interface CustomerSessionService
Parameters:
customerSession - the customer session to update
Throws:
EpServiceException - - in case of any errors

update

public void update(CustomerSession customerSession,
                   Customer customer)
            throws EpServiceException
Updates the given customer session.

Specified by:
update in interface CustomerSessionService
Parameters:
customerSession - the customer session to update
customer - the valid customer to be used to update customer session instance
Throws:
EpServiceException - - in case of any errors