use of com.microsoft.azuretools.core.mvp.ui.rediscache.RedisScanResult in project azure-tools-for-java by Microsoft.
the class RedisExplorerPresenter method onKeyList.
/**
* Called when Scan button is clicked.
*
* @param sid
* subscription id of Redis Cache
* @param id
* resource id of Redis Cache
* @param db
* index of Redis Cache database
* @param cursor
* scan cursor for Redis Cache
* @param pattern
* scan match pattern for Redis Cache
*/
public void onKeyList(int db, String cursor, String pattern) {
Operation operation = TelemetryManager.createOperation(TelemetryConstants.REDIS, TelemetryConstants.REDIS_SCAN);
operation.start();
Observable.fromCallable(() -> {
return RedisExplorerMvpModel.getInstance().scanKeys(sid, id, db, cursor, pattern);
}).subscribeOn(getSchedulerProvider().io()).subscribe(result -> {
DefaultLoader.getIdeHelper().invokeLater(() -> {
if (isViewDetached()) {
return;
}
getMvpView().showScanResult(new RedisScanResult(result));
operation.complete();
});
}, e -> {
EventUtil.logError(operation, ErrorType.userError, new Exception(e), null, null);
operation.complete();
errorHandler(CANNOT_GET_REDIS_INFO, (Exception) e);
});
}
Aggregations