james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r773232 - in /james/imap/trunk: store/src/main/java/org/apache/james/imap/store/MailboxMetaData.java torque/src/main/java/org/apache/james/mailboxmanager/torque/MailboxMetaData.java
Date Sat, 09 May 2009 15:18:17 GMT
Author: rdonkin
Date: Sat May  9 15:18:16 2009
New Revision: 773232

URL: http://svn.apache.org/viewvc?rev=773232&view=rev
Log:
Start to consolidate calls into a single MetaData for the Mailbox. IMAP-79 https://issues.apache.org/jira/browse/IMAP-79

Added:
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MailboxMetaData.java
  (with props)
    james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/MailboxMetaData.java
  (with props)

Added: james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MailboxMetaData.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MailboxMetaData.java?rev=773232&view=auto
==============================================================================
--- james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MailboxMetaData.java
(added)
+++ james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MailboxMetaData.java
Sat May  9 15:18:16 2009
@@ -0,0 +1,77 @@
+/****************************************************************
+ * 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.                                           *
+ ****************************************************************/
+
+package org.apache.james.imap.store;
+
+import javax.mail.Flags;
+
+import org.apache.james.imap.mailbox.Mailbox;
+
+/**
+ * Describes the current state of a mailbox.
+ */
+public class MailboxMetaData implements Mailbox.MetaData {
+
+    private final int recentCount;
+    private final long[] recent;
+    private final Flags premanentFlags;
+    private final long uidValidity;
+    
+    
+    public MailboxMetaData(final long[] recent, final Flags premanentFlags, final long uidValidity)
{
+        super();
+        if (recent == null) {
+            recentCount = 0;
+        } else {
+            recentCount = recent.length;
+        }
+        this.recent = recent;
+        this.premanentFlags = premanentFlags;
+        this.uidValidity = uidValidity;
+    }
+
+    /**
+     * @see {@link Mailbox.MetaData#countRecent()()}
+     */
+    public int countRecent() {
+        return recentCount;
+    }
+
+    /**
+     * @see {@link Mailbox.MetaData#getPermanentFlags()()}
+     */
+    public Flags getPermanentFlags() {
+        return premanentFlags;
+    }
+
+    /**
+     * @see {@link Mailbox.MetaData#getRecent()}
+     */
+    public long[] getRecent() {
+        return recent;
+    }
+
+    /**
+     * @see {@link Mailbox.MetaData#getUidValidity()}
+     */
+    public long getUidValidity() {
+        return uidValidity;
+    }
+
+}

Propchange: james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MailboxMetaData.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/MailboxMetaData.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/MailboxMetaData.java?rev=773232&view=auto
==============================================================================
--- james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/MailboxMetaData.java
(added)
+++ james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/MailboxMetaData.java
Sat May  9 15:18:16 2009
@@ -0,0 +1,77 @@
+/****************************************************************
+ * 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.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailboxmanager.torque;
+
+import javax.mail.Flags;
+
+import org.apache.james.imap.mailbox.Mailbox;
+
+/**
+ * Describes the current state of a mailbox.
+ */
+public class MailboxMetaData implements Mailbox.MetaData {
+
+    private final int recentCount;
+    private final long[] recent;
+    private final Flags premanentFlags;
+    private final long uidValidity;
+    
+    
+    public MailboxMetaData(final long[] recent, final Flags premanentFlags, final long uidValidity)
{
+        super();
+        if (recent == null) {
+            recentCount = 0;
+        } else {
+            recentCount = recent.length;
+        }
+        this.recent = recent;
+        this.premanentFlags = premanentFlags;
+        this.uidValidity = uidValidity;
+    }
+
+    /**
+     * @see {@link Mailbox.MetaData#countRecent()()}
+     */
+    public int countRecent() {
+        return recentCount;
+    }
+
+    /**
+     * @see {@link Mailbox.MetaData#getPermanentFlags()()}
+     */
+    public Flags getPermanentFlags() {
+        return premanentFlags;
+    }
+
+    /**
+     * @see {@link Mailbox.MetaData#getRecent()}
+     */
+    public long[] getRecent() {
+        return recent;
+    }
+
+    /**
+     * @see {@link Mailbox.MetaData#getUidValidity()}
+     */
+    public long getUidValidity() {
+        return uidValidity;
+    }
+
+}

Propchange: james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/MailboxMetaData.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message