Package org.jnode.nntp.model

Examples of org.jnode.nntp.model.NewsMessage


            }
        });
    }

    private NewsMessage convert(Echomail echomail) {
        NewsMessage newsMessage = new NewsMessage();

        newsMessage.setId(echomail.getId());
        newsMessage.setPath(echomail.getPath());
        newsMessage.setGroupName(echomail.getArea().getName());
        newsMessage.setFrom(echomail.getFromName() + " " + echomail.getFromFTN());
        newsMessage.setSubject(echomail.getSubject());
        newsMessage.setCreatedDate(echomail.getDate());
        newsMessage.setBody(echomail.getText());
        newsMessage.setMessageId(echomail.getMsgid());

        return newsMessage;
    }
View Full Code Here


            });
        }
    }

    private NewsMessage convert(Netmail netmail) {
        NewsMessage newsMessage = new NewsMessage();

        newsMessage.setId(netmail.getId());
        newsMessage.setGroupName(Constants.NETMAIL_NEWSGROUP_NAME);
        newsMessage.setFrom(netmail.getFromName() + " " + netmail.getFromFTN());
        newsMessage.setSubject(netmail.getSubject());
        newsMessage.setCreatedDate(netmail.getDate());
        newsMessage.setBody(netmail.getText());

        return newsMessage;
    }
View Full Code Here

        } else {
            id = params.iterator().next();
        }

        // try to find message by id
        NewsMessage message = dataProvider.messageById(id, selectedGroupId);
        if (message == null) {
            // try to find message by message id
            message = dataProvider.messageByMessageId(id);
            if (message == null) {
                // message not found
View Full Code Here

        } else {
            id = params.iterator().next();
        }

        // try to find message by id
        NewsMessage message = dataProvider.messageById(id, selectedGroupId);
        if (message == null) {
            // try to find message by message id
            message = dataProvider.messageByMessageId(id);
            if (message == null) {
                // message not found
View Full Code Here

    private void generateMessages(GenericDAO<NewsMessage> dao, NewsGroup ng) {
        for (long i = ng.getReportedLowWatermark(); i <= ng.getReportedHighWatermark(); i++) {
            int userId = random2();

            NewsMessage message = new NewsMessage();
            message.setId(i);
            message.setGroupName(ng.getName());
            message.setFrom("User" + userId + " <user" + userId + "@xxx.com>");
            message.setSubject("Subject " + random());
            message.setBody("body " + random());
            message.setCreatedDate(new Date());
            dao.save(message);
        }
    }
View Full Code Here

TOP

Related Classes of org.jnode.nntp.model.NewsMessage

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.