001/*
002 *  Copyright 2016 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.odf.oai;
017
018import org.ametys.odf.program.Program;
019import org.ametys.plugins.repository.AmetysObjectIterable;
020import org.ametys.plugins.repository.query.SortCriteria;
021import org.ametys.plugins.repository.query.expression.Expression;
022import org.ametys.runtime.i18n.I18nizableText;
023
024/**
025 * Interface for OAI-PMH Sets
026 */
027public interface OaiSet
028{
029    /** Avalon Role */
030    public static final String ROLE = OaiSet.class.getName();
031    
032    /**
033     * Return the name of the set
034     * @return The name of the set. Can't be null.
035     */
036    public I18nizableText getName();
037    
038    /**
039     * Return the description of the set
040     * @return The description of the set, or null if there is no description.
041     */
042    public I18nizableText getDescription();
043    
044    /**
045     * Retrieve the list of Records associated with this OAI Set
046     * @param expression An Expression to filter the list of records during the request
047     * @param sortCriteria A sort criteria to sort the result
048     * @return The list of Records
049     */
050    public AmetysObjectIterable<Program> getRecords(Expression expression, SortCriteria sortCriteria);
051}