use of org.irods.jargon.core.query.CollectionAndDataObjectListingEntry in project metalnx-web by irods-contrib.
the class CollectionServiceImpl method getSubCollectionsUnderPath.
@Override
public List<DataGridCollectionAndDataObject> getSubCollectionsUnderPath(String parent) throws DataGridConnectionRefusedException {
logger.info("getSubCollectionsUnderPath()");
CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = irodsServices.getCollectionAndDataObjectListAndSearchAO();
List<DataGridCollectionAndDataObject> dataGridCollectionAndDataObjects = null;
try {
List<CollectionAndDataObjectListingEntry> collectionAndDataObjects = collectionAndDataObjectListAndSearchAO.listCollectionsUnderPath(parent, 0);
dataGridCollectionAndDataObjects = this.mapListingEntryToDataGridCollectionAndDataObject(collectionAndDataObjects);
return dataGridCollectionAndDataObjects;
} catch (FileNotFoundException e) {
logger.error("Could not locate file: ", e);
} catch (JargonException e) {
logger.error("Error: ", e);
}
return dataGridCollectionAndDataObjects;
}
use of org.irods.jargon.core.query.CollectionAndDataObjectListingEntry in project metalnx-web by irods-contrib.
the class CollectionServiceImpl method getSubCollectionsAndDataObjectsUnderPath.
@Override
public List<DataGridCollectionAndDataObject> getSubCollectionsAndDataObjectsUnderPath(String parent) throws DataGridConnectionRefusedException, JargonException {
logger.info("getSubCollectionsAndDataObjectsUnderPath()");
if (parent == null || parent.isEmpty()) {
throw new IllegalArgumentException("null or empty parent");
}
logger.info("parent:{}", parent);
CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = irodsServices.getCollectionAndDataObjectListAndSearchAO();
List<DataGridCollectionAndDataObject> dataGridCollectionAndDataObjects = null;
try {
List<CollectionAndDataObjectListingEntry> collectionAndDataObjects = collectionAndDataObjectListAndSearchAO.listDataObjectsAndCollectionsUnderPath(parent);
dataGridCollectionAndDataObjects = new ArrayList<DataGridCollectionAndDataObject>();
dataGridCollectionAndDataObjects = this.mapListingEntryToDataGridCollectionAndDataObject(collectionAndDataObjects);
return dataGridCollectionAndDataObjects;
} catch (FileNotFoundException e) {
logger.error("Could not locate file: ", e);
throw e;
} catch (JargonException e) {
logger.error("Error: ", e);
throw e;
}
}
use of org.irods.jargon.core.query.CollectionAndDataObjectListingEntry in project metalnx-web by irods-contrib.
the class CollectionServiceImpl method findByName.
@Override
public DataGridCollectionAndDataObject findByName(String path) throws FileNotFoundException, DataGridException {
logger.info("findByName()");
if (path == null || path.isEmpty()) {
logger.info("Could not find collection or data object by name: path is null");
return null;
}
logger.info("Find collection or data object by name: {}", path);
CollectionAndDataObjectListAndSearchAO objectsAO = irodsServices.getCollectionAndDataObjectListAndSearchAO();
DataGridCollectionAndDataObject dataGridCollectionAndDataObject;
try {
CollectionAndDataObjectListingEntry entry = objectsAO.getCollectionAndDataObjectListingEntryAtGivenAbsolutePathWithHeuristicPathGuessing(path);
dataGridCollectionAndDataObject = this.mapListingEntryToDataGridCollectionAndDataObject(entry);
} catch (FileNotFoundException fnf) {
logger.warn("file not found for path:{}", path);
throw fnf;
} catch (JargonException e) {
logger.debug("error finding collection/data object by name: {}", path);
throw new DataGridException("Could not find path " + path);
}
return dataGridCollectionAndDataObject;
}
use of org.irods.jargon.core.query.CollectionAndDataObjectListingEntry in project metalnx-web by irods-contrib.
the class CollectionServiceImpl method searchCollectionAndDataObjectsByName.
@Override
public List<DataGridCollectionAndDataObject> searchCollectionAndDataObjectsByName(String collectionName) throws DataGridConnectionRefusedException {
logger.info("searchCollectionAndDataObjectsByName()");
CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = irodsServices.getCollectionAndDataObjectListAndSearchAO();
List<CollectionAndDataObjectListingEntry> collectionAndDataObjects = null;
List<DataGridCollectionAndDataObject> dataGridCollectionAndDataObjects = null;
try {
collectionAndDataObjects = collectionAndDataObjectListAndSearchAO.searchCollectionsAndDataObjectsBasedOnName(collectionName);
dataGridCollectionAndDataObjects = this.mapListingEntryToDataGridCollectionAndDataObject(collectionAndDataObjects);
return dataGridCollectionAndDataObjects;
} catch (JargonException e) {
logger.error("Could not search collections: {}", e.getMessage());
}
return null;
}
use of org.irods.jargon.core.query.CollectionAndDataObjectListingEntry in project metalnx-web by irods-contrib.
the class CollectionServiceImpl method mapListingEntryToDataGridCollectionAndDataObject.
@Override
public List<DataGridCollectionAndDataObject> mapListingEntryToDataGridCollectionAndDataObject(List<CollectionAndDataObjectListingEntry> entries) {
logger.info("mapListingEntryToDataGridCollectionAndDataObject()");
logger.debug("Mapping a CollectionAndDataObjectListingEntry list into a DataGridCollectionAndDataObject list");
List<DataGridCollectionAndDataObject> dataGridCollectionAndDataObjects = new ArrayList<DataGridCollectionAndDataObject>();
for (CollectionAndDataObjectListingEntry entry : entries) {
dataGridCollectionAndDataObjects.add(mapListingEntryToDataGridCollectionAndDataObject(entry));
}
return dataGridCollectionAndDataObjects;
}
Aggregations