use of org.ovirt.engine.core.common.businessentities.UserSession in project ovirt-engine by oVirt.
the class TerminateSessionsModel method setSessionsDetails.
private void setSessionsDetails() {
final List<String> sessionStrings = new ArrayList<>();
for (UserSession session : sessions) {
final long sessionId = session.getId();
final String sessionUserName = session.getUserName();
final String userSessionRow = ConstantsManager.getInstance().getMessages().userSessionRow(sessionId, sessionUserName);
sessionStrings.add(userSessionRow);
}
setItems(sessionStrings);
}
use of org.ovirt.engine.core.common.businessentities.UserSession in project ovirt-engine by oVirt.
the class TerminateSessionsModel method onTerminate.
private void onTerminate() {
final List<ActionParametersBase> parameterList = new ArrayList<>(sessions.size());
for (UserSession session : sessions) {
final long sessionId = session.getId();
final TerminateSessionParameters terminateSessionParameters = new TerminateSessionParameters(sessionId);
parameterList.add(terminateSessionParameters);
}
Frontend.getInstance().runMultipleActions(ActionType.TerminateSession, parameterList, result -> sourceListModel.getSearchCommand().execute());
cancel();
}
use of org.ovirt.engine.core.common.businessentities.UserSession in project ovirt-engine by oVirt.
the class MainSessionView method initTable.
void initTable() {
getTable().enableColumnResizing();
AbstractTextColumn<UserSession> sessionDbIdColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return Long.toString(session.getId());
}
};
sessionDbIdColumn.makeSortable(SessionConditionFieldAutoCompleter.SESSION_DB_ID);
// $NON-NLS-1$
getTable().addColumn(sessionDbIdColumn, constants.sessionDbId(), "100px");
AbstractTextColumn<UserSession> userNameColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return session.getUserName();
}
};
userNameColumn.makeSortable(SessionConditionFieldAutoCompleter.USER_NAME);
// $NON-NLS-1$
getTable().addColumn(userNameColumn, constants.userNameUser(), "200px");
AbstractTextColumn<UserSession> authzNameColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return session.getAuthzName();
}
};
authzNameColumn.makeSortable(SessionConditionFieldAutoCompleter.AUTHZ_NAME);
// $NON-NLS-1$
getTable().addColumn(authzNameColumn, constants.authorizationProvider(), "300px");
AbstractTextColumn<UserSession> userIdColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return session.getUserId().toString();
}
};
userIdColumn.makeSortable(SessionConditionFieldAutoCompleter.USER_ID);
// $NON-NLS-1$
getTable().addColumn(userIdColumn, constants.userId(), "200px");
AbstractTextColumn<UserSession> sourceIpColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return session.getSourceIp();
}
};
sourceIpColumn.makeSortable(SessionConditionFieldAutoCompleter.SOURCE_IP);
// $NON-NLS-1$
getTable().addColumn(sourceIpColumn, constants.sourceIp(), "200px");
final DateTimeFormat dateFormat = DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_MEDIUM);
AbstractTextColumn<UserSession> sessionStartColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return session.getSessionStartTime() == null ? // $NON-NLS-1$
"" : dateFormat.format(session.getSessionStartTime());
}
};
sessionStartColumn.makeSortable(Comparator.comparing(UserSession::getSessionStartTime));
// $NON-NLS-1$
getTable().addColumn(sessionStartColumn, constants.sessionStartTime(), "200px");
AbstractTextColumn<UserSession> sessionLastActiveColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return session.getSessionLastActiveTime() == null ? // $NON-NLS-1$
"" : dateFormat.format(session.getSessionLastActiveTime());
}
};
sessionLastActiveColumn.makeSortable(Comparator.comparing(UserSession::getSessionLastActiveTime));
// $NON-NLS-1$
getTable().addColumn(sessionLastActiveColumn, constants.sessionLastActiveTime(), "200px");
}
Aggregations