com.openexchange.admin.storage.sqlStorage
Class OXUserSQLStorage

java.lang.Object
  extended by com.openexchange.admin.storage.interfaces.OXUserStorageInterface
      extended by com.openexchange.admin.storage.sqlStorage.OXUserSQLStorage
Direct Known Subclasses:
OXUserMySQLStorage

public abstract class OXUserSQLStorage
extends OXUserStorageInterface

This class implements the global storage interface and creates a layer between the abstract storage definition and a storage in a SQL accessible database

Author:
d7, cutmasta

Constructor Summary
OXUserSQLStorage()
           
 
Method Summary
abstract  void change(Context ctx, User usrdata)
          Manipulate user data within the given context.
abstract  void changeLastModified(int user_id, Context ctx, java.sql.Connection write_ox_con)
          Changes last modified data in database
abstract  void changeModuleAccess(Context ctx, int user_id, UserModuleAccess moduleAccess)
          Manipulate user module access within the given context.
abstract  int create(Context ctx, User usrdata, UserModuleAccess moduleAccess)
          Create new user in context ctx
abstract  int create(Context ctx, User usrdata, UserModuleAccess moduleAccess, java.sql.Connection write_ox_con, int internal_user_id, int contact_id, 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
abstract  void createRecoveryData(Context ctx, int user_id, java.sql.Connection write_ox_con)
          Fetch all data from current user and add it to "del_user"
abstract  void deleteAllRecoveryData(Context ctx, java.sql.Connection con)
          Delete from "del_user" for given context
abstract  void deleteRecoveryData(Context ctx, int user_id, java.sql.Connection con)
          Delete from "del_user" for given context and user
abstract  int[] getAll(Context ctx)
          Retrieve all user ids for a given context.
abstract  User[] getData(Context ctx, User[] users)
          Retrieve user objects for a range of users identified by User.getUsername().
abstract  UserModuleAccess getModuleAccess(Context ctx, int user_id)
          Retrieve the ModuleAccess for an user.
 
Methods inherited from class com.openexchange.admin.storage.interfaces.OXUserStorageInterface
changeModuleAccess, delete, delete, delete, getInstance, list
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OXUserSQLStorage

public OXUserSQLStorage()
Method Detail

changeLastModified

public abstract void changeLastModified(int user_id,
                                        Context ctx,
                                        java.sql.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

change

public abstract 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

changeModuleAccess

public abstract void changeModuleAccess(Context ctx,
                                        int user_id,
                                        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.
user_id - int[] containing the user id.
moduleAccess - UserModuleAccess containing module access.
Throws:
StorageException

create

public abstract int create(Context ctx,
                           User usrdata,
                           UserModuleAccess moduleAccess,
                           java.sql.Connection write_ox_con,
                           int internal_user_id,
                           int contact_id,
                           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 abstract 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

createRecoveryData

public abstract void createRecoveryData(Context ctx,
                                        int user_id,
                                        java.sql.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

deleteRecoveryData

public abstract void deleteRecoveryData(Context ctx,
                                        int user_id,
                                        java.sql.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

deleteAllRecoveryData

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

Specified by:
deleteAllRecoveryData in class OXUserStorageInterface
Throws:
StorageException

getAll

public abstract 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

getData

public abstract 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

getModuleAccess

public abstract 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