com.openexchange.admin.storage.interfaces
Class OXGroupStorageInterface

java.lang.Object
  extended by com.openexchange.admin.storage.interfaces.OXGroupStorageInterface
Direct Known Subclasses:
OXGroupSQLStorage

public abstract class OXGroupStorageInterface
extends Object

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

Author:
d7, cutmasta

Constructor Summary
OXGroupStorageInterface()
           
 
Method Summary
abstract  void addMember(Context ctx, int grp_id, User[] members)
          Adds a new member to the group.
abstract  void change(Context ctx, Group grp)
          Edit group data
abstract  int create(Context ctx, Group grp)
          Create new group in given context
abstract  void delete(Context ctx, Group[] grps)
          Delete group from context
abstract  void deleteAllRecoveryData(Context ctx, Connection con)
          Deletes all recoevery data for context ctx
abstract  void deleteRecoveryData(Context ctx, int group_id, Connection con)
          Removes entry in del_groups for group group_id and context ctx
abstract  Group get(Context ctx, Group grp)
          Get group by context and id
abstract  Group[] getGroupsForUser(Context ctx, User usr)
          Get groups for a specified user!
static OXGroupStorageInterface getInstance()
          Creates a new instance implementing the group storage interface.
abstract  User[] getMembers(Context ctx, int grp_id)
          Get all members of group grp_id in context ctx
abstract  Group[] list(Context ctx, String pattern)
          List all groups mathcing pattern in context ctx
abstract  void removeMember(Context ctx, int grp_id, User[] members)
          Removes member from group
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OXGroupStorageInterface

public OXGroupStorageInterface()
Method Detail

getInstance

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

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

create

public abstract int create(Context ctx,
                           Group grp)
                    throws StorageException
Create new group in given context

Returns:
int with the id of the created group
Throws:
StorageException

list

public abstract Group[] list(Context ctx,
                             String pattern)
                      throws StorageException
List all groups mathcing pattern in context ctx

Throws:
StorageException

get

public abstract Group get(Context ctx,
                          Group grp)
                   throws StorageException
Get group by context and id

Throws:
StorageException

getGroupsForUser

public abstract Group[] getGroupsForUser(Context ctx,
                                         User usr)
                                  throws StorageException
Get groups for a specified user!

Throws:
StorageException

change

public abstract void change(Context ctx,
                            Group grp)
                     throws StorageException
Edit group data

Throws:
StorageException

addMember

public abstract void addMember(Context ctx,
                               int grp_id,
                               User[] members)
                        throws StorageException
Adds a new member to the group.

Throws:
StorageException

removeMember

public abstract void removeMember(Context ctx,
                                  int grp_id,
                                  User[] members)
                           throws StorageException
Removes member from group

Throws:
StorageException

delete

public abstract void delete(Context ctx,
                            Group[] grps)
                     throws StorageException
Delete group from context

Parameters:
ctx -
grps -
Throws:
StorageException

getMembers

public abstract User[] getMembers(Context ctx,
                                  int grp_id)
                           throws StorageException
Get all members of group grp_id in context ctx

Throws:
StorageException

deleteRecoveryData

public abstract void deleteRecoveryData(Context ctx,
                                        int group_id,
                                        Connection con)
                                 throws StorageException
Removes entry in del_groups for group group_id and context ctx

Throws:
StorageException

deleteAllRecoveryData

public abstract void deleteAllRecoveryData(Context ctx,
                                           Connection con)
                                    throws StorageException
Deletes all recoevery data for context ctx

Throws:
StorageException