com.openexchange.admin.rmi.impl
Class OXGroup

java.lang.Object
  extended by com.openexchange.admin.rmi.impl.OXCommonImpl
      extended by com.openexchange.admin.rmi.impl.OXGroup
All Implemented Interfaces:
OXGroupInterface, Remote

public class OXGroup
extends OXCommonImpl
implements OXGroupInterface

Implementation for the RMI interface of group

Author:
d7

Field Summary
 
Fields inherited from interface com.openexchange.admin.rmi.OXGroupInterface
RMI_NAME
 
Constructor Summary
OXGroup(BundleContext context)
           
 
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[] grp, 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[] groups, 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OXGroup

public OXGroup(BundleContext context)
        throws RemoteException,
               StorageException
Throws:
RemoteException
StorageException
Method Detail

addMember

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

Specified by:
addMember in interface OXGroupInterface
Parameters:
ctx - Context object
members - User objects with the user_id field set.
auth - Credentials for authenticating against server.
Throws:
RemoteException - General RMI Exception
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchUserException
NoSuchGroupException

change

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

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

create

public Group create(Context ctx,
                    Group grp,
                    Credentials auth)
             throws RemoteException,
                    StorageException,
                    InvalidCredentialsException,
                    NoSuchContextException,
                    InvalidDataException,
                    DatabaseUpdateException,
                    NoSuchUserException
Description copied from interface: OXGroupInterface
Create new group in given context.

Specified by:
create in interface OXGroupInterface
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
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchUserException

delete

public void delete(Context ctx,
                   Group grp,
                   Credentials auth)
            throws RemoteException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   StorageException,
                   InvalidDataException,
                   DatabaseUpdateException,
                   NoSuchGroupException
Description copied from interface: OXGroupInterface
Method for deleting group within given context.

Specified by:
delete in interface OXGroupInterface
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

public void delete(Context ctx,
                   Group[] grp,
                   Credentials auth)
            throws RemoteException,
                   StorageException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   InvalidDataException,
                   DatabaseUpdateException,
                   NoSuchGroupException
Description copied from interface: OXGroupInterface
Delete group within given context.

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

getData

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

Specified by:
getData in interface OXGroupInterface
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
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchGroupException

getData

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

Specified by:
getData in interface OXGroupInterface
Returns:
Groups including extension data if requested!
Throws:
RemoteException
StorageException
InvalidCredentialsException
NoSuchContextException
InvalidDataException
NoSuchGroupException
DatabaseUpdateException

getDefaultGroup

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

Specified by:
getDefaultGroup in interface OXGroupInterface
Returns:
The id of the default group of the context
Throws:
RemoteException
StorageException
InvalidCredentialsException
NoSuchContextException
InvalidDataException
DatabaseUpdateException

getMembers

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

Specified by:
getMembers in interface OXGroupInterface
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
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchGroupException

list

public Group[] list(Context ctx,
                    String pattern,
                    Credentials auth)
             throws RemoteException,
                    StorageException,
                    InvalidCredentialsException,
                    NoSuchContextException,
                    InvalidDataException,
                    DatabaseUpdateException
Description copied from interface: OXGroupInterface
List groups within context matching the pattern.

Specified by:
list in interface OXGroupInterface
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
StorageException - When an error in the subsystems occured.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException

listAll

public Group[] listAll(Context ctx,
                       Credentials auth)
                throws RemoteException,
                       InvalidCredentialsException,
                       NoSuchContextException,
                       StorageException,
                       InvalidDataException,
                       DatabaseUpdateException
Description copied from interface: OXGroupInterface
List all groups within context.

Specified by:
listAll in interface OXGroupInterface
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

public Group[] listGroupsForUser(Context ctx,
                                 User usr,
                                 Credentials auth)
                          throws RemoteException,
                                 InvalidCredentialsException,
                                 NoSuchContextException,
                                 StorageException,
                                 InvalidDataException,
                                 DatabaseUpdateException,
                                 NoSuchUserException
Specified by:
listGroupsForUser in interface OXGroupInterface
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

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

Specified by:
removeMember in interface OXGroupInterface
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
StorageException - When an error in the subsystems occurred.
InvalidCredentialsException - When the supplied credentials were not correct or invalid.
NoSuchContextException - If the context does not exist in the system.
InvalidDataException - If the data sent within the method contained invalid data.
DatabaseUpdateException
NoSuchGroupException
NoSuchUserException