com.elasticpath.service.customer
Interface CustomerGroupService

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

public interface CustomerGroupService
extends EpPersistenceService

Provide customerGroup-related business service.


Method Summary
 CustomerGroup add(CustomerGroup customerGroup)
          Adds the given customerGroup.
 CustomerGroup findByGroupName(java.lang.String groupName)
          Find the customer group with the given group name.
 CustomerGroup get(long customerGroupUid)
          Get the customerGroup with the given UID.
 CustomerGroup getDefaultGroup()
          Return the default customerGroup, namely, the group with name "PUBLIC".
 boolean groupExists(CustomerGroup customerGroup)
          Check if a different customer group with the given customer group's name exists exists or not.
 boolean groupExists(java.lang.String groupName)
          Check the given customer group's name exists or not.
 java.util.List list()
          List all customerGroups stored in the database.
 CustomerGroup load(long customerGroupUid)
          Load the customerGroup with the given UID.
 void remove(CustomerGroup customerGroup)
          Delete the customerGroup.
 void update(CustomerGroup customerGroup)
          Updates the given customerGroup.
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getObject, getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Method Detail

add

CustomerGroup add(CustomerGroup customerGroup)
                  throws GroupExistException
Adds the given customerGroup.

Parameters:
customerGroup - the customerGroup to add
Returns:
the persisted instance of customerGroup
Throws:
GroupExistException - - if a customerGroup with the specified name already exists.

findByGroupName

CustomerGroup findByGroupName(java.lang.String groupName)
                              throws EpServiceException
Find the customer group with the given group name.

Parameters:
groupName - - the customer group name
Returns:
the customerGroup with the given name if exists, otherwise null
Throws:
EpServiceException - - in case of any errors

get

CustomerGroup get(long customerGroupUid)
                  throws EpServiceException
Get the customerGroup with the given UID. Return null if no matching record exists.

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

getDefaultGroup

CustomerGroup getDefaultGroup()
                              throws EpServiceException
Return the default customerGroup, namely, the group with name "PUBLIC".

Returns:
the default customerGroup.
Throws:
EpServiceException - - in case of any errors

groupExists

boolean groupExists(CustomerGroup customerGroup)
                    throws EpServiceException
Check if a different customer group with the given customer group's name exists exists or not.

Parameters:
customerGroup - - the customerGroup to check
Returns:
true if a different customer group with the same name exists
Throws:
EpServiceException - - in case of any errors

groupExists

boolean groupExists(java.lang.String groupName)
                    throws EpServiceException
Check the given customer group's name exists or not.

Parameters:
groupName - - the group name to check
Returns:
true if the given group name exists
Throws:
EpServiceException - - in case of any errors

list

java.util.List list()
                    throws EpServiceException
List all customerGroups stored in the database.

Returns:
a list of customerGroups
Throws:
EpServiceException - - in case of any errors

load

CustomerGroup load(long customerGroupUid)
                   throws EpServiceException
Load the customerGroup with the given UID. Throw an unrecoverable exception if there is no matching database row.

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

remove

void remove(CustomerGroup customerGroup)
            throws EpServiceException
Delete the customerGroup.

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

update

void update(CustomerGroup customerGroup)
            throws GroupExistException
Updates the given customerGroup.

Parameters:
customerGroup - the customerGroup to update
Throws:
GroupExistException - - if a customerGroup with the specified name already exists.