Package in.partake.model.dto

Examples of in.partake.model.dto.Message


    @Override
    public void createFixtures(PartakeConnection con, IPartakeDAOs daos) throws DAOException {
        IMessageAccess dao = daos.getMessageAccess();
        dao.truncate(con);

        dao.put(con, new Message(DEFAULT_MESSAGE_ID, "subject", "body", new DateTime(0L), null));
    }
View Full Code Here


public class MessageTestDataProvider extends TestDataProvider<Message> {
    @Override
    public Message create(long pkNumber, String pkSalt, int objNumber) {
        UUID uuid = new UUID(pkNumber, pkSalt.hashCode());
        return new Message(uuid, "subject", "body", new DateTime(objNumber), null);
    }
View Full Code Here

    }

    @Override
    public List<Message> createSamples() {
        List<Message> array = new ArrayList<Message>();
        array.add(new Message(new UUID(0, 0), "subject", "body", new DateTime(0), null));
        array.add(new Message(new UUID(0, 1), "subject", "body", new DateTime(0), null));
        array.add(new Message(new UUID(0, 0), "subject1", "body", new DateTime(0), null));
        array.add(new Message(new UUID(0, 0), "subject", "body1", new DateTime(0), null));
        array.add(new Message(new UUID(0, 0), "subject", "body", new DateTime(1L), null));
        array.add(new Message(new UUID(0, 0), "subject", "body", new DateTime(0), new DateTime(0)));
        return array;
    }
View Full Code Here

        Event event = daos.getEventAccess().find(con, receivedMessage.getEventId());
        if (event == null)
            return null;

        Message message = daos.getMessageAccess().find(con, UUID.fromString(receivedMessage.getMessageId()));
        if (message == null)
            return null;

        return new UserMessageEx(receivedMessage, sender, event, message);
    }
View Full Code Here

            Event event = daos.getEventAccess().find(con, userMessage.getEventId());
            if (event == null)
                return null;


            Message message = daos.getMessageAccess().find(con, UUID.fromString(userMessage.getMessageId()));
            if (message == null)
                continue;

            UserMessageEx messageEx = new UserMessageEx(userMessage, sender, event, message);
            userMessageExs.add(messageEx);
View Full Code Here

            UserEx sender = UserDAOFacade.getUserEx(con, daos, eventMessage.getSenderId());
            if (sender == null)
                continue;

            Message message = daos.getMessageAccess().find(con, UUID.fromString(eventMessage.getMessageId()));
            if (message == null)
                continue;

            EventMessageEx ex = new EventMessageEx(eventMessage, sender, message);
            messageExs.add(ex);
View Full Code Here

            didSendUserMessage(con, daos, it, envelope, userMessage, MessageDelivery.FAIL);
            return;
        }

        try {
            Message message = daos.getMessageAccess().find(con, UUID.fromString(userMessage.getMessageId()));
            long twitterId = twitterLinkage.getTwitterId();

            Event event = null;
            if (userMessage.getEventId() != null)
                event = daos.getEventAccess().find(con, userMessage.getEventId());

            String url = "http://partake.in/messages/" + userMessage.getId();
            String messageBody;
            if (event != null) {
                int rest = 140;
                String format = "[PRTK] %s 「%s」に関する新着メッセージがあります。 : %s";
                rest -= Util.codePointCount(format);

                rest -= EventDAOFacade.URL_LENGTH;

                String title = Util.shorten(event.getTitle(), 30);
                rest -= Util.codePointCount(title);

                String body = Util.shorten(message.getSubject(), rest);
                messageBody = String.format(format, url, title, body);
            } else {
                int rest = 140;

                String format = "[PRTK] %s 新着メッセージがあります。: %s";
                rest -= Util.codePointCount(format);

                rest -= EventDAOFacade.URL_LENGTH;

                String subject = Util.shorten(message.getSubject(), rest);

                messageBody = String.format(format, url, subject);
            }

            PartakeApp.getTwitterService().sendDirectMesage(
View Full Code Here

            throw new PartakeException(UserErrorCode.INVALID_PROHIBITED);

        ensureNotSendingTooMuch(con, daos);

        UUID messageId = daos.getMessageAccess().getFreshId(con);
        Message message = new Message(messageId, subject, body, TimeUtil.getCurrentDateTime(), null);
        daos.getMessageAccess().put(con, message);

        String eventMessageId = daos.getEventMessageAccess().getFreshId(con);
        EventMessage eventMessage = new EventMessage(eventMessageId, eventId, sender.getId(), messageId.toString(), TimeUtil.getCurrentDateTime(), null);
        daos.getEventMessageAccess().put(con, eventMessage);
View Full Code Here

import in.partake.model.dao.postgres9.Postgres9EntityDataMapper;
import in.partake.model.dto.Message;

class EntityMessageMapper extends Postgres9EntityDataMapper<Message> {
    public Message map(ObjectNode obj) {
        return new Message(obj).freeze();
    }
View Full Code Here

TOP

Related Classes of in.partake.model.dto.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.