Clearspace API (2.0.15) Web Services Client Javadocs

com.jivesoftware.community.webservices
Interface UserService


public interface UserService

Provides a webservice for managing user's, avatar's, and status levels.

For soap services this service can be accessed at /rpc/soap/UserService For rest services this service can be accessed at /rpc/rest/users


Method Summary
 WSUser createUser(java.lang.String username, java.lang.String password, java.lang.String email)
          Create a new user.
 WSUser createUserWithUser(WSUser user)
          Create a new user.
 void deleteUserProperty(java.lang.String name, long userID)
          Delete an extended property from a user.
 void disableUser(long userID)
          Used to disable a user.
 void enableUser(long userID)
          Used to enable a user.
 WSUser getUser(long userID)
          Returns a user by its id.
 WSUser getUserByEmailAddress(java.lang.String emailAddress)
          Returns a user object corresponding to the email address given.
 WSUser getUserByUsername(java.lang.String username)
          Returns a user by its username.
 int getUserCount()
          Returns the number of users in the system.
 java.util.List<java.lang.String> getUserNames()
          Returns the names of the all users names.
 java.util.List<WSProperty> getUserProperties(long userID)
          Return all extended properties for the user with the specified id.
 java.util.List<WSUser> getUsers()
          Returns the IDs of the first 1000 users.
 java.util.List<WSUser> getUsersBounded(int startIndex, int numResults)
          Returns the IDs of users begining at startIndex and until the number results equals numResults.
 boolean isReadOnly()
          Returns true if this UserService is read-only.
 void setPassword(long userID, java.lang.String password)
          Used to change a user's password.
 void setUserProperty(java.lang.String name, java.lang.String value, long userID)
          Set an extended property for a user.
 void updateUser(WSUser user)
          Used to update user information in the system.
 

Method Detail

getUser

WSUser getUser(long userID)
               throws UserNotFoundException
Returns a user by its id.

Parameters:
userID - The id of the user.
Returns:
The user with the matching id.
Throws:
UserNotFoundException - If the specified user does not exist.

getUserByUsername

WSUser getUserByUsername(java.lang.String username)
                         throws UserNotFoundException
Returns a user by its username.

Parameters:
username - The username of the user.
Returns:
The user maching the username.
Throws:
UserNotFoundException - If the specified user does not exist.

updateUser

void updateUser(WSUser user)
                throws UserNotFoundException,
                       UserAlreadyExistsException
Used to update user information in the system.

Parameters:
user - User information to update.
Throws:
UserNotFoundException - If the specified user does not exist.
com.jivesoftware.base.UserAlreadyExistsException - Thrown if trying to change user information to a user who already exists.
UserAlreadyExistsException

createUser

WSUser createUser(java.lang.String username,
                  java.lang.String password,
                  java.lang.String email)
                  throws UserAlreadyExistsException
Create a new user.

Parameters:
username - The name of user.
password - The password for the user.
email - The email address of the user.
Returns:
The newly created user.
Throws:
com.jivesoftware.base.UserAlreadyExistsException - If the use with this name already exists.
UserAlreadyExistsException

createUserWithUser

WSUser createUserWithUser(WSUser user)
                          throws UserAlreadyExistsException
Create a new user. The id field is ignored, after creation the user object returned will have the correct user id.

Parameters:
user - The user to create.
Returns:
The newly created user. The id will be the correct user id.
Throws:
UserAlreadyExistsException - If the use with this name already exists.

getUserProperties

java.util.List<WSProperty> getUserProperties(long userID)
                                             throws UserNotFoundException
Return all extended properties for the user with the specified id.

Parameters:
userID - The user's id.
Returns:
All the user's extended properties.
Throws:
UserNotFoundException - If the specified user does not exist.

setUserProperty

void setUserProperty(java.lang.String name,
                     java.lang.String value,
                     long userID)
                     throws UserNotFoundException
Set an extended property for a user.

Parameters:
name - The name of the extended property.
value - The value of the extended property.
userID - The user to set an extended property for.
Throws:
UserNotFoundException - If the specified user does not exist.

deleteUserProperty

void deleteUserProperty(java.lang.String name,
                        long userID)
                        throws UserNotFoundException
Delete an extended property from a user.

Parameters:
name - Name of the extended property to delete.
userID - The id of the user to delete the extended property from.
Throws:
UserNotFoundException - If the specified user does not exist.

getUserCount

int getUserCount()
Returns the number of users in the system.

Returns:
The number of users in the system.

getUsersBounded

java.util.List<WSUser> getUsersBounded(int startIndex,
                                       int numResults)
Returns the IDs of users begining at startIndex and until the number results equals numResults.

Parameters:
startIndex - The startIndex to grab results from.
numResults - The total number of results to be returned.
Returns:
An array of User IDs.

getUsers

java.util.List<WSUser> getUsers()
Returns the IDs of the first 1000 users.

Returns:
An array of user IDs.

getUserNames

java.util.List<java.lang.String> getUserNames()
Returns the names of the all users names.

Returns:
An array of user names.

getUserByEmailAddress

WSUser getUserByEmailAddress(java.lang.String emailAddress)
                             throws UserNotFoundException
Returns a user object corresponding to the email address given.

Parameters:
emailAddress - The email address of the user.
Returns:
The User with the matching email address.
Throws:
UserNotFoundException - If the specified user does not exist.

isReadOnly

boolean isReadOnly()
Returns true if this UserService is read-only. When read-only, users can not be created, deleted, or modified.

Returns:
true if the user provider is read-only.

enableUser

void enableUser(long userID)
                throws UserNotFoundException
Used to enable a user.

Parameters:
userID - The id of the user to enable.
Throws:
UserNotFoundException - Thrown if the specified user does not exist.

disableUser

void disableUser(long userID)
                 throws UserNotFoundException
Used to disable a user.

Parameters:
userID - The id of the user to disable.
Throws:
UserNotFoundException - Thrown if the specified user does not exist.

setPassword

void setPassword(long userID,
                 java.lang.String password)
                 throws UserNotFoundException,
                        UserAlreadyExistsException
Used to change a user's password.

Parameters:
userID - The id of the user to change the password for.
password - The new password in plain text.
Throws:
UserNotFoundException
UserAlreadyExistsException

Clearspace Project Page

Copyright © 1999-2007 Jive Software.