Examples of SetFollowingStatusByGroupCreatorRequest


Examples of org.eurekastreams.server.action.request.profile.SetFollowingStatusByGroupCreatorRequest

                oneOf(groupFollowerIdsMapperMock).execute(GROUP_ID);
                will(returnValue(followerIds));
            }
        });

        SetFollowingStatusByGroupCreatorRequest currentRequest = new SetFollowingStatusByGroupCreatorRequest(
                FOLLOWER_ID, GROUP_ID, Follower.FollowerStatus.FOLLOWING, "Group Name", "groupName", false);
        TaskHandlerActionContext<PrincipalActionContext> actionContext = TestContextCreator
                .createTaskHandlerContextWithPrincipal(currentRequest, principal);
        Serializable result = sut.execute(actionContext);
View Full Code Here

Examples of org.eurekastreams.server.action.request.profile.SetFollowingStatusByGroupCreatorRequest

            newCoordinators.removeAll(oldCoordinators);

            // Make all coordinators follow/join the new group
            for (Person coordinator : newCoordinators)
            {
                SetFollowingStatusByGroupCreatorRequest currentRequest = new SetFollowingStatusByGroupCreatorRequest(
                        coordinator.getId(), inGroup.getId(), Follower.FollowerStatus.FOLLOWING, inGroup.getName(),
                        inGroup.getShortName(), false);
                new InlineExecutionStrategyExecutor().execute(followStrategy, currentRequest, new DefaultPrincipal(
                        creatorUserName, inActionContext.getActionContext().getPrincipal().getOpenSocialId(),
                        inActionContext.getActionContext().getPrincipal().getId()), inActionContext
View Full Code Here

Examples of org.eurekastreams.server.action.request.profile.SetFollowingStatusByGroupCreatorRequest

        queueAsyncAction(inActionContext, inGroup, false);

        // Make all coordinators follow/join the new group
        for (Person coordinator : inGroup.getCoordinators())
        {
            SetFollowingStatusByGroupCreatorRequest currentRequest = new SetFollowingStatusByGroupCreatorRequest(
                    coordinator.getId(), inGroup.getId(), Follower.FollowerStatus.FOLLOWING, inGroup.getName(),
                    inGroup.getShortName(), isPending);
            new InlineExecutionStrategyExecutor().execute(followStrategy, currentRequest, new DefaultPrincipal(
                    creatorUserName, principal.getOpenSocialId(), creatorPersonId), inActionContext
                    .getUserActionRequests());
View Full Code Here

Examples of org.eurekastreams.server.action.request.profile.SetFollowingStatusByGroupCreatorRequest

            targetName = targetResult.getName();
            targetId = targetResult.getEntityId();
        }
        else if (params instanceof SetFollowingStatusByGroupCreatorRequest)
        {
            SetFollowingStatusByGroupCreatorRequest currentRequest = // \n
            (SetFollowingStatusByGroupCreatorRequest) params;
            followerId = currentRequest.getFollowerId();
            targetId = currentRequest.getTargetId();
            targetName = currentRequest.getTargetName();
            followerStatus = currentRequest.getFollowerStatus();
            isPending = currentRequest.isPending();

            if (Follower.FollowerStatus.FOLLOWING.equals(followerStatus) && !isPending)
            {
                followerAccountId = getPersonByIdMapper.execute(followerId).getAccountId();
            }
        }
        else
        {
            throw new IllegalArgumentException("Invalid Request type sent to SetFollowingGroupStatusExecution.");
        }

        switch (followerStatus)
        {
        case FOLLOWING:
            // Update the db and cache for list of followers and following.
            domainGroupMapper.addFollower(followerId, targetId);
            // Update the cache list of followers
            addCachedGroupFollowerMapper.execute(followerId, targetId);

            // Queue async action to remove the newly followed group from cache (to sync follower counts)
            asyncRequests.add(new UserActionRequest("deleteCacheKeysAction", null, (Serializable) Collections
                    .singleton(CacheKeys.GROUP_BY_ID + targetId)));

            // remove any requests from the user for group membership
            if (deleteRequestForGroupMembershipMapper
                    .execute(new RequestForGroupMembershipRequest(targetId, followerId)))
            {
                // if any requests were present, then user was just approved for access
                asyncRequests.add(new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null,
                        new GroupMembershipResponseNotificationsRequest(RequestType.REQUEST_GROUP_ACCESS_APPROVED,
                                inActionContext.getActionContext().getPrincipal().getId(), targetId, followerId)));
            }

            // remove person modelview from cache as groupstreamhiddenlineindex will be changed.
            deleteCacheKeyMapper.execute(Collections.singleton(CacheKeys.PERSON_BY_ID + followerId));

            // Sends new follower notifications.
            asyncRequests.add(new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null,
                    new TargetEntityNotificationsRequest(RequestType.FOLLOW_GROUP, followerId, targetId)));

            // Posts a message to the user's personal stream unless this is a new pending group
            if (!isPending)
            {
                String targetStream = "";

                if (params instanceof SetFollowingStatusRequest)
                {
                    SetFollowingStatusRequest currentRequest = (SetFollowingStatusRequest) params;
                    targetStream = currentRequest.getTargetUniqueId();
                }
                else if (params instanceof SetFollowingStatusByGroupCreatorRequest)
                {
                    SetFollowingStatusByGroupCreatorRequest currentRequest = // \n
                    (SetFollowingStatusByGroupCreatorRequest) params;
                    targetStream = currentRequest.getTargetUniqueId();
                }

                StreamEntityDTO destination = new StreamEntityDTO();
                destination.setUniqueIdentifier(followerAccountId);
                destination.setType(EntityType.PERSON);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.