com.openexchange.admin.rmi
Interface OXGroupInterface

All Superinterfaces:
Remote
All Known Implementing Classes:
OXGroup

public interface OXGroupInterface
extends Remote

This interface defines the Open-Xchange API Version 2 for creating and manipulating OX groups within an OX context.

Example:

 final OXGroupInterface iface = (OXGroupInterface)Naming.lookup("rmi:///oxhost/"+OXGroupInterface.RMI_NAME);
 
 final Context ctx = new Context(1);
 
 Group grp = new Group();
 grp.setDisplayname("display name");
 grp.setName("name");
 
 final Credentials auth = new Credentials();
 auth.setLogin("admin");
 auth.setPassword("secret");
 
 Group created = iface.create(ctx,group,auth);
  
 

Author:
Manuel Kraft, Carsten Hoeger, Dennis Sieben

Field Summary
static String RMI_NAME
          RMI name to be used in the naming lookup.
 
Method Summary
 void addMember(Context ctx, Group grp, User[] members, Credentials auth)
          Adds a new member to the group within given context.
 void change(Context ctx, Group grp, Credentials auth)
          Method for changing group data in given context
 Group create(Context ctx, Group grp, Credentials auth)
          Create new group in given context.
 void delete(Context ctx, Group[] grps, Credentials auth)
          Delete group within given context.
 void delete(Context ctx, Group grp, Credentials auth)
          Method for deleting group within given context.
 Group[] getData(Context ctx, Group[] grps, Credentials auth)
          Fetch specified groups from server.
 Group getData(Context ctx, Group grp, Credentials auth)
          Fetch a group from server.
 Group getDefaultGroup(Context ctx, Credentials auth)
          Gets the default group of the specified context.
 User[] getMembers(Context ctx, Group grp, Credentials auth)
          Get User IDs of the members of this group.
 Group[] list(Context ctx, String pattern, Credentials auth)
          List groups within context matching the pattern.
 Group[] listAll(Context ctx, Credentials auth)
          List all groups within context.
 Group[] listGroupsForUser(Context ctx, User usr, Credentials auth)
           
 void removeMember(Context ctx, Group grp, User[] members, Credentials auth)
          Remove member(s) from group.
 

Field Detail

RMI_NAME

static final String RMI_NAME
RMI name to be used in the naming lookup.

See Also:
Constant Field Values
Method Detail

addMember

void addMember(Context ctx,
               Group grp,
               User[] members,
               Credentials auth)
               throws RemoteException,
                      InvalidCredentialsException,
                      NoSuchContextException,
                      StorageException,
                      InvalidDataException,
                      DatabaseUpdateException,
                      NoSuchUserException,
                      NoSuchGroupException
Adds a new member to the group within given context.

Parameters:
ctx - Context object
grp_id - The ID of the group in which the new members should be added.
members - User objects with the user_id field set.
auth - Credentials for authenticating against server.
Throws:
RemoteException - General RMI Exception
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
StorageException - When an error in the subsystems occurred.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchUserException
NoSuchGroupException

change

void change(Context ctx,
            Group grp,
            Credentials auth)
            throws RemoteException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   NoSuchUserException,
                   StorageException,
                   InvalidDataException,
                   DatabaseUpdateException,
                   NoSuchGroupException
Method for changing group data in given context

Parameters:
ctx - Context object
grp - Group to change.
auth - Credentials for authenticating against server.
Throws:
RemoteException - General RMI Exception
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
StorageException - When an error in the subsystems occurred.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchGroupException
NoSuchUserException

create

Group create(Context ctx,
             Group grp,
             Credentials auth)
             throws RemoteException,
                    InvalidCredentialsException,
                    NoSuchContextException,
                    NoSuchUserException,
                    StorageException,
                    InvalidDataException,
                    DatabaseUpdateException
Create new group in given context.

Parameters:
ctx - Context object.
grp - Group which should be created.
auth - Credentials for authenticating against server.
Returns:
Group containing the id of the new group.
Throws:
RemoteException - General RMI Exception
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
StorageException - When an error in the subsystems occurred.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchUserException

delete

void delete(Context ctx,
            Group grp,
            Credentials auth)
            throws RemoteException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   StorageException,
                   InvalidDataException,
                   DatabaseUpdateException,
                   NoSuchGroupException
Method for deleting group within given context.

Parameters:
ctx - Context object
grp - Group which should be deleted from the server.
auth - Credentials for authenticating against server.
Throws:
RemoteException - General RMI Exception
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
StorageException - When an error in the subsystems occurred.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchGroupException

delete

void delete(Context ctx,
            Group[] grps,
            Credentials auth)
            throws RemoteException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   StorageException,
                   InvalidDataException,
                   DatabaseUpdateException,
                   NoSuchGroupException
Delete group within given context.

