GUACAMOLE-462: Add API-level support for associating data with history records.

This commit is contained in:
Michael Jumper
2021-12-01 22:52:22 -08:00
parent dc98633897
commit 9cbf4f045f
4 changed files with 82 additions and 9 deletions

View File

@@ -19,13 +19,16 @@
package org.apache.guacamole.net.auth;
import java.util.Collections;
import java.util.Date;
import java.util.Map;
import java.util.UUID;
/**
* A logging record describing when a user started and ended a particular
* activity.
*/
public interface ActivityRecord {
public interface ActivityRecord extends ReadableAttributes {
/**
* Returns the date and time the activity began.
@@ -75,4 +78,23 @@ public interface ActivityRecord {
*/
public boolean isActive();
/**
* Returns a UUID that uniquely identifies this record. If provided, this
* UUID MUST be deterministic and unique across all {@link ActivityRecord}
* objects within the same {@link ActivityRecordSet}, and SHOULD be unique
* across all {@link ActivityRecord} objects.
*
* @return
* A UUID that uniquely identifies this record, or null if no such
* unique identifier exists.
*/
public default UUID getUUID() {
return null;
}
@Override
public default Map<String, String> getAttributes() {
return Collections.emptyMap();
}
}

View File

@@ -19,6 +19,8 @@
package org.apache.guacamole.net.auth;
import java.util.UUID;
/**
* A logging record describing when a user started and ended usage of a
* particular connection.
@@ -70,4 +72,15 @@ public interface ConnectionRecord extends ActivityRecord {
*/
public String getSharingProfileName();
/**
* {@inheritDoc}
* <p>If implemented, this UUID SHOULD be identical to the UUID of the
* {@link GuacamoleTunnel} originally returned when the connection was
* established to allow extensions and/or the web application to
* automatically associate connection information with corresponding
* history records, such as log messages and session recordings.
*/
@Override
public UUID getUUID();
}