1 /**************************************************************** 2 * Licensed to the Apache Software Foundation (ASF) under one * 3 * or more contributor license agreements. See the NOTICE file * 4 * distributed with this work for additional information * 5 * regarding copyright ownership. The ASF licenses this file * 6 * to you under the Apache License, Version 2.0 (the * 7 * "License"); you may not use this file except in compliance * 8 * with the License. You may obtain a copy of the License at * 9 * * 10 * http://www.apache.org/licenses/LICENSE-2.0 * 11 * * 12 * Unless required by applicable law or agreed to in writing, * 13 * software distributed under the License is distributed on an * 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * 15 * KIND, either express or implied. See the License for the * 16 * specific language governing permissions and limitations * 17 * under the License. * 18 ****************************************************************/ 19 20 package org.apache.jsieve.mail.optional; 21 22 import java.util.List; 23 24 import org.apache.jsieve.mail.SieveMailException; 25 26 /** 27 * Interface EnvelopeAccessors specifies the method signatures required to 28 * support the Envelope Test. 29 */ 30 public interface EnvelopeAccessors { 31 /** 32 * Method getEnvelope answers a List of all of the envelope values in the 33 * receiver whose name is equal to the passed name. If no values are found 34 * an empty List is returned. 35 * 36 * @param name 37 * @return List 38 * @throws SieveMailException 39 */ 40 public List<String> getEnvelope(String name) throws SieveMailException; 41 42 /** 43 * Method getEnvelopeNames answers a List of the names of the envelope 44 * values in the receiver. No duplicates are allowed. 45 * 46 * @return List 47 * @throws SieveMailException 48 */ 49 public List<String> getEnvelopeNames() throws SieveMailException; 50 51 /** 52 * <p> 53 * Method getMatchingEnvelope answers a List of all of the envelope values 54 * in the receiver with the passed name. If no matching names are found an 55 * empty List is returned. 56 * </p> 57 * 58 * <p> 59 * This method differs from getEnvelope(String) in that it ignores case and 60 * the whitespace prefixes and suffixes of an envelope value name when 61 * performing the match, as required by RFC 3028. Thus "From", "from ", " 62 * From" and " from " are considered equal. 63 * </p> 64 * 65 * @param name 66 * @return List 67 * @throws SieveMailException 68 */ 69 public List<String> getMatchingEnvelope(String name) throws SieveMailException; 70 71 }