Package mireka.pop.store

Examples of mireka.pop.store.Maildrop$Message


    private MaildropRepository maildropRepository;
    private String maildropName;

    @Override
    public void data(Mail mail) throws RejectExceptionExt {
        Maildrop maildrop = maildropRepository.borrowMaildrop(maildropName);
        try {

            MaildropAppender appender;
            try {
                appender = maildrop.allocateAppender();
            } catch (LocalMailSystemException e) {
                logger.error("Cannot accept mail because of a "
                        + "maildrop failure", e);
                throw new RejectExceptionExt(e.errorStatus());
            }
View Full Code Here


                + user.getUsername());
    }

    private void importMail(String maildropName, Message message)
            throws LocalMailSystemException, IOException, MessagingException {
        Maildrop maildrop = maildropRepository.borrowMaildrop(maildropName);
        try {
            MaildropAppender appender = maildrop.allocateAppender();
            try {
                OutputStream outputStream = appender.getOutputStream();
                message.writeTo(outputStream);
                appender.commit();
            } catch (IOException e) {
View Full Code Here

    protected void startTransaction(Principal userPrincipal)
            throws MaildropPopException, IOException {
        String maildropName =
                session.getServer().getPrincipalMaildropTable()
                        .lookupMaildropName(userPrincipal);
        Maildrop maildrop =
                session.getServer().getMaildropRepository()
                        .borrowMaildrop(maildropName);
        try {
            maildrop.beginTransaction();
        } catch (MaildropLockedException e) {
            session.setSessionState(AUTHORIZATION);
            session.getServer().getMaildropRepository()
                    .releaseMaildrop(maildrop);
            session.getThread().sendResponse(e.toResponse());
View Full Code Here

                    "This encoder can decode only Netty Messages.");
        }

        for (;;) {
            ByteBuffer buf = ByteBuffer.allocate(8192);
            Message m = (Message) message;
            try {
                if (m.write(buf.buf())) {
                    break;
                }
            } finally {
                buf.flip();
                if (buf.hasRemaining()) {
View Full Code Here

    public void decode(IoSession session, ByteBuffer in,
            ProtocolDecoderOutput out) throws Exception {
        put(in);

        Message m = readingMessage;
        try {
            for (;;) {
                readBuf.flip();
                if (m == null) {
                    int limit = readBuf.limit();
                    boolean failed = true;
                    try {
                        m = recognizer.recognize(readBuf);
                        failed = false;
                    } finally {
                        if (failed) {
                            // clear the read buffer if failed to recognize
                            readBuf.clear();
                            break;
                        } else {
                            if (m == null) {
                                readBuf.limit(readBuf.capacity());
                                readBuf.position(limit);
                                break; // finish decoding
                            } else {
                                // reset buffer for read
                                readBuf.limit(limit);
                                readBuf.position(0);
                            }
                        }
                    }
                }

                if (m != null) {
                    try {
                        if (m.read(readBuf)) {
                            out.write(m);
                            m = null;
                        } else {
                            break;
                        }
View Full Code Here

        }

        for( ;; )
        {
            ByteBuffer buf = ByteBuffer.allocate( 8192 );
            Message m = ( Message ) message;
            try
            {
                if( m.write( buf.buf() ) )
                {
                    break;
                }
            }
            finally
View Full Code Here

    public void decode( IoSession session, ByteBuffer in, ProtocolDecoderOutput out ) throws Exception
    {
        put( in );

        Message m = readingMessage;
        try
        {
            for( ;; )
            {
                readBuf.flip();
                if( m == null )
                {
                    int limit = readBuf.limit();
                    boolean failed = true;
                    try
                    {
                        m = recognizer.recognize( readBuf );
                        failed = false;
                    }
                    finally
                    {
                        if( failed )
                        {
                            // clear the read buffer if failed to recognize
                            readBuf.clear();
                            break;
                        }
                        else
                        {
                            if( m == null )
                            {
                                readBuf.limit( readBuf.capacity() );
                                readBuf.position( limit );
                                break; // finish decoding
                            }
                            else
                            {
                                // reset buffer for read
                                readBuf.limit( limit );
                                readBuf.position( 0 );
                            }
                        }
                    }
                }

                if( m != null )
                {
                    try
                    {
                        if( m.read( readBuf ) )
                        {
                            out.write( m );
                            m = null;
                        } else {
                            break;
View Full Code Here

        }

        for( ;; )
        {
            ByteBuffer buf = ByteBuffer.allocate( 8192 );
            Message m = ( Message ) message;
            try
            {
                if( m.write( buf.buf() ) )
                {
                    break;
                }
            }
            finally
View Full Code Here

    public void decode( IoSession session, ByteBuffer in, ProtocolDecoderOutput out ) throws Exception
    {
        put( in );

        Message m = readingMessage;
        try
        {
            for( ;; )
            {
                readBuf.flip();
                if( m == null )
                {
                    int limit = readBuf.limit();
                    boolean failed = true;
                    try
                    {
                        m = recognizer.recognize( readBuf );
                        failed = false;
                    }
                    finally
                    {
                        if( failed )
                        {
                            // clear the read buffer if failed to recognize
                            readBuf.clear();
                            break;
                        }
                        else
                        {
                            if( m == null )
                            {
                                readBuf.limit( readBuf.capacity() );
                                readBuf.position( limit );
                                break; // finish decoding
                            }
                            else
                            {
                                // reset buffer for read
                                readBuf.limit( limit );
                                readBuf.position( 0 );
                            }
                        }
                    }
                }

                if( m != null )
                {
                    try
                    {
                        if( m.read( readBuf ) )
                        {
                            out.write( m );
                            m = null;
                        } else {
                            break;
View Full Code Here

                    "This encoder can decode only Netty Messages.");
        }

        for (;;) {
            IoBuffer buf = IoBuffer.allocate(8192);
            Message m = (Message) message;
            try {
                if (m.write(buf.buf())) {
                    break;
                }
            } finally {
                buf.flip();
                if (buf.hasRemaining()) {
View Full Code Here

TOP

Related Classes of mireka.pop.store.Maildrop$Message

Copyright © 2018 www.massapicom. 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.