net.bryansaunders.jee6divelog.service.rest
Class UserAccountApi

java.lang.Object
  extended by net.bryansaunders.jee6divelog.service.rest.UserAccountApi

@RequestScoped
public class UserAccountApi
extends java.lang.Object

User Rest API.

Author:
Bryan Saunders

Constructor Summary
UserAccountApi()
           
 
Method Summary
 javax.ws.rs.core.Response deleteUser(java.lang.String userName)
          Deletes the User Specified by the Given Username.
 javax.ws.rs.core.Response findUser(UserAccount example)
          Gets the User Specified by the Given Criteria.
 javax.ws.rs.core.Response getAllUsers()
          Gets all Users.
 javax.ws.rs.core.Response getUser(java.lang.String userName)
          Gets the User Specified by the Given Username.
 javax.ws.rs.core.Response registerUser(UserAccount user)
          Registers a User.
 javax.ws.rs.core.Response updateUser(java.lang.String userName, UserAccount updatedUserAccount)
          Updates the User Specified by the Given Username.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserAccountApi

public UserAccountApi()
Method Detail

registerUser

public javax.ws.rs.core.Response registerUser(UserAccount user)
Registers a User.

Parameters:
user - User to Register
Returns:
Registered User

findUser

public javax.ws.rs.core.Response findUser(UserAccount example)
Gets the User Specified by the Given Criteria. If not Criteria Specified, All Results will be returned.

Parameters:
example - Criteria to search for
Returns:
Found users

getAllUsers

public javax.ws.rs.core.Response getAllUsers()
Gets all Users.

Returns:
List of Users

getUser

public javax.ws.rs.core.Response getUser(java.lang.String userName)
Gets the User Specified by the Given Username.

Parameters:
userName - Username to serach for
Returns:
Found user

updateUser

public javax.ws.rs.core.Response updateUser(java.lang.String userName,
                                            UserAccount updatedUserAccount)
Updates the User Specified by the Given Username.

Parameters:
userName - Username to update
updatedUserAccount - Updated User Account
Returns:
Updated user

deleteUser

public javax.ws.rs.core.Response deleteUser(java.lang.String userName)
Deletes the User Specified by the Given Username.

Parameters:
userName - Username to delete
Returns:
Delete status


Copyright © 2012 Bryan Saunders. All Rights Reserved.