public interface RecycleBinQueryService
Modifier and Type | Method and Description |
---|---|
String |
executeRecycleBinContainerQuery(RecycleBinContainerQuery query,
ExtractFileCreateInfo file)
Extracts individual containers that have been deleted and are located in the recycle bin based on the specified
query.
|
String |
executeRecycleBinFileQuery(RecycleBinFileQuery query,
ExtractFileCreateInfo file)
Extracts individual files that have been deleted and are located in the recycle bin based on the specified query.
|
String |
executeRecycleBinFileVersionQuery(RecycleBinFileVersionQuery query,
ExtractFileCreateInfo file)
Extracts individual files that have been deleted and are located in the recycle bin based on the specified query.
|
String |
executeRecycleBinItemQuery(RecycleBinItemQuery query,
ExtractFileCreateInfo file)
Extracts individual items that have been deleted and are located in the recycle bin based on the specified query.
|
String executeRecycleBinItemQuery(RecycleBinItemQuery query, ExtractFileCreateInfo file) throws QueryException
QueryLimitException
is thrown.
Here is an example that queries recycle items for any item deleted in a specific location within the last month. The output includes all available RecycleBinItemQuery columns and is sorted in ascending order (oldest first) by the date it was deleted.
RecycleBinItemQuery query = new RecycleBinItemQuery(); Date oneMonthAgo = DateUtils.addMonths(new Date(), -1); query.select(RecycleBinItemQuery.ALL) .constrain(Condition.and(Comparison.greaterThan(RecycleBinItemQuery.DELETED_DATE, oneMonthAgo.getTime()), Comparison.like(RecycleBinItemQuery.PATH, "/ORG/PROJECT_A/*"))) .order(Order.ascending(RecycleBinItemQuery.DELETED_DATE)); service.executeRecycleBinItemQuery(query, fileInfo);
query
- The recycle bin criteria with which to query the recycle bin content.file
- The method to add the query output file.QueryException
- Thrown when there is an issue generating the query.String executeRecycleBinContainerQuery(RecycleBinContainerQuery query, ExtractFileCreateInfo file) throws QueryException
RecycleBinContainerQuery
represents
the total size of all the files in the container and below, which includes all versions of the file, if it is
versioned. The method requires the current user to be an Administrative mode user. If the query results exceed
the row limit (default is 10 million), a QueryLimitException
is thrown.
Here is an example that queries recycle bin containers with a size is greater than 1 million bytes (roughly 1 gigabyte). The size represents the total size, which includes all versions of all files in the container and below. The output includes path and size columns and is sorted according to size using the default sort order which is descending.
RecycleBinContainerQuery query = new RecycleBinContainerQuery(); query.select(RecycleBinItemQuery.PATH, RecycleBinContainerQuery.SIZE) .constrain(Comparison.greaterThan(RecycleBinContainerQuery.SIZE, 1000000)); .order((RecycleBinContainerQuery.SIZE)); service.executeRecycleBinContainerQuery(query, fileInfo);
query
- The recycle bin criteria with which to query the recycle bin content.file
- The method to add the query output file.QueryException
- Thrown when there is an issue generating the query.String executeRecycleBinFileQuery(RecycleBinFileQuery query, ExtractFileCreateInfo file) throws QueryException
QueryLimitException
is thrown.
Here is an example that queries recycle bin files that are SAS data sets and that have more than 10 versions. The output includes all available RecycleBinFileQuery columns and is sorted according to number of versions using the default sort order, which is descending.
RecycleBinFileQuery query = new RecycleBinFileQuery(); query.select(RecycleBinFileQuery.ALL); query.constrain(Condition.and(Comparison.equal(RecycleBinItemQuery.TYPE_ID, TypeConstants.TYPE_SAS_DATASET), Comparison.greaterThan(RecycleBinFileQuery.TOTAL_VERSIONS, 10))); query.order(RecycleBinFileQuery.TOTAL_VERSIONS); service.executeRecycleBinFileQuery(query, fileInfo);
query
- The recycle bin criteria with which to query the recycle bin content.file
- The method to add the query output file.QueryException
- Thrown when there is an issue generating the query.String executeRecycleBinFileVersionQuery(RecycleBinFileVersionQuery query, ExtractFileCreateInfo file) throws QueryException
QueryLimitException
is thrown.
*
Here is an example that queries recycle bin files that have a specific version with a size is greater than 10000000 bytes (roughly 10 megabytes). The output includes path, version, and size columns and is sorted in descending order by size.
RecycleBinFileVersionQuery query = new RecycleBinFileVersionQuery(); query.select(RecycleBinItemQuery.PATH, RecycleBinFileVersionQuery.VERSION, RecycleBinFileVersionQuery.SIZE); query.constrain(Comparison.greaterThanOrEqual(RecycleBinFileVersionQuery.SIZE, 10000000)); query.order(Order.descending(RecycleBinFileVersionQuery.SIZE)); service.executeRecycleBinFileVersionQuery(query, fileInfo);
query
- The recycle bin criteria with which to query the recycle bin content.file
- The method to add the query output file.QueryException
- Thrown when there is an issue generating the query.<i>Copyright (c) 2022, SAS Institute Inc., Cary, NC, USA</i>