Examples of HBaseMailbox


Examples of org.apache.james.mailbox.hbase.mail.model.HBaseMailbox

    @Test
    public void testHighestModSeq() throws Exception {
        LOG.info("highestModSeq");
        LOG.info("lastUid");
        MailboxPath path = new MailboxPath("gsoc", "ieugen", "Trash");
        HBaseMailbox newBox = new HBaseMailbox(path, 1234);
        mapper.save(newBox);
        mailboxList.add(newBox);
        pathsList.add(path);

        long result = modSeqProvider.highestModSeq(null, newBox);
View Full Code Here

Examples of org.apache.james.mailbox.hbase.mail.model.HBaseMailbox

     * Test of nextModSeq method, of class HBaseModSeqProvider.
     */
    @Test
    public void testNextModSeq() throws Exception {
        LOG.info("nextModSeq");
        final HBaseMailbox mailbox = mailboxList.get(mailboxList.size() / 2);
        final long lastUid = modSeqProvider.highestModSeq(null, mailbox);
        long result;
        for (int i = (int) lastUid + 1; i < (lastUid + 10); i++) {
            result = modSeqProvider.nextModSeq(null, mailbox);
            assertEquals(i, result);
View Full Code Here

Examples of org.apache.james.mailbox.hbase.mail.model.HBaseMailbox

     * Test of mailboxRowKey method, of class HBaseMailbox.
     */
    @Test
    public void testRowKey_All() {
        System.out.println("getRowKey and UUIDFromRowKey");
        final HBaseMailbox mailbox = new HBaseMailbox(new MailboxPath("gsoc", "ieugen", "INBOX"), 1234);
        UUID uuid = mailbox.getMailboxId();
        byte[] expResult = mailboxRowKey(uuid);
        byte[] result = mailboxRowKey(mailbox.getMailboxId());
        assertArrayEquals(expResult, result);

        UUID newUUID = UUIDFromRowKey(result);
        assertEquals(uuid, newUUID);

View Full Code Here

Examples of org.apache.james.mailbox.hbase.mail.model.HBaseMailbox

     * Test of metadataToPut method, of class HBaseMailbox.
     */
    @Test
    public void testMailboxToPut() {
        System.out.println("mailboxToPut");
        final HBaseMailbox instance = new HBaseMailbox(new MailboxPath("gsoc", "ieugen", "INBOX"), 1234);

        Put result = toPut(instance);
        assertArrayEquals(mailboxRowKey(instance.getMailboxId()), result.getRow());
        assertTrue(result.has(MAILBOX_CF, MAILBOX_USER, Bytes.toBytes(instance.getUser())));
        assertTrue(result.has(MAILBOX_CF, MAILBOX_NAME, Bytes.toBytes(instance.getName())));
        assertTrue(result.has(MAILBOX_CF, MAILBOX_NAMESPACE, Bytes.toBytes(instance.getNamespace())));
        assertTrue(result.has(MAILBOX_CF, MAILBOX_UIDVALIDITY, Bytes.toBytes(instance.getUidValidity())));
        assertTrue(result.has(MAILBOX_CF, MAILBOX_LASTUID, Bytes.toBytes(instance.getLastUid())));
        assertTrue(result.has(MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, Bytes.toBytes(instance.getHighestModSeq())));
        assertTrue(result.has(MAILBOX_CF, MAILBOX_MESSAGE_COUNT, Bytes.toBytes(0L)));
    }
View Full Code Here

Examples of org.apache.james.mailbox.hbase.mail.model.HBaseMailbox

        super(mapperFactory, authenticator, new JVMMailboxPathLocker(), aclResolver, groupMembershipResolver);
    }

    @Override
    protected Mailbox<UUID> doCreateMailbox(MailboxPath mailboxPath, MailboxSession session) throws MailboxException {
        return new HBaseMailbox(mailboxPath, randomUidValidity());
    }
View Full Code Here

Examples of org.apache.james.mailbox.hbase.mail.model.HBaseMailbox

        //TODO: should we test for null values?
        MailboxPath path = new MailboxPath(Bytes.toString(rawMailbox.get(MAILBOX_NAMESPACE)),
                Bytes.toString(rawMailbox.get(MAILBOX_USER)),
                Bytes.toString(rawMailbox.get(MAILBOX_NAME)));

        HBaseMailbox mailbox = new HBaseMailbox(path, Bytes.toLong(rawMailbox.get(MAILBOX_UIDVALIDITY)));
        mailbox.setMailboxId(UUIDFromRowKey(result.getRow()));
        mailbox.setHighestModSeq(Bytes.toLong(rawMailbox.get(MAILBOX_HIGHEST_MODSEQ)));
        mailbox.setLastUid(Bytes.toLong(rawMailbox.get(MAILBOX_LASTUID)));
        mailbox.setMessageCount(Bytes.toLong(rawMailbox.get(MAILBOX_MESSAGE_COUNT)));
        return mailbox;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.