makes the files closer to the svn original so easier to track changes

This commit is contained in:
Timothy Prepscius 2013-09-01 23:45:17 -04:00
parent 30a7aca7ad
commit 1f6c3968aa
4 changed files with 152 additions and 179 deletions

View File

@ -66,16 +66,12 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.james</groupId> <groupId>org.apache.james</groupId>
<artifactId>apache-mailet</artifactId> <artifactId>apache-james-mailbox-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>${javax.mail.groupId}</groupId> <groupId>${javax.mail.groupId}</groupId>
<artifactId>${javax.mail.artifactId}</artifactId> <artifactId>${javax.mail.artifactId}</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-james-mailbox-api</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.apache.james</groupId> <groupId>org.apache.james</groupId>
<artifactId>apache-james-mailbox-store</artifactId> <artifactId>apache-james-mailbox-store</artifactId>

View File

@ -30,7 +30,6 @@ import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
import org.apache.james.mailbox.store.mail.MailboxMapper; import org.apache.james.mailbox.store.mail.MailboxMapper;
import org.apache.james.mailbox.store.mail.MessageMapper; import org.apache.james.mailbox.store.mail.MessageMapper;
import org.apache.james.mailbox.store.user.SubscriptionMapper; import org.apache.james.mailbox.store.user.SubscriptionMapper;
import org.apache.mailet.MailetContext;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -43,7 +42,6 @@ import java.net.InetSocketAddress;
public class InMemoryMailboxSessionMapperFactory extends MailboxSessionMapperFactory<Long> { public class InMemoryMailboxSessionMapperFactory extends MailboxSessionMapperFactory<Long> {
private MailetContext mailetContext;
private MailboxMapper<Long> mailboxMapper; private MailboxMapper<Long> mailboxMapper;
private MessageMapper<Long> messageMapper; private MessageMapper<Long> messageMapper;
private SubscriptionMapper subscriptionMapper; private SubscriptionMapper subscriptionMapper;
@ -59,8 +57,8 @@ public class InMemoryMailboxSessionMapperFactory extends MailboxSessionMapperFac
proxySelector.install(); proxySelector.install();
log.info("Finished Installing proxy"); log.info("Finished Installing proxy");
mailboxMapper = new InMemoryMailboxMapper(mailetContext); mailboxMapper = new InMemoryMailboxMapper();
messageMapper = new InMemoryMessageMapper(mailetContext, null, new InMemoryUidProvider(), new InMemoryModSeqProvider()); messageMapper = new InMemoryMessageMapper(null, new InMemoryUidProvider(), new InMemoryModSeqProvider());
subscriptionMapper = new InMemorySubscriptionMapper(); subscriptionMapper = new InMemorySubscriptionMapper();
} }

View File

