com.openexchange.admin.rmi.impl
Class OXUser

java.lang.Object
  extended by com.openexchange.admin.rmi.impl.OXCommonImpl
      extended by com.openexchange.admin.rmi.impl.OXUser
All Implemented Interfaces:
OXUserInterface, Remote

public class OXUser
extends OXCommonImpl
implements OXUserInterface

Author:
d7, cutmasta

Field Summary
 
Fields inherited from interface com.openexchange.admin.rmi.OXUserInterface
RMI_NAME
 
Constructor Summary
OXUser(BundleContext context)
           
 
Method Summary
 void change(Context ctx, User usrdata, Credentials auth)
          Manipulate user data within the given context.
 void changeModuleAccess(Context ctx, User user, String access_combination_name, Credentials auth)
          Manipulate user module access within the given context.
 void changeModuleAccess(Context ctx, User user, UserModuleAccess moduleAccess, Credentials auth)
          Manipulate user module access within the given context.
 User create(Context ctx, User usrdata, Credentials auth)
          Creates a new user within the given context.
Default context access rights are used!
 User create(Context ctx, User usrdata, String access_combination_name, Credentials auth)
          Creates a new user within the given context.
 User create(Context ctx, User usr, UserModuleAccess access, Credentials auth)
          Creates a new user within the given context.
 void delete(Context ctx, User[] users, Credentials auth)
          Delete user from given context.
 void delete(Context ctx, User user, Credentials auth)
          Delete user from given context.
 String getAccessCombinationName(Context ctx, User user, Credentials auth)
          Get current access combination name of an user!
 UserModuleAccess getContextAdminUserModuleAccess(Context ctx, Credentials auth)
          Returns the module access rights of the context-admin
 User[] getData(Context ctx, User[] users, Credentials auth)
          Retrieve user objects for a range of users by username or id.
 User getData(Context ctx, User user, Credentials auth)
          Retrieve user objects for a range of users by username or id.
 UserModuleAccess getModuleAccess(Context ctx, User user, Credentials auth)
          Retrieve the ModuleAccess for an user.
 boolean isContextAdmin(Context ctx, User user, Credentials auth)
           
 User[] list(Context ctx, String search_pattern, Credentials auth)
          Retrieve all users for a given context.
 User[] listAll(Context ctx, Credentials auth)
          Retrieve all users for a given context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OXUser

public OXUser(BundleContext context)
       throws StorageException
Throws:
StorageException
Method Detail

change

public void change(Context ctx,
                   User usrdata,
                   Credentials auth)
            throws StorageException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   InvalidDataException,
                   DatabaseUpdateException,
                   NoSuchUserException
Description copied from interface: OXUserInterface
Manipulate user data within the given context.

Specified by:
change in interface OXUserInterface
usrdata - User containing user data.
auth - Credentials for authenticating against server.
Throws:
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchUserException

changeModuleAccess

public void changeModuleAccess(Context ctx,
                               User user,
                               UserModuleAccess moduleAccess,
                               Credentials auth)
                        throws StorageException,
                               InvalidCredentialsException,
                               NoSuchContextException,
                               InvalidDataException,
                               DatabaseUpdateException,
                               NoSuchUserException
Description copied from interface: OXUserInterface
Manipulate user module access within the given context.

Specified by:
changeModuleAccess in interface OXUserInterface
Parameters:
ctx - Context object.
moduleAccess - UserModuleAccess containing module access.
auth - Credentials for authenticating against server.
Throws:
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchUserException

changeModuleAccess

public void changeModuleAccess(Context ctx,
                               User user,
                               String access_combination_name,
                               Credentials auth)
                        throws StorageException,
                               InvalidCredentialsException,
                               NoSuchContextException,
                               InvalidDataException,
                               DatabaseUpdateException,
                               NoSuchUserException
Description copied from interface: OXUserInterface
Manipulate user module access within the given context.

Specified by:
changeModuleAccess in interface OXUserInterface
Parameters:
ctx - Context object.
auth - Credentials for authenticating against server.
Throws:
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchUserException

create

public User create(Context ctx,
                   User usr,
                   UserModuleAccess access,
                   Credentials auth)
            throws StorageException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   InvalidDataException,
                   DatabaseUpdateException
Description copied from interface: OXUserInterface
Creates a new user within the given context.

Specified by:
create in interface OXUserInterface
usr - User containing user data.
access - UserModuleAccess containing module access for the user.
auth - Credentials for authenticating against server.
Returns:
int containing the id of the new user.
Throws:
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException

create

public User create(Context ctx,
                   User usrdata,
                   String access_combination_name,
                   Credentials auth)
            throws StorageException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   InvalidDataException,
                   DatabaseUpdateException
Description copied from interface: OXUserInterface
Creates a new user within the given context.

Specified by:
create in interface OXUserInterface
usrdata - User containing user data.
access_combination_name - Access combination name identifying the module rights for the new user.
auth - Credentials for authenticating against server.
Returns:
int containing the id of the new user.
Throws:
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException

create

public User create(Context ctx,
                   User usrdata,
                   Credentials auth)
            throws StorageException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   InvalidDataException,
                   DatabaseUpdateException
Description copied from interface: OXUserInterface
Creates a new user within the given context.
Default context access rights are used!

Specified by:
create in interface OXUserInterface
usrdata - User containing user data.
auth - Credentials for authenticating against server.
Returns:
int containing the id of the new user.
Throws:
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException

getContextAdminUserModuleAccess

