Package org.eurekastreams.server.domain.stream

Examples of org.eurekastreams.server.domain.stream.Activity


                            if (lastPostDate == null || entry.getPublishedDate().after(lastPostDate))
                            {
                                lastPostDate = entry.getPublishedDate();
                            }

                            Activity activity = getActivityFromATOMEntry(feed, entry, selectedObjectMapper);
                            // We were able to parse at least one good entry to completion, so the feed isn't broken.
                            brokenFeed = false;

                            if (isOutOfOrder && feed.getLastSeenGUID().equals(entry.getUri()))
                            {
                                log.info("Match found based on GUID: " + lastSeenGUID);
                                break;
                            }
                            else
                            {
                                log.info("No match found based on GUID: " + entry.getUri());
                            }

                            if (!isOutOfOrder && !entry.getPublishedDate().after(feed.getLastPostDate()))
                            {
                                log.info("Match found based on Date: " + feed.getLastPostDate());
                                break;
                            }
                            else
                            {
                                log.info("No match found based on Date: " + entry.getPublishedDate()
                                        + " Last Post Date: " + feed.getLastPostDate());
                            }

                            // create activities per subscriber
                            for (FeedSubscriber feedSubscriber : subscribers)
                            {
                                Activity activityForIndividual = (Activity) activity.clone();

                                if (feedSubscriber.getEntityType().equals(EntityType.PERSON))
                                {
                                    Person person = personFinder.execute(new FindByIdRequest("Person", feedSubscriber
                                            .getEntityId()));

                                    if (person.isAccountLocked())
                                    {
                                        log.info("Ignoring locked account: " + person.getAccountId());
                                    }
                                    else
                                    {
                                        activityForIndividual.setActorId(person.getAccountId());
                                        activityForIndividual.setRecipientStreamScope(person.getStreamScope());
                                        activityForIndividual.setIsDestinationStreamPublic(true);

                                        activityForIndividual.setActorType(feedSubscriber.getEntityType());
                                        insertedActivities.add(activityForIndividual);
                                    }
                                }
                                else if (feedSubscriber.getEntityType().equals(EntityType.GROUP))
                                {
                                    DomainGroup group = groupFinder.execute(new FindByIdRequest("DomainGroup",
                                            feedSubscriber.getEntityId()));

                                    activityForIndividual.setActorId(group.getShortName());
                                    activityForIndividual.setRecipientStreamScope(group.getStreamScope());
                                    activityForIndividual.setIsDestinationStreamPublic(group.isPublicGroup());

                                    activityForIndividual.setActorType(feedSubscriber.getEntityType());
                                    insertedActivities.add(activityForIndividual);
                                }
                            }

                        }
View Full Code Here


        if (getDomainGroupsByShortNames == null)
        {
            throw new RuntimeException("getDomainGroupsByShortNames was not set in the MessageRecipientIdClassBridge.");
        }

        Activity activity = (Activity) msgObject;
        StreamScope scope = activity.getRecipientStreamScope();
        switch (scope.getScopeType())
        {
        case GROUP:
            return "g" + getDomainGroupsByShortNames.fetchId(scope.getUniqueKey());
        case PERSON:
View Full Code Here

            updateActivityDTO(activityDTO, inCommentId, commentIds);
            getCache().set(activityByIdKey, activityDTO);
        }

        // update activity in search index
        final Activity activity = (Activity) getHibernateSession().load(Activity.class, activityId);
        Search.getFullTextSession((Session) getEntityManager().getDelegate()).index(activity);

        return true;
    }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    @Override
    public CommentDTO execute(final InsertActivityCommentRequest inRequest)
    {
        final Activity activity = (Activity) getHibernateSession().load(Activity.class, inRequest.getActivityId());
       
        // create comment and persist to DB.
        Comment comment = new Comment((Person) getHibernateSession().load(Person.class, inRequest.getUserId()),
                activity,
                inRequest.getContent().trim());
View Full Code Here

    @Test
    public void testExecute()
    {
        final EntityManager entityManager = context.mock(EntityManager.class);
        final PersistenceRequest req = context.mock(PersistenceRequest.class);
        final Activity msg = context.mock(Activity.class);

        InsertMapper sut = new InsertMapper();
        sut.setEntityManager(entityManager);

        context.checking(new Expectations()
View Full Code Here

        sut.setEntityManager(getEntityManager());

        // set 2 activities to point to shared resource with id=5 - fordp & smithers
        SharedResource sr = (SharedResource) getEntityManager().createQuery("FROM SharedResource WHERE id=5")
                .getSingleResult();
        Activity act1 = (Activity) getEntityManager().createQuery("FROM Activity WHERE id=6789").getSingleResult();
        Activity act2 = (Activity) getEntityManager().createQuery("FROM Activity WHERE id=6791").getSingleResult();
        Activity act3 = (Activity) getEntityManager().createQuery("FROM Activity WHERE id=6790").getSingleResult();
        act1.setSharedLink(sr);
        act2.setSharedLink(sr);
        act3.setSharedLink(sr);
        getEntityManager().flush();
        getEntityManager().clear();
    }
View Full Code Here

        orgShortNames.add(orgShortName3);

        PostCachedActivity sut = new PostCachedActivity(personFollowersMapper, getPersonModelViewByAccountIdMapper);
        sut.setCache(cache);

        final Activity act = context.mock(Activity.class);
        final StreamScope recipStreamScope = context.mock(StreamScope.class);

        context.checking(new Expectations()
        {
            {
View Full Code Here

        orgShortNames.add(orgShortName3);

        PostCachedActivity sut = new PostCachedActivity(personFollowersMapper, getPersonModelViewByAccountIdMapper);
        sut.setCache(cache);

        final Activity act = context.mock(Activity.class);
        final StreamScope recipStreamScope = context.mock(StreamScope.class);

        context.checking(new Expectations()
        {
            {
View Full Code Here

        final String orgShortName3 = "abcdefgi";
        orgShortNames.add(orgShortName1);
        orgShortNames.add(orgShortName2);
        orgShortNames.add(orgShortName3);

        final Activity act = context.mock(Activity.class);
        final StreamScope recipStreamScope = context.mock(StreamScope.class);

        context.checking(new Expectations()
        {
            {
View Full Code Here

        final String orgShortName3 = "abcdefgi";
        orgShortNames.add(orgShortName1);
        orgShortNames.add(orgShortName2);
        orgShortNames.add(orgShortName3);

        final Activity act = context.mock(Activity.class);
        final StreamScope recipStreamScope = context.mock(StreamScope.class, "recipStreamScope");

        final SharedResource sharedResource = context.mock(SharedResource.class);
        final StreamScope sharedResourceStreamScope = context.mock(StreamScope.class, "sharedResourceStreamScope");
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.domain.stream.Activity

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.