FileDocCategorySizeDatePackage
MockMailRepository.javaAPI DocApache James 2.3.12838Fri Jan 12 12:56:36 GMT 2007org.apache.james.test.mock.james

MockMailRepository

public class MockMailRepository extends Object implements org.apache.james.services.MailRepository
Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. *

Fields Summary
private HashMap
messages
Constructors Summary
Methods Summary
public java.util.Iteratorlist()

        return messages.keySet().iterator();  // trivial implementation
    
public booleanlock(java.lang.String key)

        return false;  // trivial implementation
    
public voidremove(org.apache.mailet.Mail mail)

        messages.remove(mail.getName());
    
public voidremove(java.util.Collection mails)

        for (Iterator i = mails.iterator(); i.hasNext(); ) {
            Mail m = (Mail) i.next();
            messages.remove(m.getName());
        }
    
public voidremove(java.lang.String key)

        messages.remove(key);
    
public org.apache.mailet.Mailretrieve(java.lang.String key)

        Mail m2 = new MailImpl((Mail) messages.get(key),key);
        m2.setState(((Mail) messages.get(key)).getState());
        return m2;  // trivial implementation
    
public voidstore(org.apache.mailet.Mail mc)


          
        MailImpl m = new MailImpl(mc,mc.getName());
        m.setState(mc.getState());
        this.messages.put(mc.getName(),m);
    
public booleanunlock(java.lang.String key)

        return false;  // trivial implementation