001/*
002 *  Copyright 2012 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.plugins.newsletter.auto;
017
018import java.util.Collection;
019import java.util.Map;
020
021import org.ametys.runtime.i18n.I18nizableText;
022
023/**
024 * Interface defining an automatic newsletter service.
025 */
026public interface AutomaticNewsletter
027{
028    
029    /**
030     * The frequency type.
031     */
032    public enum FrequencyType
033    {
034        /** Week frequency. */
035        WEEK,
036        /** Month frequency. */
037        MONTH
038    }
039    
040    /**
041     * Get the automatic newsletter label.
042     * @return the automatic newsletter label.
043     */
044    public I18nizableText getLabel();
045    
046    /**
047     * Get the automatic newsletter description.
048     * @return the automatic newsletter description.
049     */
050    public I18nizableText getDescription();
051    
052    /**
053     * Get the automatic newsletter title.
054     * @return the automatic newsletter title.
055     */
056    public I18nizableText getNewsletterTitle();
057    
058    /**
059     * Get the automatic newsletter frequency type.
060     * @return the automatic newsletter frequency type.
061     */
062    public FrequencyType getFrequencyType();
063    
064    /**
065     * Get the automatic newsletter frequency identifiers.
066     * @return the automatic newsletter frequency identifiers.
067     */
068    public Collection<Integer> getDayNumbers();
069    
070    /**
071     * Get the filters which this automatic newsletter bases on.
072     * @return a Map of filter name -&gt; filter ID.
073     */
074    public Map<String, String> getFilters();
075    
076}