Search in sources :

Example 16 with InputDataObjectType

use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.

the class ExperimentRegistry method updateExpInputs.

public void updateExpInputs(List<InputDataObjectType> exInputs, String expID) throws RegistryException {
    try {
        ExperimentResource experimentResource = new ExperimentResource();
        experimentResource.setExperimentId(expID);
        List<ExperimentInputResource> experimentInputs = experimentResource.getExperimentInputs();
        for (InputDataObjectType input : exInputs) {
            for (ExperimentInputResource exinput : experimentInputs) {
                if (exinput.getInputName().equals(input.getName())) {
                    exinput.setInputValue(input.getValue());
                    exinput.setExperimentId(expID);
                    if (input.getType() != null) {
                        exinput.setDataType(input.getType().toString());
                    }
                    exinput.setMetadata(input.getMetaData());
                    exinput.setApplicationArgument(input.getApplicationArgument());
                    exinput.setInputOrder(input.getInputOrder());
                    exinput.setIsRequired(input.isIsRequired());
                    exinput.setRequiredToAddedToCmd(input.isRequiredToAddedToCommandLine());
                    exinput.setStorageResourceId(input.getStorageResourceId());
                    exinput.setIsReadOnly(input.isIsReadOnly());
                    exinput.save();
                }
            }
        }
    } catch (Exception e) {
        logger.error("Unable to update experiment inputs", e);
        throw new RegistryException(e);
    }
}
Also used : InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) RegistryException(org.apache.airavata.registry.cpi.RegistryException) RegistryException(org.apache.airavata.registry.cpi.RegistryException)

Example 17 with InputDataObjectType

use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.

the class ExperimentRegistry method addProcessInputs.

public String addProcessInputs(List<InputDataObjectType> processInputs, String processID) throws RegistryException {
    try {
        for (InputDataObjectType input : processInputs) {
            ProcessInputResource resource = new ProcessInputResource();
            resource.setProcessId(processID);
            resource.setInputName(input.getName());
            resource.setInputValue(input.getValue());
            if (input.getType() != null) {
                resource.setDataType(input.getType().toString());
            }
            resource.setMetadata(input.getMetaData());
            resource.setApplicationArgument(input.getApplicationArgument());
            resource.setInputOrder(input.getInputOrder());
            resource.setIsRequired(input.isIsRequired());
            resource.setRequiredToAddedToCmd(input.isRequiredToAddedToCommandLine());
            resource.setStorageResourceId(input.getStorageResourceId());
            resource.setIsReadOnly(input.isIsReadOnly());
            resource.save();
        }
        return processID;
    } catch (Exception e) {
        logger.error("Unable to save process inputs", e);
        throw new RegistryException(e);
    }
}
Also used : InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) RegistryException(org.apache.airavata.registry.cpi.RegistryException) RegistryException(org.apache.airavata.registry.cpi.RegistryException)

Example 18 with InputDataObjectType

use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.

the class AppCatalogThriftConversion method getInputDataObjType.

public static InputDataObjectType getInputDataObjType(ApplicationInputResource input) {
    InputDataObjectType inputDataObjectType = new InputDataObjectType();
    inputDataObjectType.setName(input.getInputKey());
    inputDataObjectType.setValue(input.getInputVal());
    inputDataObjectType.setApplicationArgument(input.getAppArgument());
    inputDataObjectType.setInputOrder(input.getInputOrder());
    inputDataObjectType.setMetaData(input.getMetadata());
    inputDataObjectType.setType(DataType.valueOf(input.getDataType()));
    inputDataObjectType.setStandardInput(input.isStandardInput());
    inputDataObjectType.setUserFriendlyDescription(input.getUserFriendlyDesc());
    inputDataObjectType.setIsRequired(input.getRequired());
    inputDataObjectType.setRequiredToAddedToCommandLine(input.getRequiredToCMD());
    inputDataObjectType.setDataStaged(input.isDataStaged());
    inputDataObjectType.setIsReadOnly(input.isReadOnly());
    return inputDataObjectType;
}
Also used : InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType)

Example 19 with InputDataObjectType

use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.

the class ThriftDataModelConversion method getInput.

