com.openexchange.admin.storage.mysqlStorage
Class OXUserMySQLStorage

java.lang.Object
  extended by com.openexchange.admin.storage.interfaces.OXUserStorageInterface
      extended by com.openexchange.admin.storage.sqlStorage.OXUserSQLStorage
          extended by com.openexchange.admin.storage.mysqlStorage.OXUserMySQLStorage
All Implemented Interfaces:
OXMySQLDefaultValues

public class OXUserMySQLStorage
extends OXUserSQLStorage
implements OXMySQLDefaultValues

Author:
cutmasta, d7

Field Summary
 
Fields inherited from interface com.openexchange.admin.storage.mysqlStorage.OXMySQLDefaultValues
NOBODY, NOGROUP
 
Constructor Summary
OXUserMySQLStorage()
           
 
Method Summary
 void change(Context ctx, User usrdata)
          Manipulate user data within the given context.
 void changeLastModified(int user_id, Context ctx, Connection write_ox_con)
          Changes last modified data in database
 void changeModuleAccess(Context ctx, int[] userIds, UserModuleAccess moduleAccess)
          Manipulate users module access within the given context.
 void changeModuleAccess(Context ctx, int userId, UserModuleAccess moduleAccess)
          Manipulate user module access within the given context.
 int create(Context ctx, User usrdata, UserModuleAccess moduleAccess)
          Create new user in context ctx
 int create(Context ctx, User usrdata, UserModuleAccess moduleAccess, Connection con, int userId, int contactId, int uid_number)
          Create new user in given connection with given contact and user id If the uid number feature is active then also supply a correct uid_number(IDGenerator with Type UID_NUMBER).Else set this to -1
 void createRecoveryData(Context ctx, int user_id, Connection write_ox_con)
          Fetch all data from current user and add it to "del_user"
 void delete(Context ctx, User user)
          Delete one user in given context
 void delete(Context ctx, User[] users)
          Delete users in given context
 void delete(Context ctx, User[] users, Connection write_ox_con)
          Delete an user or multiple from given context in given connection
 void deleteAllRecoveryData(Context ctx, Connection con)
          Delete from "del_user" for given context
 void deleteRecoveryData(Context ctx, int user_id, Connection con)
          Delete from "del_user" for given context and user
 int[] getAll(Context ctx)
          Retrieve all user ids for a given context.
static boolean getboolfromint(int number)
           
 User[] getData(Context ctx, User[] users)
          Retrieve user objects for a range of users identified by User.getUsername().
static int getintfrombool(boolean bool)
           
 UserModuleAccess getModuleAccess(Context ctx, int user_id)
          Retrieve the ModuleAccess for an user.
 User[] list(Context ctx, String search_pattern)
          Retrieve all user objects for a given context.
 
Methods inherited from class com.openexchange.admin.storage.interfaces.OXUserStorageInterface
getInstance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OXUserMySQLStorage

public OXUserMySQLStorage()
Method Detail

change

public void change(Context ctx,
                   User usrdata)
            throws StorageException
Description copied from class: OXUserStorageInterface
Manipulate user data within the given context.

Specified by:
change in class OXUserStorageInterface
usrdata - User containing user data.
Throws:
StorageException

create

public int create(Context ctx,
                  User usrdata,
                  UserModuleAccess moduleAccess,
                  Connection con,
                  int userId,
                  int contactId,
                  int uid_number)
           throws StorageException
Description copied from class: OXUserStorageInterface
Create new user in given connection with given contact and user id If the uid number feature is active then also supply a correct uid_number(IDGenerator with Type UID_NUMBER).Else set this to -1

Specified by:
create in class OXUserStorageInterface
Throws:
StorageException

create

public int create(Context ctx,
                  User usrdata,
                  UserModuleAccess moduleAccess)
           throws StorageException
Description copied from class: OXUserStorageInterface
Create new user in context ctx

Specified by:
create in class OXUserStorageInterface
Throws:
StorageException

getAll

public int[] getAll(Context ctx)
             throws StorageException
Description copied from class: OXUserStorageInterface
Retrieve all user ids for a given context.

Specified by:
getAll in class OXUserStorageInterface
Parameters:
ctx - numerical context identifier
Returns:
int[] containing user ids.
Throws:
StorageException

