1 /* 2 * Copyright (c) 2002-2021, City of Paris 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright notice 10 * and the following disclaimer. 11 * 12 * 2. Redistributions in binary form must reproduce the above copyright notice 13 * and the following disclaimer in the documentation and/or other materials 14 * provided with the distribution. 15 * 16 * 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its 17 * contributors may be used to endorse or promote products derived from 18 * this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * POSSIBILITY OF SUCH DAMAGE. 31 * 32 * License 1.0 33 */ 34 package fr.paris.lutece.plugins.campaign.service; 35 36 import java.sql.Timestamp; 37 38 import fr.paris.lutece.plugins.campaign.business.Campaign; 39 import fr.paris.lutece.util.ReferenceList; 40 41 /** 42 * 43 */ 44 public interface ICampaignService 45 { 46 47 // Returns the campain the code of which is the SQL 'max'. 48 // Ex : if 6 campagne with 'B0' - 'C' - 'D' - 'G0' - 'GA' - 'G', returns campagne 'GA'. 49 50 /** 51 * @param campagne 52 * Data 53 * @param phase 54 * Data 55 * @return Data 56 */ 57 public boolean isDuring( String campagne, String phase ); // PHASE_BEGINNING < current < PHASE_END 58 59 /** 60 * @param phase 61 * Data 62 * @return Data 63 */ 64 public boolean isDuring( String phase ); 65 66 /** 67 * @return Data 68 */ 69 public Campaign getLastCampaign( ); 70 71 /** 72 * @param campagne 73 * Data 74 * @param phase 75 * Data 76 * @return Data 77 */ 78 public boolean isBeforeEnd( String campagne, String phase ); // ..................................current < PHASE_END 79 80 /** 81 * @param phase 82 * Data 83 * @return Data 84 */ 85 public boolean isBeforeEnd( String phase ); 86 87 /** 88 * @param campagne 89 * Data 90 * @param phase 91 * Data 92 * @return Data 93 */ 94 public boolean isAfterBeginning( String campagne, String phase ); // PHASE_BEGINNING < current............................ 95 96 /** 97 * @param phase 98 * Data 99 * @return Data 100 */ 101 public boolean isAfterBeginning( String phase ); 102 103 /** 104 * @param campagne 105 * Data 106 * @param phase 107 * Data 108 * @return Data 109 */ 110 public boolean isBeforeBeginning( String campagne, String phase ); // ......current < PHASE_BEGINNING 111 112 /** 113 * @param phase 114 * Data 115 * @return Data 116 */ 117 public boolean isBeforeBeginning( String phase ); 118 119 /** 120 * @param campagne 121 * Data 122 * @param phase 123 * Data 124 * @return Data 125 */ 126 public boolean isAfterEnd( String campagne, String phase ); // PHASE_END < current...... 127 128 /** 129 * @param phase 130 * Data 131 * @return Data 132 */ 133 public boolean isAfterEnd( String phase ); 134 135 /** 136 * 137 */ 138 // Resets the internal cache of phases 139 public void reset( ); 140 141 /** 142 * Load the data of all the campaign objects and returns them as a referenceList 143 * 144 * @return the referenceList which contains the data of all the campaign objects 145 */ 146 public ReferenceList getCampaignsReferenceList( ); 147 148 }