group
Class GroupService

java.lang.Object
  extended by group.GroupService

public abstract class GroupService
extends Object

Interface offering group related functionalities to other components.


Field Summary
(package private)  ChangeFactory changeFactory
          A reference to the ChangeFactory that creates Change objects.
(package private)  ChangeService changeService
          A reference to the ChangeService that logs group changes.
(package private)  GroupInfoRepository groupInfoRepository
           
(package private)  MessageFactory messageFactory
          The GroupService uses the MessageFactory for creating Message objects for messages that it needs to send to other users.
(package private)  MessagingService messagingService
          The GroupService uses the MessagingService for sending messages to other users.
(package private)  SecurityService securityService
          A reference to the SecurityService, used by the GroupService to obtain secure tokens.
(package private)  SynchronizationService syncService
          A reference to the SynchronizationService that will log group changes.
(package private)  TopologyService topologyService
          The GroupService needs to inform the TopologyService when group users changes occur, such as a new user joined the group, or a user left the group.
 
Constructor Summary
GroupService()
           
 
Method Summary
abstract  void changeGroupSettings(Group group, Properties settings)
          GroupService applies the new group settings.
abstract  void changeOwner(Group group, User newOwner)
          GroupService starts performing the necessary steps for ownership transfer.
protected abstract  void getGroupChange()
          The GroupService uses the ChangeFactory to obtain a Change object for a group.
abstract  void inviteExternalPerson(Group group, String email)
          GroupService starts performing the necessary steps for inviting an external person into the given group.
abstract  void inviteUser(Group group, User user)
          GroupService starts performing the necessary steps for inviting an user into the given group.
protected abstract  void logGroupChange(Change change)
          The GroupService informs the ChangeService about a group change that it needs to log.
abstract  void processMessage(Message message)
          The MessagingService forwards a read message to the GroupService in order to apply group changes depending on the message content and type.
abstract  void receiveGroupChange(Change change)
          The SynchronizationService component informs the GroupService component about a group change.
abstract  void removeGroup(Group group)
          The GroupService completely removes a group from the system.
abstract  void removeUser(Group group, User user)
          GroupService starts performing the necessary steps for removing an user from the given group.
protected abstract  void syncGroupChange(Change change)
          The GroupService informs the SynchronizationService about a group change that it needs to synchronize.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

groupInfoRepository

GroupInfoRepository groupInfoRepository

changeFactory

ChangeFactory changeFactory
A reference to the ChangeFactory that creates Change objects.


changeService

ChangeService changeService
A reference to the ChangeService that logs group changes.


syncService

SynchronizationService syncService
A reference to the SynchronizationService that will log group changes.


messagingService

MessagingService messagingService
The GroupService uses the MessagingService for sending messages to other users.


securityService

SecurityService securityService
A reference to the SecurityService, used by the GroupService to obtain secure tokens.


topologyService

TopologyService topologyService
The GroupService needs to inform the TopologyService when group users changes occur, such as a new user joined the group, or a user left the group.


messageFactory

MessageFactory messageFactory
The GroupService uses the MessageFactory for creating Message objects for messages that it needs to send to other users.

Constructor Detail

GroupService

public GroupService()
Method Detail

inviteUser

public abstract void inviteUser(Group group,
                                User user)
GroupService starts performing the necessary steps for inviting an user into the given group.

Parameters:
group - - the group to which the user is invited
user - - the invited user

inviteExternalPerson

public abstract void inviteExternalPerson(Group group,
                                          String email)
GroupService starts performing the necessary steps for inviting an external person into the given group.

Parameters:
group - - the group to which the user is invited
email - - the external person's email address, to which the invitation is sent

removeUser

public abstract void removeUser(Group group,
                                User user)
GroupService starts performing the necessary steps for removing an user from the given group.

Parameters:
group - - the group from which the user is removed
user - - the user to be removed

changeGroupSettings

public abstract void changeGroupSettings(Group group,
                                         Properties settings)
GroupService applies the new group settings.

Parameters:
group -
settings -

changeOwner

public abstract void changeOwner(Group group,
                                 User newOwner)
GroupService starts performing the necessary steps for ownership transfer.

Parameters:
group - - the group for which the ownership is transferred
newOwner - - the proposed group owner

removeGroup

public abstract void removeGroup(Group group)
The GroupService completely removes a group from the system. It also removes the group's file and folders, in which case it has to communicate with the filesystem module.

Parameters:
group - - the group to be removed/deleted, it must not have any users, just the owner, which the logged in user

receiveGroupChange

public abstract void receiveGroupChange(Change change)
The SynchronizationService component informs the GroupService component about a group change. The GroupService will process the change and will transmit this information for storing to the GroupInfoRepository component.

Parameters:
change - - the Change object, also containing the Group to which it applies and what was performed that lead to it

processMessage

public abstract void processMessage(Message message)
The MessagingService forwards a read message to the GroupService in order to apply group changes depending on the message content and type. E.g. if the message is an invitation acceptance, the GroupService will add the user to the group and then use SynchronizationService to transmit this change to other users.

Parameters:
message -

logGroupChange

protected abstract void logGroupChange(Change change)
The GroupService informs the ChangeService about a group change that it needs to log.

Parameters:
change - - the change that occurred for a group

syncGroupChange

protected abstract void syncGroupChange(Change change)
The GroupService informs the SynchronizationService about a group change that it needs to synchronize.

Parameters:
change - - the change that occurred for a group

getGroupChange

protected abstract void getGroupChange()
The GroupService uses the ChangeFactory to obtain a Change object for a group.