42 lines
942 B
Java
42 lines
942 B
Java
package org.gcube.portlets.admin;
|
|
|
|
import com.liferay.portal.kernel.log.Log;
|
|
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
|
import com.liferay.portal.service.UserLocalServiceUtil;
|
|
|
|
|
|
/**
|
|
*
|
|
* @author Massimiliano Assante ISTI-CNR
|
|
*
|
|
*/
|
|
public class RemoveUserAccountThread implements Runnable {
|
|
private static Log _log = LogFactoryUtil.getLog(RemoveUserAccountThread.class);
|
|
|
|
private long userId;
|
|
|
|
|
|
public RemoveUserAccountThread(long userId) {
|
|
super();
|
|
this.userId = userId;
|
|
|
|
}
|
|
|
|
@Override
|
|
public void run() {
|
|
handleUserRemoval(userId);
|
|
}
|
|
|
|
private void handleUserRemoval(long userId) {
|
|
_log.info("trying removeUser account for userId=" + userId);
|
|
//first remove the account
|
|
try {
|
|
Thread.sleep(1000);
|
|
UserLocalServiceUtil.deleteUser(userId);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
_log.info("removeUser account for " + userId + " done with success, not notify the managers ... ");
|
|
}
|
|
}
|