Github user mike-jumper commented on a diff in the pull request:

    
https://github.com/apache/incubator-guacamole-client/pull/191#discussion_r140905330
  
    --- Diff: 
guacamole-ext/src/main/java/org/apache/guacamole/net/auth/ActivityRecordSet.java
 ---
    @@ -0,0 +1,128 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +
    +package org.apache.guacamole.net.auth;
    +
    +import java.util.Collection;
    +import org.apache.guacamole.GuacamoleException;
    +
    +/**
    + * 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.
    + *
    + * @param <RecordType>
    + *     The type of ActivityRecord contained within this set.
    + */
    +public interface ActivityRecordSet<RecordType extends ActivityRecord> {
    +
    +    /**
    +     * All properties of activity records which can be used as sorting
    +     * criteria.
    +     */
    +    enum SortableProperty {
    +
    +        /**
    +         * The date and time when the activity associated with the record
    +         * began.
    +         */
    +        START_DATE
    +
    +    };
    +
    +    /**
    +     * Returns all records within this set as a standard Collection.
    +     *
    +     * @return
    +     *      A collection containing all records within this set.
    +     *
    +     * @throws GuacamoleException
    +     *      If an error occurs while retrieving the records within this 
set.
    +     */
    +    Collection<RecordType> asCollection() throws 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
    --- End diff --
    
    Yep - since most of the `ActivityRecordSet` functions return a possibly-new 
`ActivityRecordSet` based off the original, it's likely that explicitly 
allowing these functions to mutate the original will simplify implementations, 
as well as free implementations to make use of optimizations that rely on 
shared state.
    
    The JDBC version actually does mutate the original:
    
    
https://github.com/apache/incubator-guacamole-client/blob/1c0ee41d0ecd5bc4a3550804b74b73b901e074c2/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/connection/ConnectionRecordSet.java#L77-L82



---

Reply via email to