Search in sources :

Example 16 with DataGridRule

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

the class RuleServiceImpl method execManifestFileRule.

@Override
public void execManifestFileRule(String host, String targetPath, String objPath, String filePath) throws DataGridRuleException, DataGridConnectionRefusedException, FileNotFoundException, JargonException {
    if (!DataGridCoreUtils.isPrideXMLManifestFile(objPath))
        return;
    logger.info("Get Manifest Rule called");
    DataGridRule rule = new DataGridRule(DataGridRule.XML_MANIFEST_RULE, host);
    List<DataGridCollectionAndDataObject> objs = cs.getSubCollectionsAndDataObjectsUnderPath(targetPath);
    for (DataGridCollectionAndDataObject obj : objs) {
        logger.info("Extracting metadata from [{}] and applying on [{}]", filePath, obj.getPath());
        rule.setInputRuleParams(obj.getPath(), filePath, filePath);
        executeRule(rule.toString());
    }
}
Also used : DataGridRule(com.emc.metalnx.core.domain.entity.DataGridRule) DataGridCollectionAndDataObject(com.emc.metalnx.core.domain.entity.DataGridCollectionAndDataObject)

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