ccc.api.core
Interface Users

All Known Implementing Classes:
UsersEJB, UsersImpl

public interface Users

User Commands API, used to update user data in CCC.

Author:
Civic Computing Ltd.

Field Summary
static java.lang.String NAME
          NAME : String.
 
Method Summary
 User create(User delta)
          Create a new user in the system.
 java.util.Collection<java.lang.String> listUserMetadataValuesWithKey(java.lang.String key)
          Query metadata values with given key.
 PagedCollection<User> query(java.lang.String username, java.lang.String email, java.lang.String groups, java.lang.String metadataKey, java.lang.String metadataValue, java.lang.String sort, SortOrder order, int pageNo, int pageSize)
          Query users.
 User retrieve(java.util.UUID userId)
          Retrieve a user.
 User retrieveCurrent()
          Returns currently logged in user.
 void update(java.util.UUID userId, User delta)
          Updates the user in the system.
 void updateCurrent(User user)
          Update the email and/or password for the current user.
 void updateUserPassword(java.util.UUID userId, User user)
          Update the password for the specified user.
 User userByLegacyId(java.lang.String legacyId)
          Look up the user for a specified legacy id.
 java.lang.Boolean usernameExists(Username username)
          Query whether the specified username is in use.
 

Field Detail

NAME

static final java.lang.String NAME
NAME : String.

See Also:
Constant Field Values
Method Detail

retrieve

User retrieve(java.util.UUID userId)
Retrieve a user.

Parameters:
userId - The user's id.
Returns:
The corresponding delta.

retrieveCurrent

User retrieveCurrent()
Returns currently logged in user.

Returns:
UserDTO

query

PagedCollection<User> query(java.lang.String username,
                            java.lang.String email,
                            java.lang.String groups,
                            java.lang.String metadataKey,
                            java.lang.String metadataValue,
                            java.lang.String sort,
                            SortOrder order,
                            int pageNo,
                            int pageSize)
Query users.

Parameters:
username - The username criteria.
email - The email criteria.
groups - The groups criteria.
metadataKey - The metadata key criteria.
metadataValue - The metadata value criteria.
sort - The column to sort.
order - The sort order (ASC/DESC).
pageNo - The page to display.
pageSize - The number of results per page.
Returns:
Returns list of users.

usernameExists

java.lang.Boolean usernameExists(Username username)
Query whether the specified username is in use.

Parameters:
username - The username to check
Returns:
True if the username is in use, false otherwise.

create

User create(User delta)
Create a new user in the system.

Parameters:
delta - The new user details.
Returns:
A user summary describing the new user.

update

void update(java.util.UUID userId,
            User delta)
Updates the user in the system.

Parameters:
userId - The id of the user to update.
delta - The changes to apply.

updateUserPassword

void updateUserPassword(java.util.UUID userId,
                        User user)
Update the password for the specified user.

Parameters:
userId - The user's id.
user - New details for the user.

updateCurrent

void updateCurrent(User user)
Update the email and/or password for the current user.

Parameters:
user - New details for the user.

userByLegacyId

User userByLegacyId(java.lang.String legacyId)
Look up the user for a specified legacy id.

Parameters:
legacyId - The legacy id of the user.
Returns:
A summary of the corresponding user.

listUserMetadataValuesWithKey

java.util.Collection<java.lang.String> listUserMetadataValuesWithKey(java.lang.String key)
Query metadata values with given key.

Parameters:
key - The key as a string.
Returns:
Returns list of users.


Copyright © 2010. All Rights Reserved.