Search in sources :

Example 11 with DataGridRule

use of com.emc.metalnx.core.domain.entity.DataGridRule in project metalnx-web by irods-contrib.

the class RuleServiceImpl method execGetVersionRule.

@Override
public String execGetVersionRule(String host) throws DataGridRuleException, DataGridConnectionRefusedException {
    logger.info("Get Version Rule called");
    DataGridRule rule = new DataGridRule(DataGridRule.GET_VERSION_RULE, host);
    rule.setOutputRuleParams("version");
    logger.debug(rule.toString());
    return (String) executeRule(rule.toString()).get("*version").getResultObject();
}
Also used : DataGridRule(com.emc.metalnx.core.domain.entity.DataGridRule)

Example 12 with DataGridRule

use of com.emc.metalnx.core.domain.entity.DataGridRule in project metalnx-web by irods-contrib.

the class RuleServiceImpl method execPopulateMetadataRule.

@Override
public void execPopulateMetadataRule(String host, String objPath) throws DataGridRuleException, DataGridConnectionRefusedException {
    if (!configService.isPopulateMsiEnabled())
        return;
    logger.info("Get Populate Rule called");
    DataGridRule rule = new DataGridRule(DataGridRule.POPULATE_RULE, host);
    rule.setInputRuleParams(objPath);
    executeRule(rule.toString());
}
Also used : DataGridRule(com.emc.metalnx.core.domain.entity.DataGridRule)

Example 13 with DataGridRule

use of com.emc.metalnx.core.domain.entity.DataGridRule in project metalnx-web by irods-contrib.

the class RuleServiceImpl method execEmptyTrashRule.

@Override
public void execEmptyTrashRule(String destResc, String objPath, boolean inAdminMode) throws DataGridConnectionRefusedException, DataGridRuleException {
    logger.info("Empty Trash Rule called");
    DataGridResource dgResc = rs.find(destResc);
    DataGridRule rule = new DataGridRule(DataGridRule.EMPTY_TRASH_RULE, dgResc.getHost(), false);
    String flag = inAdminMode ? "irodsAdminRmTrash=" : "irodsRmTrash=";
    rule.setInputRuleParams(objPath, flag);
    rule.setOutputRuleParams("out");
    executeRule(rule.toString());
}
Also used : DataGridRule(com.emc.metalnx.core.domain.entity.DataGridRule) DataGridResource(com.emc.metalnx.core.domain.entity.DataGridResource)

Example 14 with DataGridRule

use of com.emc.metalnx.core.domain.entity.DataGridRule in project metalnx-web by irods-contrib.

the class RuleServiceImpl method execImageRule.

@Override
public void execImageRule(String host, String objPath, String filePath) throws DataGridRuleException, DataGridConnectionRefusedException {
    if (!DataGridCoreUtils.isImageFile(objPath))
        return;
    logger.info("Get Image Rule called");
    DataGridRule rule = new DataGridRule(DataGridRule.JPG_RULE, host);
    rule.setInputRuleParams(objPath, filePath);
    executeRule(rule.toString());
}
Also used : DataGridRule(com.emc.metalnx.core.domain.entity.DataGridRule)

Example 15 with DataGridRule

use of com.emc.metalnx.core.domain.entity.DataGridRule in project metalnx-web by irods-contrib.

the class RuleServiceImpl method execDeploymentRule.

@Override
public void execDeploymentRule(String host, String ruleName, String ruleVaultPath) throws DataGridRuleException, DataGridConnectionRefusedException {
    logger.info("Deploy Rule called");
    if (ruleName == null || ruleName.isEmpty() || ruleVaultPath == null || ruleVaultPath.isEmpty() || !is.isAtLeastIrods420())
        return;
    DataGridRule rule = new DataGridRule(DataGridRule.DEPLOYMENT_RULE, host, false);
    rule.setInputRuleParams(ruleName, ruleVaultPath);
    executeRule(rule.toString());
}
Also used : DataGridRule(com.emc.metalnx.core.domain.entity.DataGridRule)

Aggregations

DataGridRule (com.emc.metalnx.core.domain.entity.DataGridRule)16 Test (org.junit.Test)5 DataGridResource (com.emc.metalnx.core.domain.entity.DataGridResource)2 DataGridCollectionAndDataObject (com.emc.metalnx.core.domain.entity.DataGridCollectionAndDataObject)1