001/*
002 * (C) Copyright 2014 Nuxeo SA (http://nuxeo.com/) and others.
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 *
016 * Contributors:
017 *     Benoit Delbosc
018 */
019
020package org.nuxeo.ecm.platform.query.api;
021
022import java.util.List;
023import java.util.Map;
024
025/**
026 * @since 6.0
027 */
028public interface AggregateDefinition {
029
030    String getId();
031
032    void setId(String id);
033
034    String getType();
035
036    void setType(String type);
037
038    void setProperty(String name, String value);
039
040    Map<String, String> getProperties();
041
042    List<AggregateRangeDefinition> getRanges();
043
044    void setRanges(List<AggregateRangeDefinition> ranges);
045
046    List<AggregateRangeDateDefinition> getDateRanges();
047
048    void setDateRanges(List<AggregateRangeDateDefinition> ranges);
049
050    /**
051     * Get the document aggregator field
052     */
053    String getDocumentField();
054
055    void setDocumentField(String parameter);
056
057    /**
058     * Get the ref of the search input, the type of the field must be nxs:stringList
059     */
060    PredicateFieldDefinition getSearchField();
061
062    void setSearchField(PredicateFieldDefinition field);
063
064    AggregateDefinition clone();
065
066    /**
067     * @return a map associating the key of the date range to its position in the definition.
068     */
069    Map<String, Integer> getAggregateDateRangeDefinitionOrderMap();
070
071    /**
072     * @return a map associating the key of the range to its position in the definition.
073     */
074    Map<String, Integer> getAggregateRangeDefinitionOrderMap();
075
076}