mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-394: Pull connection last active time from history records.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
package org.apache.guacamole.auth.jdbc.connection;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.apache.guacamole.auth.jdbc.base.ChildObjectModel;
|
||||
@@ -92,6 +93,12 @@ public class ConnectionModel extends ChildObjectModel {
|
||||
*/
|
||||
private EncryptionMethod proxyEncryptionMethod;
|
||||
|
||||
/**
|
||||
* The date and time that this connection was last used, or null if this
|
||||
* connection has never been used.
|
||||
*/
|
||||
private Date lastActive;
|
||||
|
||||
/**
|
||||
* Creates a new, empty connection.
|
||||
*/
|
||||
@@ -341,6 +348,32 @@ public class ConnectionModel extends ChildObjectModel {
|
||||
this.sharingProfileIdentifiers = sharingProfileIdentifiers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the date and time that this connection was last used, or null if
|
||||
* this connection has never been used.
|
||||
*
|
||||
* @return
|
||||
* The date and time that this connection was last used, or null if this
|
||||
* connection has never been used.
|
||||
*/
|
||||
public Date getLastActive() {
|
||||
return lastActive;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the date and time that this connection was last used. This value is
|
||||
* expected to be set automatically via queries, derived from connection
|
||||
* history records. It does NOT correspond to an actual column, and values
|
||||
* set manually through invoking this function will not persist.
|
||||
*
|
||||
* @param lastActive
|
||||
* The date and time that this connection was last used, or null if this
|
||||
* connection has never been used.
|
||||
*/
|
||||
public void setLastActive(Date lastActive) {
|
||||
this.lastActive = lastActive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
|
||||
|
@@ -235,7 +235,7 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
|
||||
|
||||
@Override
|
||||
public Date getLastActive() {
|
||||
return null;
|
||||
return getModel().getLastActive();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user