net.sf.sail.webapp.service.workgroup
Interface WorkgroupService

All Known Subinterfaces:
WISEWorkgroupService
All Known Implementing Classes:
WISEWorkgroupServiceImpl, WorkgroupServiceImpl

public interface WorkgroupService

Version:
$Id$
Author:
Cynick Young

Method Summary
 void addMembers(Workgroup workgroup, Set<User> membersToAdd)
          Adds members to an already-existing workgroup.
 List<Workgroup> createPreviewWorkgroupForOfferingIfNecessary(Offering offering, List<Workgroup> workgroupList, User user, String previewWorkgroupName)
          Given a list of workgroups for a particular offering, if the list is empty (i.e.
 Workgroup createWorkgroup(String name, Set<User> members, Offering offering)
          Creates a new SdsWorkgroup on the SDS as well as a Workgroup object in the local data store, and then associates that workgroup to an offering.
 Workgroup getPreviewWorkgroupForRooloOffering(Offering previewOffering, User previewUser)
          Creates a workgroup for a preview offering.
 Workgroup getWorkgroupForPreviewOffering(Offering previewOffering, User previewUser)
          Given a PreviewOffering, returns a workgroup that is used to preview it If a workgroup has not been created yet, a new workgroup is created with a default preview user
 List<Workgroup> getWorkgroupList()
          Gets a List of workgroups available.
 List<Workgroup> getWorkgroupListByOfferingAndUser(Offering offering, User user)
          Gets a List of workgroups for a given offering with the specified user as a member of that workgroup.
 List<Workgroup> getWorkgroupsForUser(User user)
          Given a User, returns all of the workgroups that the user is in
 void removeMembers(Workgroup workgroup, Set<User> membersToRemove)
          Removes members from an already-existing workgroup.
 Workgroup retrieveById(Long workgroupId)
          Retrieves the Workgroup domain object using unique workgroupId
 Workgroup updateWorkgroupMembership(ChangeWorkgroupParameters params)
          Updates the Workgroups by modifying its members
 

Method Detail

createPreviewWorkgroupForOfferingIfNecessary

List<Workgroup> createPreviewWorkgroupForOfferingIfNecessary(Offering offering,
                                                             List<Workgroup> workgroupList,
                                                             User user,
                                                             String previewWorkgroupName)
Given a list of workgroups for a particular offering, if the list is empty (i.e. there are no workgroups), then create a default "preview" workgroup with just the user in it. If there exists workgroups already, then do nothing.

Parameters:
offering - the given offering associated with the workgroups
workgroupList - List of workgroups belonging to the given offering
user - the User that should be put into the preview workgroup
previewWorkgroupName - String that specifies the default preview workgroup name
Returns:

getWorkgroupsForUser

List<Workgroup> getWorkgroupsForUser(User user)
Given a User, returns all of the workgroups that the user is in

Parameters:
user - the User to search for
Returns:
a list of workgroups that the specified user is in.

getWorkgroupForPreviewOffering

Workgroup getWorkgroupForPreviewOffering(Offering previewOffering,
                                         User previewUser)
Given a PreviewOffering, returns a workgroup that is used to preview it If a workgroup has not been created yet, a new workgroup is created with a default preview user

Parameters:
previewOffering -
previewUser -
Returns:
workgroup

getPreviewWorkgroupForRooloOffering

Workgroup getPreviewWorkgroupForRooloOffering(Offering previewOffering,
                                              User previewUser)
Creates a workgroup for a preview offering.

Parameters:
Offering - previewOffering
User - previewUser
Returns:
Workgroup

getWorkgroupListByOfferingAndUser

List<Workgroup> getWorkgroupListByOfferingAndUser(Offering offering,
                                                  User user)
Gets a List of workgroups for a given offering with the specified user as a member of that workgroup.

Parameters:
offering - for the workgroup
user - that is a member of the workgroup
Returns:

getWorkgroupList

List<Workgroup> getWorkgroupList()
Gets a List of workgroups available.

Returns:
a Workgroup List.

createWorkgroup

Workgroup createWorkgroup(String name,
                          Set<User> members,
                          Offering offering)
Creates a new SdsWorkgroup on the SDS as well as a Workgroup object in the local data store, and then associates that workgroup to an offering. A side effect is that the workgroup id is set to the value that the SDS assigns to the new workgroup.

Parameters:
name - String name of the workgroup you want to create
offering - The offering to associate the workgroup to
Returns:
a Workgroup that is created.

addMembers

void addMembers(Workgroup workgroup,
                Set<User> membersToAdd)
Adds members to an already-existing workgroup. If a member is already in the group, do not add again. Also update the workgroup name.

Parameters:
workgroup - an existing Workgroup that the members will be added to
membersToAdd - Set of users to add to the group

removeMembers

void removeMembers(Workgroup workgroup,
                   Set<User> membersToRemove)
Removes members from an already-existing workgroup. Also update the workgroup name.

Parameters:
workgroup - an existing Workgroup that the members will be removed from
membersToRemove - Set of users to remove from the group

retrieveById

Workgroup retrieveById(Long workgroupId)
                       throws ObjectNotFoundException
Retrieves the Workgroup domain object using unique workgroupId

Parameters:
workgroupId - Long workgroupId to use for lookup
Returns:
Workgroup the Workgroup object with the workgroupId
Throws:
ObjectNotFoundException - when workgroupId cannot be used to find an existing workgroup
ObjectNotFoundException

updateWorkgroupMembership

Workgroup updateWorkgroupMembership(ChangeWorkgroupParameters params)
                                    throws Exception
Updates the Workgroups by modifying its members

Parameters:
student - the student to move from one workgroup to another
workgroupFrom - the workgroup that loses the student
workgroupTo - the workgroup that receives the student if workgroupTo does not exist, workgroupTo is null, and a new workgroup is created
Throws:
Exception - when update fails
Exception


Copyright © 2012. All Rights Reserved.