Search in sources :

Example 1 with WSConfiguration

use of es.bsc.compss.ws.master.configuration.WSConfiguration in project compss by bsc-wdc.

the class WSAdaptor method constructConfiguration.

@Override
public Configuration constructConfiguration(Object project_properties, Object resources_properties) throws ConstructConfigurationException {
    es.bsc.compss.types.project.jaxb.ServiceType s_project = (es.bsc.compss.types.project.jaxb.ServiceType) project_properties;
    es.bsc.compss.types.resources.jaxb.ServiceType s_resources = (es.bsc.compss.types.resources.jaxb.ServiceType) resources_properties;
    String wsdl = null;
    if (s_project != null) {
        wsdl = s_project.getWsdl();
    } else if (s_resources != null) {
        wsdl = s_resources.getWsdl();
    } else {
        // No wsdl (service unique key), throw exception
        throw new ConstructConfigurationException("Cannot configure service because no WSDL provided");
    }
    WSConfiguration config = new WSConfiguration(this.getClass().getName(), wsdl);
    if (s_project != null) {
        config.setLimitOfTasks(s_project.getLimitOfTasks());
    }
    if (s_resources != null) {
        config.setServiceName(s_resources.getName());
        config.setNamespace(s_resources.getNamespace());
        String servicePort = s_resources.getPort();
        if (servicePort != null && !servicePort.isEmpty()) {
            config.setPort(s_resources.getPort());
        }
        PriceType p = s_resources.getPrice();
        if (p != null) {
            config.setPricePerUnitTime(p.getPricePerUnit());
            config.setPriceUnitTime(p.getTimeUnit());
        }
    }
    return config;
}
Also used : ConstructConfigurationException(es.bsc.compss.exceptions.ConstructConfigurationException) WSConfiguration(es.bsc.compss.ws.master.configuration.WSConfiguration) PriceType(es.bsc.compss.types.resources.jaxb.PriceType)

Aggregations

ConstructConfigurationException (es.bsc.compss.exceptions.ConstructConfigurationException)1 PriceType (es.bsc.compss.types.resources.jaxb.PriceType)1 WSConfiguration (es.bsc.compss.ws.master.configuration.WSConfiguration)1