Search in sources :

Example 1 with IRODSRuleExecResult

use of org.irods.jargon.core.rule.IRODSRuleExecResult in project metalnx-web by irods-contrib.

the class RuleServiceImpl method executeRule.

@Override
public Map<String, IRODSRuleExecResultOutputParameter> executeRule(String rule) throws DataGridRuleException, DataGridConnectionRefusedException {
    if (rule == null || rule.isEmpty())
        return null;
    Map<String, IRODSRuleExecResultOutputParameter> ruleResultMap;
    try {
        IRODSRuleExecResult result = is.getRuleProcessingAO().executeRule(rule);
        ruleResultMap = result.getOutputParameterResults();
    } catch (JargonException e) {
        String error = String.format("Could not execute rule %s: %s", rule, e.getMessage());
        logger.error(error);
        throw new DataGridRuleException(error);
    }
    return ruleResultMap;
}
Also used : DataGridRuleException(com.emc.metalnx.core.domain.exceptions.DataGridRuleException) IRODSRuleExecResultOutputParameter(org.irods.jargon.core.rule.IRODSRuleExecResultOutputParameter) JargonException(org.irods.jargon.core.exception.JargonException) IRODSRuleExecResult(org.irods.jargon.core.rule.IRODSRuleExecResult)

Aggregations

DataGridRuleException (com.emc.metalnx.core.domain.exceptions.DataGridRuleException)1 JargonException (org.irods.jargon.core.exception.JargonException)1 IRODSRuleExecResult (org.irods.jargon.core.rule.IRODSRuleExecResult)1 IRODSRuleExecResultOutputParameter (org.irods.jargon.core.rule.IRODSRuleExecResultOutputParameter)1