Package org.apache.guacamole.net.auth
Interface ActivityRecordSet<RecordType extends ActivityRecord>
-
- Type Parameters:
RecordType
- The type of ActivityRecord contained within this set.
- All Known Subinterfaces:
ConnectionRecordSet
- All Known Implementing Classes:
DecoratingActivityRecordSet
,DelegatingActivityRecordSet
,SimpleActivityRecordSet
,SimpleConnectionRecordSet
public interface ActivityRecordSet<RecordType extends ActivityRecord>
A set of all available records related to a type of activity which has a defined start and end time, such as a user being logged in or connected, or a subset of those records.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ActivityRecordSet.SortableProperty
All properties of activity records which can be used as sorting criteria.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Collection<RecordType>
asCollection()
Returns all records within this set as a standard Collection.ActivityRecordSet<RecordType>
contains(String value)
Returns the subset of records which contain the given value.default RecordType
get(String identifier)
Returns the record having the given unique identifier, if records within this set have unique identifiers.ActivityRecordSet<RecordType>
limit(int limit)
Returns the subset of records containing only the firstlimit
records.ActivityRecordSet<RecordType>
sort(ActivityRecordSet.SortableProperty property, boolean desc)
Returns a ActivityRecordSet containing identically the records within this set, sorted according to the specified criteria.
-
-
-
Method Detail
-
asCollection
Collection<RecordType> asCollection() throws org.apache.guacamole.GuacamoleException
Returns all records within this set as a standard Collection.- Returns:
- A collection containing all records within this set.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while retrieving the records within this set.
-
get
default RecordType get(String identifier) throws org.apache.guacamole.GuacamoleException
Returns the record having the given unique identifier, if records within this set have unique identifiers. If records within this set do not have defined unique identifiers, this function has no effect.- Parameters:
identifier
- The unique identifier of the record to retrieve.- Returns:
- The record having the given unique identifier, or null if there is no such record.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while retrieving the record.
-
contains
ActivityRecordSet<RecordType> contains(String value) throws org.apache.guacamole.GuacamoleException
Returns the subset of records which contain the given value. The properties and semantics involved with determining whether a particular record "contains" the given value is implementation dependent. This function may affect the contents of the current ActivityRecordSet. The contents of the current ActivityRecordSet should NOT be relied upon after this function is called.- Parameters:
value
- The value which all records within the resulting subset should contain.- Returns:
- The subset of records which contain the specified value.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while restricting the current subset.
-
limit
ActivityRecordSet<RecordType> limit(int limit) throws org.apache.guacamole.GuacamoleException
Returns the subset of records containing only the firstlimit
records. If the subset has fewer thanlimit
records, then this function has no effect. This function may also affect the contents of the current ActivityRecordSet. The contents of the current ActivityRecordSet should NOT be relied upon after this function is called.- Parameters:
limit
- The maximum number of records that the new subset should contain.- Returns:
- The subset of records that containing only the first
limit
records. - Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while limiting the current subset.
-
sort
ActivityRecordSet<RecordType> sort(ActivityRecordSet.SortableProperty property, boolean desc) throws org.apache.guacamole.GuacamoleException
Returns a ActivityRecordSet containing identically the records within this set, sorted according to the specified criteria. The sort operation performed is guaranteed to be stable with respect to any past call to sort(). This function may also affect the contents of the current ActivityRecordSet. The contents of the current ActivityRecordSet should NOT be relied upon after this function is called.- Parameters:
property
- The property by which the records within the resulting set should be sorted.desc
- Whether the records should be sorted according to the specified property in descending order. If false, records will be sorted according to the specified property in ascending order.- Returns:
- The ActivityRecordSet, sorted according to the specified criteria.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while sorting the current subset, or if the given property is not supported by the implementation.
-
-