refactor to class Difference

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@120327 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-11-19 16:17:13 +00:00
parent 80db6955aa
commit ef8bccf3ef
3 changed files with 11 additions and 10 deletions

View File

@ -60,7 +60,7 @@ import org.gcube.portlets.user.workspace.server.notifications.NotificationsUtil;
import org.gcube.portlets.user.workspace.server.resolver.UriResolverReaderParameter;
import org.gcube.portlets.user.workspace.server.shortener.UrlShortener;
import org.gcube.portlets.user.workspace.server.util.AclTypeComparator;
import org.gcube.portlets.user.workspace.server.util.DiffereceBetweenInfoContactModel;
import org.gcube.portlets.user.workspace.server.util.DifferenceBetweenInfoContactModel;
import org.gcube.portlets.user.workspace.server.util.HttpRequestUtil;
import org.gcube.portlets.user.workspace.server.util.StringUtil;
import org.gcube.portlets.user.workspace.server.util.UserUtil;
@ -1715,7 +1715,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
sharedFolder.setDescription(folder.getDescription()); //SET NEW DESCRIPTION
//USER REMOVED FROM SHARE
DiffereceBetweenInfoContactModel diff2 = new DiffereceBetweenInfoContactModel(listSharedContact, listContacts);
DifferenceBetweenInfoContactModel diff2 = new DifferenceBetweenInfoContactModel(listSharedContact, listContacts);
List<InfoContactModel> listRemovedUsersFromShare = diff2.getDifferentsContacts();
workspaceLogger.info("List removed user from share has size: "+listRemovedUsersFromShare.size());
for (InfoContactModel userRemoved : listRemovedUsersFromShare) {
@ -3062,14 +3062,14 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
NotificationsProducer np = getNotificationProducer();
workspaceLogger.info("Sending notifications downgrade/upgrade administator/s..");
DiffereceBetweenInfoContactModel diff1 = new DiffereceBetweenInfoContactModel(oldAdmins, newAdmins);
DifferenceBetweenInfoContactModel diff1 = new DifferenceBetweenInfoContactModel(oldAdmins, newAdmins);
List<InfoContactModel> contactsDowngrade = diff1.getDifferentsContacts();
for (InfoContactModel infoContactModel : contactsDowngrade) {
np.notifyAdministratorDowngrade(infoContactModel, sharedFolder);
}
DiffereceBetweenInfoContactModel diff2 = new DiffereceBetweenInfoContactModel(newAdmins, oldAdmins);
DifferenceBetweenInfoContactModel diff2 = new DifferenceBetweenInfoContactModel(newAdmins, oldAdmins);
List<InfoContactModel> contactsUpgrade = diff2.getDifferentsContacts();
for (InfoContactModel infoContactModel : contactsUpgrade) {

View File

@ -15,7 +15,7 @@ import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
import org.gcube.common.scope.impl.ScopeBean;
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
import org.gcube.portlets.user.workspace.server.util.DiffereceBetweenInfoContactModel;
import org.gcube.portlets.user.workspace.server.util.DifferenceBetweenInfoContactModel;
import org.gcube.portlets.user.workspace.server.util.UserUtil;
import org.gcube.portlets.user.workspace.server.util.WsUtil;
@ -241,7 +241,7 @@ public class NotificationsProducer {
try{
//NEW USER SHARED
DiffereceBetweenInfoContactModel diff = new DiffereceBetweenInfoContactModel(listSharingContact, listSharedContact);
DifferenceBetweenInfoContactModel diff = new DifferenceBetweenInfoContactModel(listSharingContact, listSharedContact);
List<InfoContactModel> listNewContactsShared = diff.getDifferentsContacts();
@ -307,7 +307,7 @@ public class NotificationsProducer {
}
//USER REMOVED FROM SHARE
DiffereceBetweenInfoContactModel diff2 = new DiffereceBetweenInfoContactModel(listSharedContact, listSharingContact);
DifferenceBetweenInfoContactModel diff2 = new DifferenceBetweenInfoContactModel(listSharedContact, listSharingContact);
List<InfoContactModel> listRemovedUsersFromShare = diff2.getDifferentsContacts();

View File

@ -7,13 +7,14 @@ import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
/**
* The Class DiffereceBetweenInfoContactModel.
* The Class DifferenceBetweenInfoContactModel.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Nov 19, 2015
*/
public class DiffereceBetweenInfoContactModel {
public class DifferenceBetweenInfoContactModel {
private List<InfoContactModel> listOne;
@ -25,7 +26,7 @@ public class DiffereceBetweenInfoContactModel {
* @param listA the list a
* @param listB the list b
*/
public DiffereceBetweenInfoContactModel(List<InfoContactModel> listA, List<InfoContactModel> listB){
public DifferenceBetweenInfoContactModel(List<InfoContactModel> listA, List<InfoContactModel> listB){
this.listOne = listA;
this.listTwo = listB;
}