com.openexchange.admin.storage.interfaces
Class OXUserStorageInterface

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

public abstract class OXUserStorageInterface
extends Object

This interface provides an abstraction to the storage of the user information

Author:
d7, cutmasta

Constructor Summary
OXUserStorageInterface()
           
 
Method Summary
abstract  void change(Context ctx, User usrdata)
          Manipulate user data within the given context.
abstract  void changeLastModified(int user_id, Context ctx, Connection write_ox_con)
          Changes last modified data in database
abstract  void changeModuleAccess(Context ctx, int[] user_ids, UserModuleAccess moduleAccess)
          Manipulate users module access within the given context.
abstract  void changeModuleAccess(Context ctx, int userId, 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, 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, Connection write_ox_con)
          Fetch all data from current user and add it to "del_user"
abstract  void delete(Context ctx, User user)
          Delete one user in given context
abstract  void delete(Context ctx, User[] users)
          Delete users in given context
abstract  void delete(Context ctx, User[] user_ids, Connection write_ox_con)
          Delete an user or multiple from given context in given connection
abstract  void deleteAllRecoveryData(Context ctx, Connection con)
          Delete from "del_user" for given context
abstract  void deleteRecoveryData(Context ctx, int user_id, 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().
static OXUserStorageInterface getInstance()
          Creates a new instance implementing the group storage interface.
abstract  UserModuleAccess getModuleAccess(Context ctx, int user_id)
          Retrieve the ModuleAccess for an user.
abstract  User[] list(Context ctx, String search_pattern)
          Retrieve all user objects for a given context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OXUserStorageInterface

public OXUserStorageInterface()
Method Detail

getInstance

public static OXUserStorageInterface getInstance()
                                          throws StorageException
Creates a new instance implementing the group storage interface.

Returns:
an instance implementing the group storage interface.
Throws:
StorageException - Storage exception

getModuleAccess

public abstract UserModuleAccess getModuleAccess(Context ctx,
                                                 int user_id)
                                          throws StorageException
Retrieve the ModuleAccess for an user.

Parameters:
context - Context
user_id - long containing the user id.
Returns:
UserModuleAccess containing the module access rights.
Throws:
StorageException

changeModuleAccess

public abstract void changeModuleAccess(Context ctx,
                                        int userId,
                                        UserModuleAccess moduleAccess)
                                 throws StorageException
Manipulate user module access within the given context.

Parameters:
ctx - Context object.
userId - int[] containing the user id.
moduleAccess - UserModuleAccess containing module access.
Throws:
StorageException

changeModuleAccess

public abstract void changeModuleAccess(Context ctx,
                                        int[] user_ids,
                                        UserModuleAccess moduleAccess)
                                 throws StorageException
Manipulate users module access within the given context.

Parameters:
ctx - Context object.
user_ids - int[] containing the user ids.
moduleAccess - UserModuleAccess containing module access.
Throws:
StorageException

getData

public abstract User[] getData(Context ctx,
                               User[] users)
                        throws StorageException
Retrieve user objects for a range of users identified by User.getUsername().

Parameters:
context - Context object.
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:
RemoteException
StorageException

change

public abstract void change(Context ctx,
                            User usrdata)
                     throws StorageException
Manipulate user data within the given context.

Parameters:
context - Context in which the new user will be modified.
usrdata - User containing user data.
Throws:
StorageException

changeLastModified

public abstract void changeLastModified(int user_id,
                                        Context ctx,
                                        Connection write_ox_con)
                                 throws StorageException
Changes last modified data in database

Throws:
StorageException

create

public abstract int create(Context ctx,
                           User usrdata,
                           UserModuleAccess moduleAccess,
                           Connection write_ox_con,
                           int internal_user_id,
                           int contact_id,
                           int uid_number)
                    throws StorageException
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

Throws:
StorageException

create

public abstract int create(Context ctx,
                           User usrdata,
                           UserModuleAccess moduleAccess)
                    throws StorageException
Create new user in context ctx

Throws:
StorageException

getAll

public abstract int[] getAll(Context ctx)
                      throws StorageException
Retrieve all user ids for a given context.

Parameters:
ctx - numerical context identifier
Returns:
int[] containing user ids.
Throws:
StorageException

list

public abstract User[] list(Context ctx,
                            String search_pattern)
                     throws StorageException
Retrieve all user objects for a given context. Which match the given search_pattern

Parameters:
ctx - numerical context identifier
Returns:
User[] containing user ids.
Throws:
StorageException

delete

public abstract void delete(Context ctx,
                            User[] user_ids,
                            Connection write_ox_con)
                     throws StorageException
Delete an user or multiple from given context in given connection

Throws:
StorageException

delete

public abstract void delete(Context ctx,
                            User[] users)
                     throws StorageException
Delete users in given context

Throws:
StorageException

delete

public abstract void delete(Context ctx,
                            User user)
                     throws StorageException
Delete one user in given context

Throws:
StorageException

createRecoveryData

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

Throws:
StorageException

deleteRecoveryData

public abstract void deleteRecoveryData(Context ctx,
                                        int user_id,
                                        Connection con)
                                 throws StorageException
Delete from "del_user" for given context and user

Throws:
StorageException

deleteAllRecoveryData

public abstract void deleteAllRecoveryData(Context ctx,
                                           Connection con)
                                    throws StorageException
Delete from "del_user" for given context

Throws:
StorageException