GUACAMOLE-394: Add getLastActive() function, returning the time that a user/connection was last logged-in / used.

This commit is contained in:
Michael Jumper
2017-09-11 18:49:11 -07:00
parent b61f14e4db
commit 3cd7f453c0
10 changed files with 75 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ import com.google.inject.Provider;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -232,6 +233,11 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
return getModel().getSharingProfileIdentifiers();
}
@Override
public Date getLastActive() {
return null;
}
@Override
public List<? extends ConnectionRecord> getHistory() throws GuacamoleException {
return connectionService.retrieveHistory(getCurrentUser(), this);

View File

@@ -21,6 +21,7 @@ package org.apache.guacamole.auth.jdbc.sharing.connection;
import com.google.inject.Inject;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -146,6 +147,11 @@ public class SharedConnection implements Connection {
// Do nothing - changing attributes not supported
}
@Override
public Date getLastActive() {
return null;
}
@Override
public List<? extends ConnectionRecord> getHistory()
throws GuacamoleException {

View File

@@ -20,6 +20,7 @@
package org.apache.guacamole.auth.jdbc.sharing.user;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.guacamole.GuacamoleException;
@@ -90,6 +91,14 @@ public class SharedUser implements User {
// Do nothing - no attributes supported
}
@Override
public Date getLastActive() {
// History is not recorded for shared users
return null;
}
@Override
public List<ActivityRecord> getHistory() throws GuacamoleException {

View File

@@ -794,6 +794,11 @@ public class ModeledUser extends ModeledDirectoryObject<UserModel> implements Us
return getModel().isExpired();
}
@Override
public Date getLastActive() {
return null;
}
@Override
public List<ActivityRecord> getHistory() throws GuacamoleException {
return Collections.<ActivityRecord>emptyList();