Package com.streamreduce.core.model.messages

Examples of com.streamreduce.core.model.messages.SobaMessage


        return sobaMessageDAO.getMessagesFromInbox(currentUser, after, before, limit, ascending, search, HashtagUtil.normalizeTags(hashTags), sender, excludeNodebellies);
    }

    @Override
    public SobaMessage getMessage(Account account, ObjectId messageId) throws MessageNotFoundException {
        SobaMessage message = sobaMessageDAO.getFromInbox(account, messageId);
        if (message == null) {
            throw new MessageNotFoundException(messageId.toString());
        }
        return message;
    }
View Full Code Here


        if (event == null || dateGenerated == null) {
            throw new IllegalArgumentException("event and dateGenerated must be non-null");
        }
        hashtags = hashtags == null ? new HashSet<String>() : hashtags;

        SobaMessage sobaMessage = null;

        try {
            // if this is the sender, should we override the ownerId? how?
            User nodebelly = userService.getSuperUser();
View Full Code Here

        MessageUtils.ParsedMessage parsedMessage = MessageUtils.parseMessage(message);
        Set<String> hashtags = parsedMessage.getTags();
        // this is now a conversation (even if with no one), so add that tag
        hashtags.add("#conversation");

        SobaMessage sobaMessage = createMessage(event,
                sender,
                null,
                new Date().getTime(),
                MessageType.USER,
                hashtags,
View Full Code Here

        // plain text
        String transformedMessage = messageTransformerResult.getTransformedMessage();
        // embed the rich formatted message in the soba object
        SobaMessageDetails sobaMessageDetails = messageTransformerResult.getMessageDetails();

        SobaMessage message = new SobaMessage.Builder()
                .sender(sender)
                .dateGenerated(dateGenerated)
                .type(type)
                .connection(connection)
                .transformedMessage(transformedMessage)
View Full Code Here


    @Override
    public void updateMessage(Account account, SobaMessage sobaMessage) throws MessageNotFoundException {
        // verify it exists first
        SobaMessage message = sobaMessageDAO.getFromInbox(account, sobaMessage.getId());
        if (message == null) {
            throw new MessageNotFoundException(sobaMessage.getId().toString());
        }
        sobaMessageDAO.saveToInbox(account, sobaMessage);
    }
View Full Code Here


    @Override
    public void addCommentToMessage(Account account, ObjectId messageId, MessageComment comment, Set<String> hashtags)
            throws MessageNotFoundException {
        SobaMessage message = getMessage(account, messageId);
        message.addComment(comment);
        if (hashtags != null && !hashtags.isEmpty()) {
            message.addHashtags(hashtags);
        }
        updateMessage(account, message);
        emailService.sendCommentAddedEmail(account, message, comment);
    }
View Full Code Here

        emailService.sendCommentAddedEmail(account, message, comment);
    }

    @Override
    public void addHashtagToMessage(Account account, ObjectId messageId, String hashtag) throws MessageNotFoundException {
        SobaMessage message = getMessage(account, messageId);

        message.addHashtag(hashtag);
        updateMessage(account, message);
    }
View Full Code Here

        updateMessage(account, message);
    }

    @Override
    public void removeHashtagFromMessage(Account account, ObjectId messageId, String hashtag) throws MessageNotFoundException {
        SobaMessage message = getMessage(account, messageId);
        message.removeHashtag(hashtag);
        updateMessage(account, message);
    }
View Full Code Here

        if (isEmpty(message)) {
            return error("Message payload can not be empty", Response.status(Response.Status.BAD_REQUEST));
        }

        SobaMessage sobaMessage;
        User sender = applicationManager.getSecurityService().getCurrentUser();
        Map<String, Object> eventContext = new HashMap<>();

        eventContext.put("message", message);
        eventContext.put("payload", json);
View Full Code Here

    @GET
    @Path("{messageId}")
    public Response getMessageById(@PathParam("messageId") ObjectId messageId) {

        User user = applicationManager.getSecurityService().getCurrentUser();
        SobaMessage sobaMessage;

        try {
            sobaMessage = applicationManager.getMessageService().getMessage(user.getAccount(), messageId);

        } catch (MessageNotFoundException e) {
View Full Code Here

TOP

Related Classes of com.streamreduce.core.model.messages.SobaMessage

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.