Fixed Category to support DMPoolManager

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@165352 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2018-03-22 15:52:45 +00:00
parent 97b21c5878
commit 307d8f9fe5
2 changed files with 7 additions and 5 deletions

View File

@ -731,7 +731,7 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
logger.info("Deploy On PoolManager");
logger.debug("CodeJarAdminCopy for PoolManager: " + deploySave.getCodeJarAdminCopy());
DataMinerPoolManager poolManager = new DataMinerPoolManager(serviceCredentials);
String operationId = poolManager.deployAlgorithm(deploySave.getInfoData(),
String operationId = poolManager.deployAlgorithm(project, deploySave.getInfoData(),
deploySave.getCodeJarAdminCopy());
logger.info("Deploy operationId: " + operationId);
return operationId;

View File

@ -12,6 +12,7 @@ import org.gcube.portlets.user.statisticalalgorithmsimporter.server.is.Informati
import org.gcube.portlets.user.statisticalalgorithmsimporter.server.util.ServiceCredentials;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.info.InfoData;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.workspace.ItemDescription;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -32,9 +33,9 @@ public class DataMinerPoolManager {
serverUrl = InformationSystemUtils.retrieveDataMinerPoolManager(serviceCredentials.getScope());
}
public String deployAlgorithm(InfoData infoData, ItemDescription codeJarAdminCopy)
public String deployAlgorithm(Project project, InfoData infoData, ItemDescription codeJarAdminCopy)
throws StatAlgoImporterServiceException {
String operationId = sendRequest(infoData, codeJarAdminCopy);
String operationId = sendRequest(project, infoData, codeJarAdminCopy);
return operationId;
}
@ -53,7 +54,7 @@ public class DataMinerPoolManager {
return deployStatus;
}
private String sendRequest(InfoData infoData, ItemDescription codeJarAdminCopy)
private String sendRequest(Project project, InfoData infoData, ItemDescription codeJarAdminCopy)
throws StatAlgoImporterServiceException {
logger.info("Send request to DataMinerPoolManager: " + serverUrl);
/*
@ -68,7 +69,8 @@ public class DataMinerPoolManager {
try {
String requestUrl = serverUrl + "/algorithm/stage?gcube-token=" + serviceCredentials.getToken()
+ "&algorithmPackageURL=" + codeJarAdminCopy.getPublicLink() + "&algorithm_type=transducerers"
+ "&category=" + infoData.getAlgorithmCategory() + "&targetVRE=" + serviceCredentials.getScope();
+ "&category=" + project.getInputData().getProjectInfo().getAlgorithmCategory() + "&targetVRE="
+ serviceCredentials.getScope();
logger.debug("DataMinerPoolManager request=" + requestUrl);
// String authString = user + ":" + password;