list

public User[] list(Context ctx,
                   String search_pattern)
            throws StorageException
Description copied from class: OXUserStorageInterface
Retrieve all user objects for a given context. Which match the given search_pattern

Specified by:
list in class OXUserStorageInterface
Parameters:
ctx - numerical context identifier
Returns:
User[] containing user ids.
Throws:
StorageException

getData

public User[] getData(Context ctx,
                      User[] users)
               throws StorageException
Description copied from class: OXUserStorageInterface
Retrieve user objects for a range of users identified by User.getUsername().

Specified by:
getData in class OXUserStorageInterface
users - User[] with users to get data for. Attention: These objects will be cloned by a shallow copy, so non native attributes will point to the same reference after this method
Returns:
User[] containing result objects.
Throws:
StorageException

delete

public void delete(Context ctx,
                   User[] users,
                   Connection write_ox_con)
            throws StorageException
Description copied from class: OXUserStorageInterface
Delete an user or multiple from given context in given connection

Specified by:
delete in class OXUserStorageInterface
Throws:
StorageException

delete

public void delete(Context ctx,
                   User[] users)
            throws StorageException
Description copied from class: OXUserStorageInterface
Delete users in given context

Specified by:
delete in class OXUserStorageInterface
Throws:
StorageException

delete

public void delete(Context ctx,
                   User user)
            throws StorageException
Description copied from class: OXUserStorageInterface
Delete one user in given context

Specified by:
delete in class OXUserStorageInterface
Throws:
StorageException

changeModuleAccess

public void changeModuleAccess(Context ctx,
                               int[] userIds,
                               UserModuleAccess moduleAccess)
                        throws StorageException
Description copied from class: OXUserStorageInterface
Manipulate users module access within the given context.

Specified by:
changeModuleAccess in class OXUserStorageInterface
Parameters:
ctx - Context object.
userIds - int[] containing the user ids.
moduleAccess - UserModuleAccess containing module access.
Throws:
StorageException

changeModuleAccess

public void changeModuleAccess(Context ctx,
                               int userId,
                               UserModuleAccess moduleAccess)
                        throws StorageException
Description copied from class: OXUserStorageInterface
Manipulate user module access within the given context.

Specified by:
changeModuleAccess in class OXUserStorageInterface
Parameters:
ctx - Context object.
userId - int[] containing the user id.
moduleAccess - UserModuleAccess containing module access.
Throws:
StorageException

getModuleAccess

public UserModuleAccess getModuleAccess(Context ctx,
                                        int user_id)
                                 throws StorageException
Description copied from class: OXUserStorageInterface
Retrieve the ModuleAccess for an user.

Specified by:
getModuleAccess in class OXUserStorageInterface
user_id - long containing the user id.
Returns:
UserModuleAccess containing the module access rights.
Throws:
StorageException

changeLastModified

public void changeLastModified(int user_id,
                               Context ctx,
                               Connection write_ox_con)
                        throws StorageException
Description copied from class: OXUserStorageInterface
Changes last modified data in database

Specified by:
changeLastModified in class OXUserStorageInterface
Throws:
StorageException

createRecoveryData

public void createRecoveryData(Context ctx,
                               int user_id,
                               Connection write_ox_con)
                        throws StorageException
Description copied from class: OXUserStorageInterface
Fetch all data from current user and add it to "del_user"

Specified by:
createRecoveryData in class OXUserStorageInterface
Throws:
StorageException

deleteAllRecoveryData

public void deleteAllRecoveryData(Context ctx,
                                  Connection con)
                           throws StorageException
Description copied from class: OXUserStorageInterface
Delete from "del_user" for given context

Specified by:
deleteAllRecoveryData in class OXUserStorageInterface
Throws:
StorageException

deleteRecoveryData

public void deleteRecoveryData(Context ctx,
                               int user_id,
                               Connection con)
                        throws StorageException
Description copied from class: OXUserStorageInterface
Delete from "del_user" for given context and user

Specified by:
deleteRecoveryData in class OXUserStorageInterface
Throws:
StorageException

getintfrombool

public static int getintfrombool(boolean bool)

getboolfromint

public static boolean getboolfromint(int number)