com.mycompany.service
Interface UserService

All Known Implementing Classes:
UserServiceImpl

public interface UserService

Interface for user service.

Author:
Ian Hlavats (ian@tarantulaconsulting.com)

Method Summary
 UserRelationship findRelationshipToUser(User user1, User user2)
          Finds a UserRelationship object representing a relationship between two User objects.
 User findUser(java.lang.String username, java.lang.String password)
          Finds a User with the given username and password.
 User findUserById(java.lang.Integer id)
          Finds a User by ID.
 User findUserByUsername(java.lang.String username)
          Finds a User by username.
 java.util.List<User> findUsers()
          Finds a List of all User objects.
 java.util.List<User> findUsersByName(java.lang.String suggest)
          Finds a List of User objects that have a first name or last name that partially matches the suggestion string.
 java.util.List<User> findUsersByType(RelationshipType type, User user)
          Finds a List of User objects that are related to the User according to the specified RelationshipType.
 UserRelationship saveRelationship(UserRelationship relationship)
          Saves a UserRelationship object.
 User saveUser(User user)
          Saves a User object.
 

Method Detail

findRelationshipToUser

UserRelationship findRelationshipToUser(User user1,
                                        User user2)
Finds a UserRelationship object representing a relationship between two User objects.

Parameters:
user1 - The first user.
user2 - The second user.
Returns:
A UserRelationship object.

findUser

User findUser(java.lang.String username,
              java.lang.String password)
Finds a User with the given username and password. Used for authentication.

Parameters:
username - The username.
password - The password.
Returns:
A User object if found.

findUserById

User findUserById(java.lang.Integer id)
Finds a User by ID.

Parameters:
id - The user's ID.
Returns:
A User object.

findUserByUsername

User findUserByUsername(java.lang.String username)
Finds a User by username.

Parameters:
username - The username.
Returns:
A User object.

findUsers

java.util.List<User> findUsers()
Finds a List of all User objects.

Returns:
A List of User objects.

findUsersByName

java.util.List<User> findUsersByName(java.lang.String suggest)
Finds a List of User objects that have a first name or last name that partially matches the suggestion string.

Parameters:
suggest - The partial string.
Returns:
A List of User objects.

findUsersByType

java.util.List<User> findUsersByType(RelationshipType type,
                                     User user)
Finds a List of User objects that are related to the User according to the specified RelationshipType.

Parameters:
type - The RelationshipType object.
user - The User object.
Returns:
A List of User objects.

saveRelationship

UserRelationship saveRelationship(UserRelationship relationship)
Saves a UserRelationship object.

Parameters:
relationship - The UserRelationship to save.
Returns:
The saved object.

saveUser

User saveUser(User user)
Saves a User object.

Parameters:
user - The user to save.
Returns:
The saved object.