2016-09-14 14:27:54 +02:00
|
|
|
package org.gcube.portlets.user.dataminermanager.server.dmservice;
|
2016-04-06 18:28:32 +02:00
|
|
|
|
2016-11-25 16:10:40 +01:00
|
|
|
import org.gcube.portlets.user.dataminermanager.server.util.ServiceCredentials;
|
2016-04-06 18:28:32 +02:00
|
|
|
import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
/**
|
2016-09-14 14:27:54 +02:00
|
|
|
* Builder of Client 4 WPS Service
|
2016-04-06 18:28:32 +02:00
|
|
|
*
|
2017-05-12 11:58:15 +02:00
|
|
|
* @author Giancarlo Panichi
|
|
|
|
*
|
2016-04-06 18:28:32 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class SClient4WPSBuilder extends SClientBuilder {
|
|
|
|
private static Logger logger = LoggerFactory
|
|
|
|
.getLogger(SClient4WPSBuilder.class);
|
2016-11-25 16:10:40 +01:00
|
|
|
private ServiceCredentials serviceCredendial;
|
2016-04-06 18:28:32 +02:00
|
|
|
|
2016-11-25 16:10:40 +01:00
|
|
|
public SClient4WPSBuilder(ServiceCredentials serviceCredential) {
|
2016-04-06 18:28:32 +02:00
|
|
|
this.serviceCredendial= serviceCredential;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void buildSClient() throws ServiceException {
|
|
|
|
try {
|
2016-09-14 14:27:54 +02:00
|
|
|
logger.debug("Build SC4WPS");
|
2016-04-06 18:28:32 +02:00
|
|
|
logger.debug("ServiceCredential: " + serviceCredendial);
|
2016-09-14 14:27:54 +02:00
|
|
|
SClient sClient = new SClient4WPS(serviceCredendial);
|
2016-04-06 18:28:32 +02:00
|
|
|
|
2016-09-14 14:27:54 +02:00
|
|
|
sClientSpec.setSClient(sClient);
|
2016-04-06 18:28:32 +02:00
|
|
|
} catch (Throwable e) {
|
|
|
|
logger.error(e.getLocalizedMessage());
|
|
|
|
e.printStackTrace();
|
|
|
|
throw new ServiceException(e.getLocalizedMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|