added internal getConfiguration

This commit is contained in:
Francesco Mangiacrapa 2021-05-19 17:29:16 +02:00
parent 64b53656f9
commit 1aa4d7b3f6
1 changed files with 21 additions and 2 deletions

View File

@ -7,6 +7,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import org.gcube.common.portal.PortalContext;
import org.gcube.portal.wssynclibrary.shared.ItemNotSynched;
import org.gcube.portal.wssynclibrary.shared.WorkspaceFolderLocked;
@ -36,6 +38,7 @@ import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.liferay.portal.service.UserLocalServiceUtil;
// TODO: Auto-generated Javadoc
/**
* The server side implementation of the RPC service.
*
@ -127,10 +130,26 @@ public class ThreddsWorkspaceSyncServiceImpl extends RemoteServiceServlet implem
public WsThreddsSynchFolderDescriptor getConfiguration(String folderId, boolean loadStatus)
throws WorkspaceFolderLocked, Exception {
logger.debug("called isItemSynched for folderId: " + folderId);
GCubeUser user = PortalContext.getConfiguration().getCurrentUser(this.getThreadLocalRequest());
return getConfiguration(folderId, loadStatus, this.getThreadLocalRequest(), user);
}
/**
* Gets the configuration.
*
* @param folderId the folder id
* @param loadStatus the load status
* @param httpRequest the http request
* @param user the user
* @return the configuration
* @throws Exception the exception
*/
public WsThreddsSynchFolderDescriptor getConfiguration(String folderId, boolean loadStatus, HttpServletRequest httpRequest, GCubeUser user) throws Exception {
logger.debug("called internal getConfiguration for folderId: " + folderId);
try {
GCubeUser user = PortalContext.getConfiguration().getCurrentUser(this.getThreadLocalRequest());
ThSyncFolderDescriptor theConfig = getSyncService().getConfiguration(folderId, loadStatus, this.getThreadLocalRequest(), user);
ThSyncFolderDescriptor theConfig = getSyncService().getConfiguration(folderId, loadStatus, httpRequest, user);
if (theConfig != null) {
logger.info("Folder id: " + folderId + " is synched");