com.elasticpath.service.cmuser
Interface CmUserService

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

public interface CmUserService
extends EpPersistenceService

Provide cmuser-related business service.


Method Summary
 CmUser add(CmUser cmUser)
          Adds the given cmUser.
 boolean emailExists(CmUser cmUser)
          Check the given cmUser's email exists or not.
 boolean emailExists(java.lang.String email)
          Check the given email exists or not.
 CmUser findByEmail(java.lang.String email)
          Find the cmUser with the given email address.
 CmUser get(long cmUserUid)
          Get the cmUser with the given UID.
 java.util.List list()
          List all cmUsers stored in the database.
 CmUser load(long cmUserUid)
          Load the cmUser with the given UID.
 void remove(CmUser cmUser)
          Delete the cmUser.
 void resetPassword(java.lang.String email)
          Generate a new password for the customor with the given email address and send the new password to the cmUser by eamil.
 void update(CmUser cmUser)
          Updates the given cmUser.
 boolean userNameExists(CmUser cmUser)
          Check the given cmUser's userName exists or not.
 boolean userNameExists(java.lang.String userName)
          Checks the given userName exists or not.
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getObject, getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Method Detail

add

CmUser add(CmUser cmUser)
           throws UserNameExistException,
                  EmailExistException
Adds the given cmUser.

Parameters:
cmUser - the cmUser to add
Returns:
the persisted instance of cmUser
Throws:
UserNameExistException - - the specified user name is taken by another user.
EmailExistException - - the specified email is taken by another user.

emailExists

boolean emailExists(CmUser cmUser)
                    throws EpServiceException
Check the given cmUser's email exists or not.

Parameters:
cmUser - the cmUser to check
Returns:
true if the given email exists
Throws:
EpServiceException - - in case of any errors

emailExists

boolean emailExists(java.lang.String email)
                    throws EpServiceException
Check the given email exists or not.

Parameters:
email - the email address
Returns:
true if the given email exists
Throws:
EpServiceException - - in case of any errors

findByEmail

CmUser findByEmail(java.lang.String email)
                   throws EpServiceException
Find the cmUser with the given email address.

Parameters:
email - the cmUser email address
Returns:
the cmUser if email address exists, otherwise null
Throws:
EpServiceException - - in case of any errors

get

CmUser get(long cmUserUid)
           throws EpServiceException
Get the cmUser with the given UID. Return null if no matching record exists.

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

list

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

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

load

CmUser load(long cmUserUid)
            throws EpServiceException
Load the cmUser with the given UID. Throw an unrecoverable exception if there is no matching database row.

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

remove

void remove(CmUser cmUser)
            throws EpServiceException
Delete the cmUser.

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

resetPassword

void resetPassword(java.lang.String email)
                   throws EmailNonExistException
Generate a new password for the customor with the given email address and send the new password to the cmUser by eamil.

Parameters:
email - the email address
Throws:
EmailNonExistException - if the given email address doesn't exist

update

void update(CmUser cmUser)
            throws UserNameExistException,
                   EmailExistException
Updates the given cmUser.

Parameters:
cmUser - the cmUser to update
Throws:
UserNameExistException - - the specified user name is taken by another user.
EmailExistException - - the specified email is taken by another user.

userNameExists

boolean userNameExists(CmUser cmUser)
                       throws EpServiceException
Check the given cmUser's userName exists or not.

Parameters:
cmUser - the cmUser to check
Returns:
true if the given userName exists
Throws:
EpServiceException - - in case of any errors

userNameExists

boolean userNameExists(java.lang.String userName)
                       throws EpServiceException
Checks the given userName exists or not.

Parameters:
userName - the userName
Returns:
true if the given userName exists
Throws:
EpServiceException - - in case of any errors