use of com.haulmont.cuba.web.export.LogDataProvider in project cuba by cuba-platform.
the class LogDownloadOptionsWindow method downloadTail.
public void downloadTail() {
LogDataProvider logDataProvider;
if (remoteContextBox.isVisible()) {
logDataProvider = new LogDataProvider(connection, logFileName, remoteContextField.getValue(), false);
} else {
logDataProvider = new LogDataProvider(connection, logFileName, false);
}
logDataProvider.obtainUrl();
exportFile(logDataProvider, logFileName);
close(CLOSE_ACTION_ID);
}
use of com.haulmont.cuba.web.export.LogDataProvider in project cuba by cuba-platform.
the class ServerLogWindow method downloadLog.
public void downloadLog() {
final String fileName = logFileNameField.getValue();
if (fileName != null) {
try {
final JmxInstance selectedConnection = getSelectedConnection();
// check if we have many suitable JmxControlBean instances
// show dialog with context select and size options if needed
List<String> availableContexts = jmxRemoteLoggingAPI.getAvailableContexts(selectedConnection);
long size = jmxRemoteLoggingAPI.getLogFileSize(selectedConnection, fileName);
if (size <= LogArchiver.LOG_TAIL_FOR_PACKING_SIZE && availableContexts.size() == 1) {
LogDataProvider dataProvider = new LogDataProvider(selectedConnection, fileName, availableContexts.get(0), false);
dataProvider.obtainUrl();
ExportDisplay exportDisplay = AppConfig.createExportDisplay(this);
exportDisplay.show(dataProvider, fileName + ".zip");
} else {
openWindow("serverLogDownloadOptionsDialog", OpenType.DIALOG, ParamsMap.of("logFileName", fileName, "connection", selectedConnection, "logFileSize", size, "remoteContextList", availableContexts));
}
} catch (RuntimeException | LogControlException e) {
showNotification(getMessage("exception.logControl"), NotificationType.ERROR);
log.error("Error downloading log", e);
}
} else {
showNotification(getMessage("log.notSelected"), NotificationType.HUMANIZED);
}
}
use of com.haulmont.cuba.web.export.LogDataProvider in project cuba by cuba-platform.
the class LogDownloadOptionsWindow method downloadFull.
public void downloadFull() {
LogDataProvider logDataProvider;
if (remoteContextBox.isVisible()) {
logDataProvider = new LogDataProvider(connection, logFileName, remoteContextField.getValue(), true);
} else {
logDataProvider = new LogDataProvider(connection, logFileName, true);
}
logDataProvider.obtainUrl();
exportFile(logDataProvider, logFileName);
close(CLOSE_ACTION_ID);
}
Aggregations