ccc.persistence
Interface UserRepository


public interface UserRepository

API for user repositories.

Author:
Civic Computing Ltd.

Method Summary
 long countUsers(UserCriteria uc)
          Total amount of the matching users.
 void create(UserEntity user)
          Create a new user.
 UserEntity find(java.util.UUID userId)
          Look up a user from their Id.
 java.util.List<java.lang.String> listMetadataValuesWithKey(java.lang.String key)
          Return list of unique values in user metadata with given key.
 java.util.Collection<UserEntity> listUsers(UserCriteria uc, java.lang.String sort, SortOrder order, int pageNo, int pageSize)
          List all users.
 UserEntity loggedInUser(java.security.Principal p)
          Look up a user from a JAAS principal.
 UserEntity userByLegacyId(java.lang.String legacyId)
          Look up a user using the legacy id.
 boolean usernameExists(java.lang.String username)
          Query whether a user exists with the specified username.
 

Method Detail

listUsers

java.util.Collection<UserEntity> listUsers(UserCriteria uc,
                                           java.lang.String sort,
                                           SortOrder order,
                                           int pageNo,
                                           int pageSize)
List all users.

Parameters:
uc - User criteria.
pageNo - The page to display.
pageSize - The number of results per page.
sort - The column to sort.
order - The sort order (ASC/DESC).
Returns:
List of users.

countUsers

long countUsers(UserCriteria uc)
Total amount of the matching users.

Parameters:
uc - User criteria.
Returns:
Number of users.

usernameExists

boolean usernameExists(java.lang.String username)
Query whether a user exists with the specified username.

Parameters:
username - The username.
Returns:
True if such a user exists, false otherwise.

find

UserEntity find(java.util.UUID userId)
Look up a user from their Id.

Parameters:
userId - The UUID for the user.
Returns:
The user corresponding to 'userId'.

loggedInUser

UserEntity loggedInUser(java.security.Principal p)
Look up a user from a JAAS principal.

Parameters:
p - The principal.
Returns:
The corresponding CCC user.

create

void create(UserEntity user)
Create a new user.

Parameters:
user - The new user to add.

userByLegacyId

UserEntity userByLegacyId(java.lang.String legacyId)
Look up a user using the legacy id.

Parameters:
legacyId - The legacy Id.
Returns:
The user corresponding to 'legacyId'.

listMetadataValuesWithKey

java.util.List<java.lang.String> listMetadataValuesWithKey(java.lang.String key)
Return list of unique values in user metadata with given key.

Parameters:
key - The key for the metadata values.
Returns:
The list of values.


Copyright © 2010. All Rights Reserved.