@ -30,15 +30,10 @@ import org.apache.james.mailbox.model.MailboxPath;
import org.apache.james.mailbox.store.mail.MailboxMapper; import org.apache.james.mailbox.store.mail.MailboxMapper;
import org.apache.james.mailbox.store.mail.model.Mailbox; import org.apache.james.mailbox.store.mail.model.Mailbox;
import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox; import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
import org.apache.mailet.MailetContext;
public class InMemoryMailboxMapper implements MailboxMapper<Long> { public class InMemoryMailboxMapper implements MailboxMapper<Long> {
MailetContext mailetContext; public InMemoryMailboxMapper() {
public InMemoryMailboxMapper(MailetContext mailetContext)
{
this.mailetContext = mailetContext;
} }
/** /**

View File

@ -44,7 +44,6 @@ import org.apache.james.mailbox.store.mail.UidProvider;
import org.apache.james.mailbox.store.mail.model.Mailbox; import org.apache.james.mailbox.store.mail.model.Mailbox;
import org.apache.james.mailbox.store.mail.model.Message; import org.apache.james.mailbox.store.mail.model.Message;
import org.apache.james.mailbox.store.mail.model.impl.SimpleMessage; import org.apache.james.mailbox.store.mail.model.impl.SimpleMessage;
import org.apache.mailet.MailetContext;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -57,39 +56,27 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<Long>
{ {
private static final int INITIAL_SIZE = 8; private static final int INITIAL_SIZE = 8;
Logger log = LoggerFactory.getLogger(InMemoryMessageMapper.class); Logger log = LoggerFactory.getLogger(InMemoryMessageMapper.class);
MailetContext mailetContext;
public InMemoryMessageMapper( public InMemoryMessageMapper(MailboxSession session, UidProvider<Long> uidProvider,
MailetContext mailetContext, ModSeqProvider<Long> modSeqProvider) {
MailboxSession session, UidProvider<Long> uidProvider,
ModSeqProvider<Long> modSeqProvider
)
{
super(session, uidProvider, modSeqProvider); super(session, uidProvider, modSeqProvider);
this.mailetContext = mailetContext;
} }
private Map<Long, Message<Long>> getMembershipByUidForMailbox( private Map<Long, Message<Long>> getMembershipByUidForMailbox(Mailbox<Long> mailbox) {
Mailbox<Long> mailbox)
{
return new ConcurrentHashMap<Long, Message<Long>>(INITIAL_SIZE); return new ConcurrentHashMap<Long, Message<Long>>(INITIAL_SIZE);
} }
/** /**
* @see org.apache.james.mailbox.store.mail.MessageMapper#countMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox) * @see org.apache.james.mailbox.store.mail.MessageMapper#countMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
*/ */
public long countMessagesInMailbox(Mailbox<Long> mailbox) public long countMessagesInMailbox(Mailbox<Long> mailbox) throws MailboxException {
throws MailboxException
{
throw new MailboxException("not supported"); throw new MailboxException("not supported");
} }
/** /**
* @see org.apache.james.mailbox.store.mail.MessageMapper#countUnseenMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox) * @see org.apache.james.mailbox.store.mail.MessageMapper#countUnseenMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
*/ */
public long countUnseenMessagesInMailbox(Mailbox<Long> mailbox) public long countUnseenMessagesInMailbox(Mailbox<Long> mailbox) throws MailboxException {
throws MailboxException
{
throw new MailboxException("not supported"); throw new MailboxException("not supported");
} }
@ -97,9 +84,7 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<Long>
* @see org.apache.james.mailbox.store.mail.MessageMapper#delete(org.apache.james.mailbox.store.mail.model.Mailbox, * @see org.apache.james.mailbox.store.mail.MessageMapper#delete(org.apache.james.mailbox.store.mail.model.Mailbox,
* org.apache.james.mailbox.store.mail.model.Message) * org.apache.james.mailbox.store.mail.model.Message)
*/ */
public void delete(Mailbox<Long> mailbox, Message<Long> message) public void delete(Mailbox<Long> mailbox, Message<Long> message) throws MailboxException {
throws MailboxException
{
throw new MailboxException("not supported"); throw new MailboxException("not supported");
} }
@ -108,8 +93,8 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<Long>
* org.apache.james.mailbox.model.MessageRange, * org.apache.james.mailbox.model.MessageRange,
* org.apache.james.mailbox.store.mail.MessageMapper.FetchType, int) * org.apache.james.mailbox.store.mail.MessageMapper.FetchType, int)
*/ */
public Iterator<Message<Long>> findInMailbox(Mailbox<Long> mailbox, public Iterator<Message<Long>> findInMailbox(Mailbox<Long> mailbox, MessageRange set, FetchType ftype, int max)
MessageRange set, FetchType ftype, int max) throws MailboxException throws MailboxException
{ {
throw new MailboxException("not supported"); throw new MailboxException("not supported");
} }
@ -117,39 +102,44 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<Long>
/** /**
* @see org.apache.james.mailbox.store.mail.MessageMapper#findRecentMessageUidsInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox) * @see org.apache.james.mailbox.store.mail.MessageMapper#findRecentMessageUidsInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
*/ */
public List<Long> findRecentMessageUidsInMailbox(Mailbox<Long> mailbox) public List<Long> findRecentMessageUidsInMailbox(Mailbox<Long> mailbox) throws MailboxException {
throws MailboxException
{
throw new MailboxException("not supported"); throw new MailboxException("not supported");
} }
/** /**
* @see org.apache.james.mailbox.store.mail.MessageMapper#findFirstUnseenMessageUid(org.apache.james.mailbox.store.mail.model.Mailbox) * @see org.apache.james.mailbox.store.mail.MessageMapper#findFirstUnseenMessageUid(org.apache.james.mailbox.store.mail.model.Mailbox)
*/ */
public Long findFirstUnseenMessageUid(Mailbox<Long> mailbox) public Long findFirstUnseenMessageUid(Mailbox<Long> mailbox) throws MailboxException {
throws MailboxException
{
throw new MailboxException("not supported"); throw new MailboxException("not supported");
} }
public void deleteAll() public void deleteAll() {
{
} }
/** /**
* Do nothing * Do nothing
*/ */
public void endRequest() public void endRequest() {
{
// Do nothing // Do nothing
} }
/**
* (non-Javadoc)
*
* @see org.apache.james.mailbox.store.mail.MessageMapper#move(org.apache.james.mailbox.store.mail.model.Mailbox,
* org.apache.james.mailbox.store.mail.model.Message)
*/
@Override
public MessageMetaData move(Mailbox<Long> mailbox, Message<Long> original) throws MailboxException {
throw new UnsupportedOperationException("Not implemented - see https://issues.apache.org/jira/browse/IMAP-370");
}
/** /**
* @see org.apache.james.mailbox.store.mail.AbstractMessageMapper#copy(org.apache.james.mailbox.store.mail.model.Mailbox, * @see org.apache.james.mailbox.store.mail.AbstractMessageMapper#copy(org.apache.james.mailbox.store.mail.model.Mailbox,
* long, long, org.apache.james.mailbox.store.mail.model.Message) * long, long, org.apache.james.mailbox.store.mail.model.Message)
*/ */
protected MessageMetaData copy(Mailbox<Long> mailbox, long uid, protected MessageMetaData copy(Mailbox<Long> mailbox, long uid, long modSeq, Message<Long> original)
long modSeq, Message<Long> original) throws MailboxException throws MailboxException
{ {
throw new MailboxException("not supported"); throw new MailboxException("not supported");
} }
@ -158,9 +148,7 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<Long>
* @see org.apache.james.mailbox.store.mail.AbstractMessageMapper#save(org.apache.james.mailbox.store.mail.model.Mailbox, * @see org.apache.james.mailbox.store.mail.AbstractMessageMapper#save(org.apache.james.mailbox.store.mail.model.Mailbox,
* org.apache.james.mailbox.store.mail.model.Message) * org.apache.james.mailbox.store.mail.model.Message)
*/ */
protected MessageMetaData save(Mailbox<Long> mailbox, Message<Long> message) protected MessageMetaData save(Mailbox<Long> mailbox, Message<Long> message) throws MailboxException {
throws MailboxException
{
// if (new Random().nextInt() % 3 == 0) // if (new Random().nextInt() % 3 == 0)
// throw new MailboxException("Artificially simulating save failure"); // throw new MailboxException("Artificially simulating save failure");
@ -212,29 +200,25 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<Long>
/** /**
* Do nothing * Do nothing
*/ */
protected void begin() throws MailboxException protected void begin() throws MailboxException {
{
} }
/** /**
* Do nothing * Do nothing
*/ */
protected void commit() throws MailboxException protected void commit() throws MailboxException {
{
} }
/** /**
* Do nothing * Do nothing
*/ */
protected void rollback() throws MailboxException protected void rollback() throws MailboxException {
{
} }
@Override @Override
public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox( public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(
final Mailbox<Long> mailbox, MessageRange set) final Mailbox<Long> mailbox, MessageRange set)
throws MailboxException throws MailboxException {
{
throw new MailboxException("not supported"); throw new MailboxException("not supported");
} }
} }