GUAC-1132: Modify API to support listing of active connections and host information.

This commit is contained in:
Michael Jumper
2015-03-16 14:26:56 -07:00
parent 093a5a0dd9
commit 3603155f36
8 changed files with 108 additions and 4 deletions

View File

@@ -43,6 +43,11 @@ public class APIConnectionRecord {
*/
private final Date endDate;
/**
* The host from which the connection originated, if known.
*/
private final String remoteHost;
/**
* The name of the user who used or is using the connection.
*/
@@ -61,10 +66,11 @@ public class APIConnectionRecord {
* The record to copy data from.
*/
public APIConnectionRecord(ConnectionRecord record) {
this.startDate = record.getStartDate();
this.endDate = record.getEndDate();
this.username = record.getUsername();
this.active = record.isActive();
this.startDate = record.getStartDate();
this.endDate = record.getEndDate();
this.remoteHost = record.getRemoteHost();
this.username = record.getUsername();
this.active = record.isActive();
}
/**
@@ -88,6 +94,16 @@ public class APIConnectionRecord {
return endDate;
}
/**
* Returns the remote host from which this connection originated.
*
* @return
* The remote host from which this connection originated.
*/
public String getRemoteHost() {
return remoteHost;
}
/**
* Returns the name of the user who used or is using the connection at the
* times given by this connection record.

View File

@@ -60,6 +60,13 @@ angular.module('rest').factory('ConnectionHistoryEntry', [function defineConnect
*/
this.endDate = template.endDate;
/**
* The remote host that initiated this connection, if known.
*
* @type String
*/
this.remoteHost = template.remoteHost;
/**
* The username of the user associated with this particular usage of
* the connection.