Parameters:
ctx - Context object
grps - Contains all groups which should be deleted from the server.
auth - Credentials for authenticating against server.
Throws:
RemoteException - General RMI Exception
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
StorageException - When an error in the subsystems occurred.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchGroupException

getData

Group getData(Context ctx,
              Group grp,
              Credentials auth)
              throws RemoteException,
                     InvalidCredentialsException,
                     NoSuchContextException,
                     StorageException,
                     InvalidDataException,
                     DatabaseUpdateException,
                     NoSuchGroupException
Fetch a group from server.

Parameters:
ctx - Context object
grp - the group to retrieve from server.
auth - Credentials for authenticating against server.
Returns:
The Group with its data.
Throws:
RemoteException - General RMI Exception
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
StorageException - When an error in the subsystems occurred.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchGroupException

getData

Group[] getData(Context ctx,
                Group[] grps,
                Credentials auth)
                throws RemoteException,
                       StorageException,
                       InvalidCredentialsException,
                       NoSuchContextException,
                       InvalidDataException,
                       NoSuchGroupException,
                       DatabaseUpdateException
Fetch specified groups from server. Can be used to fetch group data including extensions.

Parameters:
ctx -
grps -
auth -
Returns:
Groups including extension data if requested!
Throws:
RemoteException
StorageException
InvalidCredentialsException
NoSuchContextException
InvalidDataException
NoSuchGroupException
DatabaseUpdateException

getDefaultGroup

Group getDefaultGroup(Context ctx,
                      Credentials auth)
                      throws RemoteException,
                             StorageException,
                             InvalidCredentialsException,
                             NoSuchContextException,
                             InvalidDataException,
                             DatabaseUpdateException
Gets the default group of the specified context. This method obsoletes the old variant which returned an int value

Parameters:
ctx -
auth -
Returns:
The id of the default group of the context
Throws:
RemoteException
StorageException
InvalidCredentialsException
NoSuchContextException
InvalidDataException
DatabaseUpdateException

getMembers

User[] getMembers(Context ctx,
                  Group grp,
                  Credentials auth)
                  throws RemoteException,
                         InvalidCredentialsException,
                         NoSuchContextException,
                         StorageException,
                         InvalidDataException,
                         DatabaseUpdateException,
                         NoSuchGroupException
Get User IDs of the members of this group. This method obsoletes the old variant which returned an int array.

Parameters:
ctx - Context object
grp - group from which to retrieve the members.
auth - Credentials for authenticating against server.
Returns:
User IDs.
Throws:
RemoteException - General RMI Exception
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
StorageException - When an error in the subsystems occurred.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchGroupException

list

Group[] list(Context ctx,
             String pattern,
             Credentials auth)
             throws RemoteException,
                    InvalidCredentialsException,
                    NoSuchContextException,
                    StorageException,
                    InvalidDataException,
                    DatabaseUpdateException
List groups within context matching the pattern.

Parameters:
ctx - Context object.
pattern - Search pattern to search for e.g. "*mygroup*"
auth - Credentials for authenticating against server.
Returns:
Groups which matched the supplied search pattern.
Throws:
RemoteException - General RMI Exception
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
StorageException - When an error in the subsystems occured.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException

listAll

Group[] listAll(Context ctx,
                Credentials auth)
                throws RemoteException,
                       InvalidCredentialsException,
                       NoSuchContextException,
                       StorageException,
                       InvalidDataException,
                       DatabaseUpdateException
List all groups within context.

Parameters:
ctx - Context object.
auth - Credentials for authenticating against server.
Returns:
Groups which matched the supplied search pattern.
Throws:
RemoteException - General RMI Exception
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
StorageException - When an error in the subsystems occurred.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException

listGroupsForUser

Group[] listGroupsForUser(Context ctx,
                          User usr,
                          Credentials auth)
                          throws RemoteException,
                                 InvalidCredentialsException,
                                 NoSuchContextException,
                                 StorageException,
                                 InvalidDataException,
                                 DatabaseUpdateException,
                                 NoSuchUserException
Parameters:
ctx - Context object.
usr - User object
auth - Credentials for authenticating against server.
Returns:
Throws:
RemoteException - General RMI Exception
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
StorageException - When an error in the subsystems occurred.
InvalidDataException - if the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchUserException

removeMember

void removeMember(Context ctx,
                  Group grp,
                  User[] members,
                  Credentials auth)
                  throws RemoteException,
                         InvalidCredentialsException,
                         NoSuchContextException,
                         StorageException,
                         InvalidDataException,
                         DatabaseUpdateException,
                         NoSuchGroupException,
                         NoSuchUserException
Remove member(s) from group.

Parameters:
ctx - Context object
grp - the group from which the members should be removed.
members - User IDs.
auth - Credentials for authenticating against server.
Throws:
RemoteException - General RMI Exception
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
StorageException - When an error in the subsystems occurred.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchGroupException
NoSuchUserException