public UserModuleAccess getContextAdminUserModuleAccess(Context ctx,
                                                        Credentials auth)
                                                 throws StorageException,
                                                        InvalidCredentialsException,
                                                        NoSuchContextException,
                                                        InvalidDataException,
                                                        DatabaseUpdateException
Description copied from interface: OXUserInterface
Returns the module access rights of the context-admin

Specified by:
getContextAdminUserModuleAccess in interface OXUserInterface
auth - Credentials for authenticating against server.
Returns:
int containing the id of the new user.
Throws:
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException

delete

public void delete(Context ctx,
                   User user,
                   Credentials auth)
            throws StorageException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   InvalidDataException,
                   DatabaseUpdateException,
                   NoSuchUserException
Description copied from interface: OXUserInterface
Delete user from given context.

Specified by:
delete in interface OXUserInterface
user - user object.
auth - Credentials for authenticating against server.
Throws:
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchUserException

delete

public void delete(Context ctx,
                   User[] users,
                   Credentials auth)
            throws StorageException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   InvalidDataException,
                   DatabaseUpdateException,
                   NoSuchUserException
Description copied from interface: OXUserInterface
Delete user from given context.

Specified by:
delete in interface OXUserInterface
users - user array containing user object.
auth - Credentials for authenticating against server.
Throws:
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchUserException

getData

public User getData(Context ctx,
                    User user,
                    Credentials auth)
             throws StorageException,
                    InvalidCredentialsException,
                    NoSuchContextException,
                    InvalidDataException,
                    NoSuchUserException,
                    DatabaseUpdateException
Description copied from interface: OXUserInterface
Retrieve user objects for a range of users by username or id.

Specified by:
getData in interface OXUserInterface
user - user object with user to get data for.
auth - Credentials for authenticating against server.
Returns:
User containing result object.
Throws:
StorageException - When an error in the subsystems occured.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
NoSuchUserException
DatabaseUpdateException
See Also:
User.getUsername().

getData

public User[] getData(Context ctx,
                      User[] users,
                      Credentials auth)
               throws StorageException,
                      InvalidCredentialsException,
                      NoSuchContextException,
                      InvalidDataException,
                      NoSuchUserException,
                      DatabaseUpdateException
Description copied from interface: OXUserInterface
Retrieve user objects for a range of users by username or id.

Specified by:
getData in interface OXUserInterface
users - User[] with users to get data for.
auth - Credentials for authenticating against server.
Returns:
User[] containing result objects.
Throws:
StorageException - When an error in the subsystems occured.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
NoSuchUserException
DatabaseUpdateException
See Also:
User.getUsername().

getModuleAccess

public UserModuleAccess getModuleAccess(Context ctx,
                                        User user,
                                        Credentials auth)
                                 throws StorageException,
                                        InvalidCredentialsException,
                                        NoSuchContextException,
                                        InvalidDataException,
                                        DatabaseUpdateException,
                                        NoSuchUserException
Description copied from interface: OXUserInterface
Retrieve the ModuleAccess for an user.

Specified by:
getModuleAccess in interface OXUserInterface
auth - Credentials for authenticating against server.
Returns:
UserModuleAccess containing the module access rights.
Throws:
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchUserException

getAccessCombinationName

public String getAccessCombinationName(Context ctx,
                                       User user,
                                       Credentials auth)
                                throws StorageException,
                                       InvalidCredentialsException,
                                       NoSuchContextException,
                                       InvalidDataException,
                                       DatabaseUpdateException,
                                       NoSuchUserException
Description copied from interface: OXUserInterface
Get current access combination name of an user!

Specified by:
getAccessCombinationName in interface OXUserInterface
Returns:
Access combination name or null if current access rights cannot be mapped to an access combination name.
Throws:
StorageException
InvalidCredentialsException
NoSuchContextException
InvalidDataException
DatabaseUpdateException
NoSuchUserException

isContextAdmin

public boolean isContextAdmin(Context ctx,
                              User user,
                              Credentials auth)
                       throws StorageException,
                              InvalidCredentialsException,
                              NoSuchContextException,
                              InvalidDataException,
                              NoSuchUserException,
                              DatabaseUpdateException
Throws:
StorageException
InvalidCredentialsException
NoSuchContextException
InvalidDataException
NoSuchUserException
DatabaseUpdateException

list

public User[] list(Context ctx,
                   String search_pattern,
                   Credentials auth)
            throws StorageException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   InvalidDataException,
                   DatabaseUpdateException
Description copied from interface: OXUserInterface
Retrieve all users for a given context.

Specified by:
list in interface OXUserInterface
Parameters:
ctx - Context object.
search_pattern - A pattern to search for
auth - Credentials for authenticating against server.
Returns:
User[] with currently ONLY id set in each User.
Throws:
StorageException
InvalidCredentialsException
NoSuchContextException
InvalidDataException
DatabaseUpdateException

listAll

public User[] listAll(Context ctx,
                      Credentials auth)
               throws StorageException,
                      InvalidCredentialsException,
                      NoSuchContextException,
                      InvalidDataException,
                      DatabaseUpdateException
Description copied from interface: OXUserInterface
Retrieve all users for a given context. The same as calling list with a search_pattern of "*"

Specified by:
listAll in interface OXUserInterface
Parameters:
ctx - Context object.
auth - Credentials for authenticating against server.
Returns:
User[] with currently ONLY id set in each User.
Throws:
StorageException
InvalidCredentialsException
NoSuchContextException
InvalidDataException
DatabaseUpdateException