Package org.eurekastreams.commons.actions.context

Examples of org.eurekastreams.commons.actions.context.DefaultPrincipal


            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
                        .getUserActionRequests());
            }
View Full Code Here


        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());
        }

        // trigger notification if group will be pending approval
View Full Code Here

            {
                throw new PrincipalPopulationException("Unable to find principal for OpenSocialId: " + inOpenSocialId);
            }
        }

        return new DefaultPrincipal(user.getAccountId(), user.getOpenSocialId(), user.getEntityId());
    }
View Full Code Here

     * {@inheritDoc}.
     */
    @Override
    public Principal execute(final String inAccountId)
    {
        DefaultPrincipal result = null;
        try
        {
            // grab info from cache/db.
            PersonModelView pmv = getPersonMVByAccountId.execute(inAccountId);

            // if found, create principal, else attempt to create from LDAP (creates locked user in DB).
            if (pmv != null)
            {
                result = new DefaultPrincipal(pmv.getAccountId(), pmv.getOpenSocialId(), pmv.getId());
            }
            // not found in cache or DB, go to ldap to create person entry and principal if possible.
            else
            {
                logger.info("Unable to populate principal from cache/db, looking up user in LDAP for: " + inAccountId);
                Person person = (Person) serviceActionController.execute(new ServiceActionContext(inAccountId, null),
                        createUserfromLdapAction);
                result = new DefaultPrincipal(person.getAccountId(), person.getOpenSocialId(), person.getId());
            }
        }
        catch (Exception ex)
        {
            logger.info("Unable to populate principal from DataStore for: " + inAccountId, ex);
View Full Code Here

                // Note: create a principal for the follower: we want to post on the follower's stream as the
                // follower.
                // The current principal will be different from the follower in some cases, namely when following a
                // private group (the current principal / actor is the coordinator who approved access).
                new InlineExecutionStrategyExecutor().execute(postActivityExecutor, new PostActivityRequest(activity),
                        new DefaultPrincipal(followerAccountId, null, followerId),
                        inActionContext.getUserActionRequests());
            }
            break;

        case NOTFOLLOWING:
View Full Code Here

     *            Person account id.
     * @return Principal.
     */
    private Principal createPrincipal(final Long followerId, final String followerAccountId)
    {
        return new DefaultPrincipal(followerAccountId, null, followerId);
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.commons.actions.context.DefaultPrincipal

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.