Removed not needed code and realted exception handling
This commit is contained in:
parent
28aadbc143
commit
753c962acb
|
@ -3,8 +3,6 @@ package org.gcube.portal.event.publisher.lr62.model;
|
|||
import java.util.Map;
|
||||
|
||||
import org.gcube.portal.event.publisher.lr62.PortalEvent;
|
||||
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
|
||||
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
|
||||
|
||||
import com.liferay.portal.model.BaseModel;
|
||||
import com.liferay.portal.model.User;
|
||||
|
@ -20,17 +18,13 @@ public class PortalModelListenerEvent<T extends BaseModel<T>> extends PortalEven
|
|||
setModelClassName(baseModel.getModelClassName());
|
||||
}
|
||||
|
||||
public PortalModelListenerEvent(String name, User user, T baseModel)
|
||||
throws UserManagementSystemException, UserRetrievalFault {
|
||||
|
||||
public PortalModelListenerEvent(String name, User user, T baseModel) {
|
||||
super(name);
|
||||
setUser(user);
|
||||
setModelClassName(baseModel.getModelClassName());
|
||||
}
|
||||
|
||||
public PortalModelListenerEvent(String name, Map<String, String> data, User user, T baseModel)
|
||||
throws UserManagementSystemException, UserRetrievalFault {
|
||||
|
||||
public PortalModelListenerEvent(String name, Map<String, String> data, User user, T baseModel) {
|
||||
super(name, data);
|
||||
setUser(user);
|
||||
setModelClassName(baseModel.getModelClassName());
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
package org.gcube.portal.event.publisher.lr62.model;
|
||||
|
||||
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
|
||||
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
|
||||
|
||||
import com.liferay.portal.kernel.exception.PortalException;
|
||||
import com.liferay.portal.kernel.exception.SystemException;
|
||||
import com.liferay.portal.model.Group;
|
||||
import com.liferay.portal.model.User;
|
||||
|
||||
|
@ -18,52 +13,29 @@ public class UserEvent extends PortalModelListenerEvent<User> {
|
|||
public static final String UG_CREATED_NAME = "user-group_created";
|
||||
public static final String UG_DELETED_NAME = "user-group_deleted";
|
||||
|
||||
private UserEvent(String name, User user) throws UserManagementSystemException, UserRetrievalFault {
|
||||
private UserEvent(String name, User user) {
|
||||
super(name, user, user);
|
||||
}
|
||||
|
||||
private UserEvent(String name, User user, Group group)
|
||||
throws PortalException, SystemException, UserManagementSystemException, UserRetrievalFault {
|
||||
|
||||
private UserEvent(String name, User user, Group group) {
|
||||
this(name, user);
|
||||
setGroup(group);
|
||||
}
|
||||
|
||||
public static UserEvent newCreatedEvent(User user) {
|
||||
try {
|
||||
return new UserEvent(CREATED_NAME, user);
|
||||
} catch (UserManagementSystemException | UserRetrievalFault e) {
|
||||
log.error("Cannot create event from User model object", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static UserEvent newDeletedEvent(User user) {
|
||||
try {
|
||||
return new UserEvent(DELETED_NAME, user);
|
||||
} catch (UserManagementSystemException | UserRetrievalFault e) {
|
||||
log.error("Cannot create event from User model object", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static UserEvent newCreatedEvent(User user, Group group) {
|
||||
try {
|
||||
return new UserEvent(UG_CREATED_NAME, user, group);
|
||||
} catch (PortalException | SystemException | UserManagementSystemException | UserRetrievalFault e) {
|
||||
log.error("Cannot create event from one model object", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static UserEvent newDeletedEvent(User user, Group group) {
|
||||
try {
|
||||
return new UserEvent(UG_DELETED_NAME, user, group);
|
||||
} catch (PortalException | SystemException | UserManagementSystemException | UserRetrievalFault e) {
|
||||
log.error("Cannot create event from one model object", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue