Package org.eurekastreams.commons.actions.context

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


        final List<ActivityDTO> activityResults = new ArrayList<ActivityDTO>();
        activityResults.add(currentActivity);

        final PostActivityRequest request = new PostActivityRequest(currentActivity);

        final Principal currentPrincipal = new DefaultPrincipal(ACCOUNT_ID, OPENSOCIAL_ID, USER_ID);

        final SharedResource sr = new SharedResource();

        final String cacheSuffix = "SOMETHING";
        final String expectedCacheKey = CacheKeys.SHARED_RESOURCE_BY_UNIQUE_KEY + cacheSuffix;
View Full Code Here


        final List<ActivityDTO> activityResults = new ArrayList<ActivityDTO>();
        activityResults.add(currentActivity);

        final PostActivityRequest request = new PostActivityRequest(currentActivity);

        final Principal currentPrincipal = new DefaultPrincipal(ACCOUNT_ID, OPENSOCIAL_ID, USER_ID);

        context.checking(new Expectations()
        {
            {
                oneOf(recipientRetrieverMock).getStreamScope(currentActivity);
View Full Code Here

     */
    @Test
    public void testToStringUser()
    {
        UserActionRequest sut = new UserActionRequest(ACTION_KEY,
                new DefaultPrincipal("accountid", "opensocialid", 1L), params);
        assertNotNull(sut.toString());
    }
View Full Code Here

        final List<ActivityDTO> activityResults = new ArrayList<ActivityDTO>();
        activityResults.add(currentActivity);

        final PostActivityRequest request = new PostActivityRequest(currentActivity);

        final Principal currentPrincipal = new DefaultPrincipal(ACCOUNT_ID, OPENSOCIAL_ID, USER_ID);

        context.checking(new Expectations()
        {
            {
                oneOf(recipientRetrieverMock).getStreamScope(currentActivity);
View Full Code Here

    @Test
    public void testAuthorize()
    {
        fields = new HashMap<String, Serializable>();
        fields.put("accountid", "testaccount");
        DefaultPrincipal currentPrincipal = new DefaultPrincipal("testaccount", null, null);
        ServiceActionContext currentContext = new ServiceActionContext(fields, currentPrincipal);
        sut.authorize(currentContext);
    }
View Full Code Here

    @Test(expected = AuthorizationException.class)
    public void testAuthorizeFailure()
    {
        fields = new HashMap<String, Serializable>();
        fields.put("accountid", "testaccount");
        DefaultPrincipal currentPrincipal = new DefaultPrincipal("coolaccount", null, null);
        ServiceActionContext currentContext = new ServiceActionContext(fields, currentPrincipal);
        sut.authorize(currentContext);
    }
View Full Code Here

    @Test(expected = AuthorizationException.class)
    public void testAuthorizeFailureMissingKey()
    {
        fields = new HashMap<String, Serializable>();
        fields.put("badkey", "testaccount");
        DefaultPrincipal currentPrincipal = new DefaultPrincipal("coolaccount", null, null);
        ServiceActionContext currentContext = new ServiceActionContext(fields, currentPrincipal);
        sut.authorize(currentContext);
    }
View Full Code Here

    {
        try
        {
            Object springBean = beanFactory.getBean(actionSelection.getActionKey());
            PrincipalActionContext actionContext = new ServiceActionContext(actionSelection.getParams(),
                    new DefaultPrincipal(person.getAccountId(), person.getOpenSocialId(), person.getId()));
            actionContext.setActionId(actionSelection.getActionKey());
            if (springBean instanceof ServiceAction)
            {
                ServiceAction action = (ServiceAction) springBean;
                serviceActionController.execute(actionContext, action);
View Full Code Here

            if (actionBean instanceof ServiceAction || actionBean instanceof TaskHandlerServiceAction)
            {
                SaveImageRequest currentRequest = new SaveImageRequest(uploadItem, domainEntity.getId(), imageId);
                ActionController serviceActionController = (ActionController) springContext
                        .getBean("serviceActionController");
                DefaultPrincipal principal = new DefaultPrincipal(userDetails.getUsername(),
                        ((ExtendedUserDetails) userDetails).getPerson().getOpenSocialId(),
                        ((ExtendedUserDetails) userDetails).getPerson().getId());
                ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principal);

                if (actionBean instanceof ServiceAction)
View Full Code Here

            Object obj = auth.getPrincipal();
            if (obj instanceof UserDetails)
            {
                UserDetails user = (UserDetails) obj;
                ExtendedUserDetails extUser = (ExtendedUserDetails) user;
                return new DefaultPrincipal(extUser.getUsername(), extUser.getPerson().getOpenSocialId(), extUser
                        .getPerson().getId());
            }
            else
            {
                return null;
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.