public static InputDataObjectType getInput(Object object) {
    if (object != null) {
        InputDataObjectType dataObjectType = new InputDataObjectType();
        if (object instanceof ExperimentInputResource) {
            ExperimentInputResource inputResource = (ExperimentInputResource) object;
            dataObjectType.setName(inputResource.getInputName());
            dataObjectType.setValue(inputResource.getInputValue());
            dataObjectType.setType(DataType.valueOf(inputResource.getDataType()));
            dataObjectType.setApplicationArgument(inputResource.getApplicationArgument());
            dataObjectType.setStandardInput(inputResource.getStandardInput());
            dataObjectType.setUserFriendlyDescription(inputResource.getUserFriendlyDescription());
            dataObjectType.setMetaData(inputResource.getMetadata());
            dataObjectType.setInputOrder(inputResource.getInputOrder());
            dataObjectType.setIsRequired(inputResource.getIsRequired());
            dataObjectType.setRequiredToAddedToCommandLine(inputResource.getRequiredToAddedToCmd());
            dataObjectType.setDataStaged(inputResource.getDataStaged());
            dataObjectType.setIsReadOnly(inputResource.isReadOnly());
            dataObjectType.setStorageResourceId(inputResource.getStorageResourceId());
            return dataObjectType;
        } else if (object instanceof ProcessInputResource) {
            ProcessInputResource inputResource = (ProcessInputResource) object;
            dataObjectType.setName(inputResource.getInputName());
            dataObjectType.setValue(inputResource.getInputValue());
            dataObjectType.setType(DataType.valueOf(inputResource.getDataType()));
            dataObjectType.setApplicationArgument(inputResource.getApplicationArgument());
            dataObjectType.setStandardInput(inputResource.getStandardInput());
            dataObjectType.setUserFriendlyDescription(inputResource.getUserFriendlyDescription());
            dataObjectType.setMetaData(inputResource.getMetadata());
            dataObjectType.setInputOrder(inputResource.getInputOrder());
            dataObjectType.setIsRequired(inputResource.getIsRequired());
            dataObjectType.setRequiredToAddedToCommandLine(inputResource.getRequiredToAddedToCmd());
            dataObjectType.setDataStaged(inputResource.getDataStaged());
            dataObjectType.setStorageResourceId(inputResource.getStorageResourceId());
            dataObjectType.setIsReadOnly(inputResource.isReadOnly());
            return dataObjectType;
        } else {
            return null;
        }
    }
    return null;
}
Also used : InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType)

Example 20 with InputDataObjectType

use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.

the class ThriftDataModelConversion method getProcessInputs.

public static List<InputDataObjectType> getProcessInputs(List<ProcessInputResource> processInputResources) {
    List<InputDataObjectType> nodeInputs = new ArrayList<InputDataObjectType>();
    if (processInputResources != null && !processInputResources.isEmpty()) {
        for (ProcessInputResource inputResource : processInputResources) {
            InputDataObjectType nodeInput = getInput(inputResource);
            nodeInputs.add(nodeInput);
        }
    }
    return nodeInputs;
}
Also used : InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) ArrayList(java.util.ArrayList)

Aggregations

InputDataObjectType (org.apache.airavata.model.application.io.InputDataObjectType)86 OutputDataObjectType (org.apache.airavata.model.application.io.OutputDataObjectType)60 TException (org.apache.thrift.TException)49 AuthzToken (org.apache.airavata.model.security.AuthzToken)46 UserConfigurationDataModel (org.apache.airavata.model.experiment.UserConfigurationDataModel)35 ComputationalResourceSchedulingModel (org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel)35 ExperimentModel (org.apache.airavata.model.experiment.ExperimentModel)34 ArrayList (java.util.ArrayList)20 Project (org.apache.airavata.model.workspace.Project)17 AiravataClientException (org.apache.airavata.model.error.AiravataClientException)7 AiravataSystemException (org.apache.airavata.model.error.AiravataSystemException)7 InvalidRequestException (org.apache.airavata.model.error.InvalidRequestException)7 RegistryException (org.apache.airavata.registry.cpi.RegistryException)6 HashMap (java.util.HashMap)3 DocumentCreatorNew (org.apache.airavata.integration.tools.DocumentCreatorNew)3 AppCatalogException (org.apache.airavata.registry.cpi.AppCatalogException)3 BeforeTest (org.testng.annotations.BeforeTest)3 Test (org.testng.annotations.Test)3 JSchException (com.jcraft.jsch.JSchException)2 Session (com.jcraft.jsch.Session)2