Package com.alibaba.citrus.service.mail.builder

Examples of com.alibaba.citrus.service.mail.builder.MailBuilder


        } catch (IllegalArgumentException e) {
            assertThat(e, exception("mail"));
        }

        // message
        MailBuilder attached = new MailBuilder();

        attached.setSubject("附件标题");
        attached.setContent(new TextContent("我爱北京敏感词", "text/plain"));

        Message mail = attached.getMessage(rawSession);

        content = new AttachmentContent(mail);
        builder.setContent(content);

        assert_Mail_我爱北京敏感词();
View Full Code Here


        } catch (MailBuilderException e) {
            assertThat(e, exception("Could not find mail \"attachedMail\": no MailService"));
        }

        // ref
        MailBuilder attached = new MailBuilder();
        attached.setSubject("附件标题");
        attached.setContent(new TextContent("我爱北京敏感词", "text/plain"));

        MailService service = createMock(MailService.class);
        expect(service.getMailBuilder("attachedMail")).andReturn(attached);
        expect(service.getMailBuilder("notExistMail")).andThrow(new MailNotFoundException());
        replay(service);
View Full Code Here

            if (mailService == null) {
                throw new MailBuilderException("Could not find mail \"" + mailRef + "\": no MailService");
            }

            MailBuilder mailBuilder;

            try {
                mailBuilder = mailService.getMailBuilder(mailRef);
            } catch (MailNotFoundException e) {
                throw new MailBuilderException("Could not find mail \"" + mailRef + "\"", e);
            }

            Message mail = mailBuilder.getMessage(getMailBuilder().getSession());

            render(mailPart, mail);
        }
View Full Code Here

        if (service == null) {
            throw new MailNotFoundException("Could not find mail \"" + mailId + "\": mail service is not set");
        }

        MailBuilder builder = service.getMailBuilder(mailId);

        send(builder, handler);
    }
View Full Code Here

    protected final <T> T getService(Class<T> serviceType, String defaultId, T defaultInstance) {
        if (defaultInstance != null) {
            return defaultInstance;
        }

        MailBuilder builder = getMailBuilder(false);

        if (builder != null) {
            MailService mailService = builder.getMailService();

            if (mailService != null) {
                return mailService.getService(serviceType, defaultId);
            }
        }
View Full Code Here

            this.mails.putAll(mails);

            // 设置mail id和mail service
            for (Map.Entry<String, MailBuilder> entry : mails.entrySet()) {
                String mailId = assertNotNull(trimToNull(entry.getKey()), "mail id");
                MailBuilder builder = assertNotNull(entry.getValue(), "mail builder");

                builder.setId(mailId);
                builder.setMailService(this);
            }
        }
    }
View Full Code Here

    /** 取得指定名称的mail builder。 */
    public MailBuilder getMailBuilder(String id) throws MailNotFoundException {
        id = assertNotNull(trimToNull(id), "no mail id");

        MailBuilder builder = mails.get(id);

        if (builder == null) {
            throw new MailNotFoundException("Could not find mail builder: " + id);
        }

        // 返回mail builder的复本
        return builder.clone();
    }
View Full Code Here

            this.mails.putAll(mails);

            // ����mail id��mail service
            for (Map.Entry<String, MailBuilder> entry : mails.entrySet()) {
                String mailId = assertNotNull(trimToNull(entry.getKey()), "mail id");
                MailBuilder builder = assertNotNull(entry.getValue(), "mail builder");

                builder.setId(mailId);
                builder.setMailService(this);
            }
        }
    }
View Full Code Here

     * ȡ��ָ�����Ƶ�mail builder��
     */
    public MailBuilder getMailBuilder(String id) throws MailNotFoundException {
        id = assertNotNull(trimToNull(id), "no mail id");

        MailBuilder builder = mails.get(id);

        if (builder == null) {
            throw new MailNotFoundException("Could not find mail builder: " + id);
        }

        // ����mail builder�ĸ���
        return builder.clone();
    }
View Full Code Here

        if (service == null) {
            throw new MailNotFoundException("Could not find mail \"" + mailId + "\": mail service is not set");
        }

        MailBuilder builder = service.getMailBuilder(mailId);

        send(builder, handler);
    }
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.mail.builder.MailBuilder

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.