it.eng.rdlab.soa3.um.rest.jaxrs
Class UserManager

java.lang.Object
  extended by it.eng.rdlab.soa3.um.rest.jaxrs.UserManager

public class UserManager
extends Object

This class is a RESTful WS that manages operations on users

Version:
1.0
Author:
Ermanno Travaglino

Constructor Summary
UserManager()
           
 
Method Summary
 javax.ws.rs.core.Response assignDismissGroup(GroupJaxbBean groupBean, String userName, com.sun.jersey.api.core.HttpContext context)
          Assigns/dismisses group to an user by groupBean and userName
 javax.ws.rs.core.Response assignDismissRole(RoleJaxbBean roleBean, String userName, String organizationName, com.sun.jersey.api.core.HttpContext context)
          Assigns/dismisses role to an user by roleName and userName (and optionally by organizationName)
 javax.ws.rs.core.Response changePassword(String userName, CredentialsJaxbBean credsBean, String organizationName, com.sun.jersey.api.core.HttpContext context)
          Updates user's credentials
 javax.ws.rs.core.Response createUser(UserJaxbBean userJaxbBean, com.sun.jersey.api.core.HttpContext context)
          Creates user by UserJaxbBean
 javax.ws.rs.core.Response deleteAllUsers(com.sun.jersey.api.core.HttpContext context)
          Deletes all users
 javax.ws.rs.core.Response deleteAllUsers(String organizationName, com.sun.jersey.api.core.HttpContext context)
          Deletes all users by organizationName
 javax.ws.rs.core.Response deleteUser(String username, String organizationName, com.sun.jersey.api.core.HttpContext context)
          Deletes user by userName (and optionally by organizationName)
 javax.ws.rs.core.Response getUser(String username, String organizationName, com.sun.jersey.api.core.HttpContext context)
          Gets user by userName and organizationName
 String getUsers(com.sun.jersey.api.core.HttpContext context)
          Gets all users
 String getUsers(String organizationName, com.sun.jersey.api.core.HttpContext context)
          Gets users by organizationName
 String getUsersWithGroup(String groupName, com.sun.jersey.api.core.HttpContext context)
          Gets all users with a specific group
 String getUsersWithGroup(String groupName, String organizationName, com.sun.jersey.api.core.HttpContext context)
          Gets users with a specific group under an organization
 String getUsersWithRole(String roleName, com.sun.jersey.api.core.HttpContext context)
          Gets all users with a specific role
 String getUsersWithRole(String roleName, String organizationName, com.sun.jersey.api.core.HttpContext context)
          Gets users with a specific role under an organization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserManager

public UserManager()
            throws Exception
Throws:
Exception
Method Detail

createUser

public javax.ws.rs.core.Response createUser(UserJaxbBean userJaxbBean,
                                            @Context
                                            com.sun.jersey.api.core.HttpContext context)
Creates user by UserJaxbBean

Parameters:
userJaxbBean - UserJaxbBean
Returns:
user creation process response
Throws:
javax.ws.rs.WebApplicationException

changePassword

public javax.ws.rs.core.Response changePassword(String userName,
                                                CredentialsJaxbBean credsBean,
                                                String organizationName,
                                                @Context
                                                com.sun.jersey.api.core.HttpContext context)
Updates user's credentials

Parameters:
userName - String
credsBean - CredentialsJaxbBean
organizationName - String (optional)
Returns:
user credentials updating process response
Throws:
javax.ws.rs.WebApplicationException

getUser

public javax.ws.rs.core.Response getUser(String username,
                                         String organizationName,
                                         @Context
                                         com.sun.jersey.api.core.HttpContext context)
Gets user by userName and organizationName

Parameters:
userName - String
organizationName - String (optional)
Returns:
the user string object
Throws:
WebApplicationException,JsonGenerationException,UMJSONParserException,IOException

getUsers

public String getUsers(String organizationName,
                       @Context
                       com.sun.jersey.api.core.HttpContext context)
Gets users by organizationName

Parameters:
organizationName - String
Returns:
the users string object
Throws:
WebApplicationException,JsonGenerationException,UMJSONParserException,IOException

getUsers

public String getUsers(@Context
                       com.sun.jersey.api.core.HttpContext context)
Gets all users

Returns:
the users string object
Throws:
WebApplicationException,JsonGenerationException,UMJSONParserException,IOException

deleteUser

public javax.ws.rs.core.Response deleteUser(String username,
                                            String organizationName,
                                            @Context
                                            com.sun.jersey.api.core.HttpContext context)
Deletes user by userName (and optionally by organizationName)

Parameters:
userName - String
organizationName - String (optional)
Returns:
user deletion process response

deleteAllUsers

public javax.ws.rs.core.Response deleteAllUsers(String organizationName,
                                                @Context
                                                com.sun.jersey.api.core.HttpContext context)
Deletes all users by organizationName

Parameters:
organizationName - String
Returns:
users deletion process response

deleteAllUsers

public javax.ws.rs.core.Response deleteAllUsers(@Context
                                                com.sun.jersey.api.core.HttpContext context)
Deletes all users

Returns:
users deletion process response

assignDismissRole

public javax.ws.rs.core.Response assignDismissRole(RoleJaxbBean roleBean,
                                                   String userName,
                                                   String organizationName,
                                                   @Context
                                                   com.sun.jersey.api.core.HttpContext context)
Assigns/dismisses role to an user by roleName and userName (and optionally by organizationName)

Parameters:
roleBean - RoleJaxbBean
userName - String
organizationName - String (optional)
Returns:
users assignment/dismissal role process response

assignDismissGroup

public javax.ws.rs.core.Response assignDismissGroup(GroupJaxbBean groupBean,
                                                    String userName,
                                                    @Context
                                                    com.sun.jersey.api.core.HttpContext context)
Assigns/dismisses group to an user by groupBean and userName

Parameters:
groupBean - GroupJaxbBean
userName - String
Returns:
users assignment/dismissal group process response

getUsersWithRole

public String getUsersWithRole(String roleName,
                               String organizationName,
                               @Context
                               com.sun.jersey.api.core.HttpContext context)
Gets users with a specific role under an organization

Parameters:
roleName - String
organizationName - String
Returns:
the users string object
Throws:
WebApplicationException,JsonGenerationException,UMJSONParserException,IOException

getUsersWithRole

public String getUsersWithRole(String roleName,
                               @Context
                               com.sun.jersey.api.core.HttpContext context)
Gets all users with a specific role

Parameters:
roleName - String
Returns:
the users string object
Throws:
WebApplicationException,JsonGenerationException,UMJSONParserException,IOException

getUsersWithGroup

public String getUsersWithGroup(String groupName,
                                String organizationName,
                                @Context
                                com.sun.jersey.api.core.HttpContext context)
Gets users with a specific group under an organization

Parameters:
groupName - String
organizationName - String
Returns:
the users string object
Throws:
WebApplicationException,JsonGenerationException,UMJSONParserException,IOException

getUsersWithGroup

public String getUsersWithGroup(String groupName,
                                @Context
                                com.sun.jersey.api.core.HttpContext context)
Gets all users with a specific group

Parameters:
groupName - String
Returns:
the users string object
Throws:
WebApplicationException,JsonGenerationException,UMJSONParserException,IOException


Copyright © 2013. All Rights Reserved.